SOURCE-HIGHLIGHT(1)
β¨ SOURCE-HIGHLIGHT β¨
okay bestie, welcome to the User Commands section of the manual, we're talking about source-highlight and honestly? she's iconic π
π NAME π
Source-highlight β convert source code to syntax highlighted document β¨
πΈ SYNOPSIS πΈ
source-highlight [OPTIONS]... < INPUT_FILE > OUTPUT_FILE
π¦ DESCRIPTION π¦
GNU GNU source-highlight 3.1.9 (yes bestie it says GNU twice, that's just how she is, we don't question the queen)
The whole vibe: highlight the syntax of a source file (e.g. Java) into a specific format (e.g. HTML) π
source-highlight [OPTIONS]... -i INPUT_FILE -o OUTPUT_FILE
source-highlight [OPTIONS]... [FILES]...
π the options, in order, no skips, periodt π
-h,--helpβ Print help and exit--detailed-helpβ Print help, including all details and hidden options, and exit-V,--versionβ Print version and exit-i,--input=FILENAMEβ Input file (default=stdin)-o,--output=FILENAMEβ Output file (default=stdout, when the third invocation form is used). If'STDOUT'is specified, the output is directed to standard output
ok so plot twist: you can literally just drop some files at the command line and also use regular expressions (for instance *.java) π In this case the name for the output files will be formed using the name of the source file with a .EXT appended, where EXT is the extension chosen according to the output format specified (for instance .html) π«
-s,--src-lang=STRINGβ source language (use--lang-listto get the complete list). If not specified, the source language will be guessed from the file extension--lang-listβ list all the supported language and associated language definition file--outlang-listβ list all the supported output language and associated language definition file-f,--out-format=STRINGβ output format (use--outlang-listto get the complete list) (default=html)-d,--docβ create an output file that can be used as a stand alone document (e.g., not to be included in another one)--no-docβ cancel the--docoption even if it is implied (e.g., when css is given)-c,--css=FILENAMEβ the external style sheet filename. Implies--doc-T,--title=STRINGβ give a title to the output document. Implies--doc-t,--tab=INTβ specify tab length. (default=8)-H,--header=FILENAMEβ file to insert as header-F,--footer=FILENAMEβ file to insert as footer--style-file=FILENAMEβ specify the file containing format options (default=default.style)--style-css-file=FILENAMEβ specify the file containing format options (in css syntax)--style-defaults=FILENAMEβ specify the file containing defaults for format options (default=style.defaults)--outlang-def=FILENAMEβ output language definition file--outlang-map=FILENAMEβ output language map file (default=outlang.map)--data-dir=PATHβ directory where language definition files and language maps are searched for. If not specified these files are searched for in the current directory and in the data dir installation directory--output-dir=PATHβ output directory--lang-def=FILENAMEβ language definition file--lang-map=FILENAMEβ language map file (default=lang.map)--show-lang-elements=FILENAMEβ prints the language elements that are defined in the language definition file--infer-langβ force to infer source script language (overriding given language specification)
β¨ Lines: β¨
-n,--line-number[=PADDING]β number all output lines, using the specified padding character (default=0)--line-number-ref[=PREFIX]β number all output lines and generate an anchor, made of the specified prefix + the line number (default=line)
π«§ Filtering output: π«§
Mode: linerange
specifying line ranges πΈ
--line-range=STRINGβ generate only the lines in the specified range(s)--range-separator=STRINGβ the optional separator to be printed among ranges (e.g.,"...")--range-context=INTβ number of (context) lines generated even if not in range
Mode: regexrange
specifying regular expression delimited ranges π§
--regex-range=STRINGβ generate only the lines within the specified regular expressions
π reference generation: π
--gen-references=STRINGβ generate references (possible values="inline","postline","postdoc"default=inline)--ctags-file=FILENAMEβ specify the file generated by ctags that will be used to generate references (default=tags)--ctags=CMDβ how to run the ctags command. If this option is not specified, ctags will be executed with the default value. If it is specified with an empty string, ctags will not be executed at all (default=ctags --excmd=n --tag-relative=yes)
π testing: π
-v,--verboseβ verbose mode on-q,--quietβ print no progress information--binary-outputβ write output files in binary mode--statisticsβ print some statistics (i.e., elapsed time)--gen-versionβ put source-highlight version in the generated file (default=on)--check-lang=FILENAMEβ only check the correctness of a language definition file--check-outlang=FILENAMEβ only check the correctness of an output language definition file--failsafeβ if no language definition is found for the input, it is simply copied to the output-g,--debug-langdef[=TYPE]β debug a language definition. In dump mode just dumps all the steps; in interactive, at each step, waits for some input (press ENTER to step) (possible values="interactive","dump"default=dump)--show-regex=FILENAMEβ show the regular expression automaton corresponding to a language definition file
Maintained by Lorenzo Bettini <http://www.lorenzobettini.it> π«Ά
π REPORTING BUGS π
Report bugs to <bug-source-highlight at gnu.org>
π COPYRIGHT π
Copyright Β© 1999-2008 Lorenzo Bettini <http://www.lorenzobettini.it>
This program comes with ABSOLUTELY NO WARRANTY. π«£
This is free software; you may redistribute copies of the program under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING.
π₯ SEE ALSO π₯
The full documentation for Source-highlight is maintained as a Texinfo manual. If the info and Source-highlight programs are properly installed at your site, the command
info Source-highlight
should give you access to the complete manual π
and that's the whole page bestie β¨ this was Source-highlight 3.1.9 (library... June 2019) and honestly? she ate and left no crumbs. ily, go highlight something pretty π π
π¦ where this page comes from
- alpine 3.22: source-highlight-doc 3.1.9-r14 Β· GPL-3.0-or-later
- alpine 3.23: source-highlight-doc 3.1.9-r14 Β· GPL-3.0-or-later
- alpine 3.24: source-highlight-doc 3.1.9-r14 Β· GPL-3.0-or-later
- arch rolling: source-highlight 3.1.9-19 Β· GPL-3.0-or-later
- centos-stream 10: source-highlight 3.1.9-25.el10 Β· GPL-3.0-or-later AND GFDL-1.1-or-later AND LicenseRef-Fedora-Public-Domain AND GPL-2.0-only AND GPL-3.0-only AND GPL-3.0-or-later WITH Bison-exception-2.2
- centos-stream 9: source-highlight 3.1.9-12.el9 Β· GPLv3+
- centos-stream 9: source-highlight 3.1.9-12.el9 Β· GPLv3+
- debian bookworm: source-highlight 3.1.9-4.2+b3 Β· GPL-3.0-or-later
- debian trixie: source-highlight 3.1.9-4.3+b1 Β· GPL-3.0-or-later
- fedora 43: source-highlight 3.1.9-25.fc43 Β· GPL-3.0-or-later AND GFDL-1.1-or-later AND LicenseRef-Fedora-Public-Domain AND GPL-2.0-only AND GPL-3.0-only AND GPL-3.0-or-later WITH Bison-exception-2.2
- fedora 43: source-highlight 3.1.9-25.fc43 Β· GPL-3.0-or-later AND GFDL-1.1-or-later AND LicenseRef-Fedora-Public-Domain AND GPL-2.0-only AND GPL-3.0-only AND GPL-3.0-or-later WITH Bison-exception-2.2
- fedora 44: source-highlight 3.1.9-27.fc44 Β· GPL-3.0-or-later AND GFDL-1.1-or-later AND LicenseRef-Fedora-Public-Domain AND GPL-2.0-only AND GPL-3.0-only AND GPL-3.0-or-later WITH Bison-exception-2.2
- fedora 44: source-highlight 3.1.9-27.fc44 Β· GPL-3.0-or-later AND GFDL-1.1-or-later AND LicenseRef-Fedora-Public-Domain AND GPL-2.0-only AND GPL-3.0-only AND GPL-3.0-or-later WITH Bison-exception-2.2
- nixos 26.05: source-highlight 3.1.9
- nixpkgs unstable: source-highlight 3.1.9
- opensuse-leap 16.0: source-highlight 3.1.9-160000.2.2 Β· GPL-3.0-only
- opensuse-leap 16.0: source-highlight 3.1.9-160000.2.2 Β· GPL-3.0-only
- opensuse-leap 16.0: source-highlight 3.1.9-160000.2.2 Β· GPL-3.0-only
- opensuse-leap 16.0: source-highlight 3.1.9-160000.2.2 Β· GPL-3.0-only
- ubuntu jammy: source-highlight 3.1.9-4.1build2 Β· GPL-3.0-or-later
- ubuntu noble: source-highlight 3.1.9-4.3build1 Β· GPL-3.0-or-later
- ubuntu questing: source-highlight 3.1.9-4.3build1
- ubuntu resolute: source-highlight 3.1.9-4.3build2 Β· GPL-3.0-or-later
- ubuntu stonking: source-highlight 3.1.9-4.3build2 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms