Anyone know of a tool that will let me paste code into a word document and keep the syntax highlighting?
Because I was a bad person and am currently in hell, I have to document my code in a word document. But I also want the formatting to look nice.
@allan maybe could use an online prettifier in JS that uses inline styles, then copy/paste the whole <pre>/<code> block. Pretty sure word tries to preserve HTML formatting.
@thurloat that's a good idea!
@thurloat @allan Along the same lines, you can also just use the commandline interface for Pygments to spit out .html files for your source files that you can then open and copy-paste from.
@allan Why not make the formatting incredibly ugly to punish whoever has inflicted this torture upon you? This seems like the kind of thing that passive aggression was invented for.
@allan (only tried on a mac) copying out of VS Code preserves highlighting on paste.
follow up: I ended up using https://tohtml.com/
Paste in code, click highlight, then paste result into word. Works perfectly.