HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

highlight — Output syntax-highlighted source code to a variety of formats. More information: <http://andre-simon

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandsourceclicodesyntaxhighlighthighlightedoutput

Problem

How to use the highlight command: Output syntax-highlighted source code to a variety of formats. More information: <http://andre-simon.de/doku/highlight/en/highlight.php>.

Solution

highlight — Output syntax-highlighted source code to a variety of formats. More information: <http://andre-simon.de/doku/highlight/en/highlight.php>.

Produce a complete HTML document from a source code file:
highlight {{[-o|--out-format]}} {{html}} {{[-s|--style]}} {{theme_name}} {{[-S|--syntax]}} {{language}} {{path/to/source_code}}


Produce an HTML fragment, suitable for inclusion in a larger document:
highlight {{[-o|--out-format]}} {{html}} {{[-f|--fragment]}} {{[-S|--syntax]}} {{language}} {{source_file}}


Inline the CSS styling in every tag:
highlight {{[-o|--out-format]}} {{html}} --inline-css {{[-S|--syntax]}} {{language}} {{source_file}}


List all supported languages, themes, or plugins:
highlight --list-scripts {{langs|themes|plugins}}


Print a CSS stylesheet for a theme:
highlight {{[-o|--out-format]}} {{html}} --print-style {{[-s|--style]}} {{theme_name}} {{[-S|--syntax]}} {{language}} --stdout

Code Snippets

Produce a complete HTML document from a source code file

highlight {{[-o|--out-format]}} {{html}} {{[-s|--style]}} {{theme_name}} {{[-S|--syntax]}} {{language}} {{path/to/source_code}}

Produce an HTML fragment, suitable for inclusion in a larger document

highlight {{[-o|--out-format]}} {{html}} {{[-f|--fragment]}} {{[-S|--syntax]}} {{language}} {{source_file}}

Inline the CSS styling in every tag

highlight {{[-o|--out-format]}} {{html}} --inline-css {{[-S|--syntax]}} {{language}} {{source_file}}

List all supported languages, themes, or plugins

highlight --list-scripts {{langs|themes|plugins}}

Print a CSS stylesheet for a theme

highlight {{[-o|--out-format]}} {{html}} --print-style {{[-s|--style]}} {{theme_name}} {{[-S|--syntax]}} {{language}} --stdout

Context

tldr-pages: common/highlight

Revisions (0)

No revisions yet.