PK
by Lorenzo Bettini
Here we only show some examples of generated files.
Here are some links to some of the C and C++ sources of source-highlight colored with source-highlight itself:
source-highlight.cc.html
source-highlight -s cpp -f html --doc source-highlight.cc
cmdline.h.html
source-highlight -s cpp -f html *.h --css="mono.css"
source-highlight -s java -f html -i Hello.java -o Hello1.htmlsource-highlight -s java -f html --input Hello.java --output Hello2.html --docsource-highlight -s java -f html -i Hello.java -o Hello3.html --title "Happy Java with java2html :-)" --tab 3source-highlight -s java -f html < Hello.java > Hello4.html --title "and what about CSS :-)" --css "Hello.css"source-highlight -s java -f html < Hello.java > Hello5.html --title "Wooo... this is quite dark ;-D" --css "mono-alt.css"source-highlight -s java -f html --doc *.javaProcessed Hello.java (creates Hello.java.html)source-highlight -s java -f html --doc -i Hello.java -o Hello_h_f.html --style-file="default.style" --header="header.html" --footer="footer.html"source-highlight -s java -f html --line-number --doc -i Hello.java -o Hello_lines.htmlsource-highlight -s java -f xhtml --doc -i Hello.java -o Hello_xhtml.html --css xhtml.csssource-highlight -s java -f xhtml --doc -i Hello.java -o Hello_xhtml2.html --style-file default.stylesource-highlight -s java --outlang-def=html_notfixed.outlang -i Hello.java -o Hello_notfixed.html --style-file default.style
Hello_h_f.html
source-highlight -s java -f html -i Hello.java -o Hello_h_f.html --css="cpp2html.css" --header="./header.html" --footer="./footer.html"
source-highlight -s java -f html --line-range="12-18","29-34" --line-number --range-context=3 --range-separator="<...>" -i test.java -o test_linerange_sep.html
Range of output can also be specified using regular expressions: the beginning of the range will be detected by a line containing (in any point) a string matching the specified regular expression; the end will be detected by a line containing a string matching the same regular expression that started the range. This feature is very useful when we want to document some code (e.g., in this very manual) by showing only specific parts, that are delimited in a ad-hoc way in the source code (e.g., with specific comment patterns). for instance, this output was produced, starting from this input, with the following command
ssource-highlight -s java -f html --regex-range="/\* [[:alpha:]]+ \*/" --line-number -i test.java -o test_regexrange4.html
Here's the output of source-highlight applied to a Prolog program (through the option `source-highlight -s prolog`: test.pl.html. This one is an highlighted Perl program (through the option `source-highlight -s prolog`): test.pm.html. Here's an highlighted PHP3 program: test.php3.html. And here's a Python program: test.py.html. This the flex scanner for flex files flex_scanner.ll.html. This is a Ruby program: test.rb.html. This is a Javascript program test.js.html. This is a Lua test program test.lua.html. This is a Caml test program test.ml.html and this is an Sml test program test.sml.html. Here are some log files formatted using the color file syslog.style:
This is the language definition file for C/C++: cpp.lang.html, the one for the log files above, log.lang.html, and the language definition file for the language definition syntax itself: langdef.lang.html.
Here's the html output of test.java.html formatted in html itself: test.htm.html. and here's the output of test.java.tex formatted in html: test.java.tex.html
These HTML outputs contain cross references, test_refs.h.html, test_refs.cpp.html, generated with the following command:
source-highlight -s cpp -f html --title="Contains references to tags" --gen-references=inline test_refs.h test_refs.cpp
Since version 2.6, source-highlight can use CSS style files (limited support) as style files for coloring and formatting the output. Here you can find the output using all these files shipped with source-highlight (these were adapted from those provided by SHJS):
Style examples (huge file).