2017-04-17 21:03:00 +03:00
|
|
|
# pygmentize
|
|
|
|
|
2017-04-24 09:33:27 +03:00
|
|
|
> Python based syntax highlighter.
|
2017-04-17 21:03:00 +03:00
|
|
|
|
2017-04-24 09:33:27 +03:00
|
|
|
- Highlight file syntax and print to standard output. Language is inferred from the file extension:
|
2017-04-17 21:03:00 +03:00
|
|
|
|
2017-04-24 09:33:27 +03:00
|
|
|
`pygmentize {{file.py}}`
|
2017-04-17 21:03:00 +03:00
|
|
|
|
2017-04-24 09:33:27 +03:00
|
|
|
- Highlight syntax for a given language:
|
2017-04-17 21:03:00 +03:00
|
|
|
|
2017-04-24 09:33:27 +03:00
|
|
|
`pygmentize -l {{javascript}} {{javascript_file}}`
|
2017-04-17 21:03:00 +03:00
|
|
|
|
|
|
|
- Show avaliable lexers:
|
|
|
|
|
|
|
|
`pygmentize -L lexers`
|
|
|
|
|
2017-04-24 09:33:27 +03:00
|
|
|
- Redirect output to a file in html format:
|
2017-04-17 21:03:00 +03:00
|
|
|
|
2017-04-24 09:33:27 +03:00
|
|
|
`pygmentize -f html -o {{file.html}} {{file.py}}`
|
2017-04-17 21:03:00 +03:00
|
|
|
|
|
|
|
- Show avaliable output formats:
|
|
|
|
|
|
|
|
`pygmentize -L formatters`
|
|
|
|
|
2017-04-24 09:33:27 +03:00
|
|
|
- Output to HTML file with line numbers, specifying a given language:
|
2017-04-17 21:03:00 +03:00
|
|
|
|
2017-04-24 09:33:27 +03:00
|
|
|
`pygmentize -f html -O linenos=1 -l {{language}} -o {{file.html}} {{file}}`
|