1

I want to print out some code on paper including syntax highlighting. After some research, I found out, that I could do this with pygments and enscript, but don't know how to combine these tools. Obviously there must be someone out there, who has done this before. Or is there a better way of doing it?
BTW: I know I can do this in vim too, but I don't like how it prints out JSON files.

1 Answer 1

1

Depending on what output format you want, you may not actually need enscript. Pygments can render your input to various formats, including html, rtf, latex and various others.

You can call pygments on the command line passing input file and output format.

To let pygments render a json file to html use ...

$ pygmentize -f html -o foobar.html foobar.json

To render to rtf use ...

$ pygmentize -f rtf -o foobar.rtf foobar.json

Available output formats are listed at:

http://pygments.org/docs/formatters/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.