mirror of
https://github.com/tldr-pages/tldr.git
synced 2024-11-12 04:54:52 +03:00
Simplify pygmentize
- Simplify main description - Mentioning that language is inferred from file extension - Giving a concrete example for another lexer.
This commit is contained in:
parent
5c278bdf69
commit
d49b95fc53
@ -1,27 +1,27 @@
|
||||
# pygmentize
|
||||
|
||||
> CLI Python Syntax Highlighter.
|
||||
> Python based syntax highlighter.
|
||||
|
||||
- Highlight syntax:
|
||||
- Highlight file syntax and print to standard output. Language is inferred from the file extension:
|
||||
|
||||
`pygmentize {{filename}}`
|
||||
`pygmentize {{file.py}}`
|
||||
|
||||
- Highlight syntax (another language):
|
||||
- Highlight syntax for a given language:
|
||||
|
||||
`pygmentize -l {{lexer}} {{filename}}`
|
||||
`pygmentize -l {{javascript}} {{javascript_file}}`
|
||||
|
||||
- Show avaliable lexers:
|
||||
|
||||
`pygmentize -L lexers`
|
||||
|
||||
- Output to HTML:
|
||||
- Redirect output to a file in html format:
|
||||
|
||||
`pygmentize -f html -l {{lexer}} -o {{output}} {{filename}}`
|
||||
`pygmentize -f html -o {{file.html}} {{file.py}}`
|
||||
|
||||
- Show avaliable output formats:
|
||||
|
||||
`pygmentize -L formatters`
|
||||
|
||||
- Output to HTML with a line numbers:
|
||||
- Output to HTML file with line numbers, specifying a given language:
|
||||
|
||||
`pygmentize -f html -O linenos=1 -l {{lexer}} -o {{output}} {{filename}}`
|
||||
`pygmentize -f html -O linenos=1 -l {{language}} -o {{file.html}} {{file}}`
|
||||
|
Loading…
Reference in New Issue
Block a user