File: index.html

package info (click to toggle)
source-highlight 3.1.7-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 10,332 kB
  • ctags: 5,233
  • sloc: sh: 11,270; cpp: 10,206; ansic: 9,515; makefile: 1,865; lex: 1,200; yacc: 1,021; php: 213; perl: 211; awk: 98; erlang: 94; lisp: 90; java: 75; ruby: 69; python: 61; asm: 43; ml: 38; ada: 36; haskell: 27; xml: 23; cs: 11; sql: 8; tcl: 6; sed: 4
file content (501 lines) | stat: -rw-r--r-- 19,478 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Lorenzo Bettini"><title>GNU Source-highlight - GNU Project - Free Software Foundation (FSF)</title></head>
<body style="background-color: rgb(255, 255, 255);">
<h1><a class="mozTocH1" name="mozTocId593827"></a>
GNU Source-highlight 3.1.7</h1>
<p>by <a href="http://www.lorenzobettini.it">Lorenzo
Bettini</a> </p>
<p>This program, <i>given a source file, produces a
document with
syntax highlighting</i>. It also provides a <b>C++ highlight library</b>
<font color="red">(new)</font>
(since version 3.0).</p>
<p>
Source-highlight reads source language specifications
dynamically, thus it can be easily extended (without recompiling
the sources) for handling new languages. It also reads output format
specifications dynamically, and
thus it can be easily extended (without recompiling
the sources) for handling new output formats.
The syntax for these specifications is quite easy (take a look at the
manual).</p>
<p>Source-highlight is a command line program, and it can also be
used as a <a href="source-highlight.html#Using-source_002dhighlight-as-a-CGI">CGI</a>.</p>
<p>Notice that source-highlight can also be used as a formatter
(i.e.,
without highlighting): you can, for instance, format a txt file in HTML
(and it will take care of translating special characters, such as,
&lt;, &gt;, &amp;). </p>
<p>
Since version 2.2, source-highlight can also generate cross
references; in order to do this it relies on
<i>GNU Ctags</i>,
<a href="http://ctags.sourceforge.net">http://ctags.sourceforge.net</a>.
</p>
<p>These are the output formats already supported:<br>
</p>
<ul>
<li> <i>HTML</i></li>
<li> <i>XHTML</i></li>
<li> <i>LATEX</i></li>
<li> <i>MediaWiki</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
<li> <i>ODF</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
<li> <i>TEXINFO</i></li>
<li><i>ANSI color escape sequences</i> (you can
use this feature with less)</li>
<li><span style="font-style: italic;">DocBook</span></li>
</ul>
<p>These are the input languages (or input formats) already
supported
(in alphabetical order):<br>
</p>
<ul>
<li> <i>Ada</i></li>
<li> <i>Asm</i></li>
<li> <i>Applescript</i></li>
<li> <i>Awk</i></li>
<li> <i>Autoconf files</i></li>
<li> <i>Bat</i></li>
<li> <i>Bib</i></li>
<li> <i>Bison</i></li>
<li> <i>C/C++</i></li>
<li> <i>C#</i></li>
<li> <i>CakePhp templates</i></li>
<li> <i>Clipper</i></li>
<li> <i>Cobol</i></li>
<li> <i>Configuration files (generic)</i></li>
<li> <i>Caml</i></li>
<li> <i>Changelog</i></li>
<li> <i>Css</i></li>
<li> <i>D</i></li>
<li> <i>Diff</i></li>
<li> <i>Emacs Lisp</i></li>
<li> <i>Erlang</i></li>
<li> <i>errors (compiler output)</i></li>
<li> <i>Flex</i></li>
<li> <i>Fortran</i></li>
<li> <i>GLSL</i></li>
<li> <i>Haskell</i></li>
<li> <i>Haskell literate programming</i></li>
<li> <i>Haxe</i></li>
<li> <i>Html</i></li>
<li> <i>ini files</i></li>
<li> <i>IsLisp</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
<li> <i>Java</i></li>
<li> <i>Javalog</i></li>
<li> <i>Javascript</i></li>
<li> <i>KDE desktop files</i></li>
<li> <i>Latex</i></li>
<li> <i>Ldap files</i></li>
<li> <i>Lilypond</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
<li> <i>Lisp</i></li>
<li> <i>Logtalk</i></li>
<li> <i>Log files</i></li>
<li> <i>lsm files (Linux Software Map)</i></li>
<li> <i>Lua</i></li>
<li> <i>Makefile</i></li>
<li> <i>Manifest</i></li>
<li> <i>M4</i></li>
<li> <i>ML</i></li>
<li> <i>Opa</i></li>
<li> <i>Oz</i></li>
<li> <i>Pascal</i></li>
<li> <i>Perl</i></li>
<li> <i>pkg-config files</i></li>
<li> <i>PHP</i></li>
<li> <i>Po</i></li>
<li> <i>Postscript</i></li>
<li> <i>Prolog</i></li>
<li> <i>Properties files</i></li>
<li> <i>Protobuf (Google's Protocol Buffers)</i></li>
<li> <i>Python</i></li>
<li> <i>R statistics programming language</i>&nbsp; &nbsp; &nbsp;<font color="red">(new)</font></li>
<li> <i>RPM Spec files</i></li>
<li> <i>Ruby</i></li>
<li> <i>Scala</i></li>
<li> <i>Scheme</i></li>
<li> <i>Shell</i></li>
<li> <i>S-Lang</i></li>
<li> <i>Sql</i></li>
<li> <i>T/Foswiki TML markup</i></li>
<li> <i>Tcl</i></li>
<li> <i>Texinfo</i></li>
<li> <i>UPC (unified parallel C)</i></li>
<li> <i>Vala</i></li>
<li> <i>VBscript</i></li>
<li> <i>XML</i></li>
<li> <i>XOrg conf files</i></li>
</ul>
<p><font color="#990000">NOTICE: now the name of the
program is </font><b><i><font color="#663366">source-highlight</font></i></b><font color="#990000">:
there are no two separate programs, namely <i>java2html</i>
and <i>cpp2html</i>,
anymore.&nbsp; However there are two shell scripts with the same
name
in order to facilitate the migration (however their use is not
advised).</font> </p>
<p>GNU Source-highlight is <b><font color="#009900">free
software</font></b>.
Please see the file <a href="COPYING">COPYING</a>
for details. For
documentation, please read this file. </p>
<p>GNU Source-highlight is a <a href="http://www.gnu.org">GNU</a>
program and its main home page is at GNU site: <br>
<a href="http://www.gnu.org/software/src-highlite">http://www.gnu.org/software/src-highlite</a>
</p>
<ol id="mozToc">
<!--mozToc h1 1 h2 2 h3 3 h4 4 h5 5 h6 6--><li><a href="#mozTocId593827"> GNU Source-highlight</a>
<ol>
<li><a href="#mozTocId705198">On-line Manual</a></li>
<li><a href="#mozTocId127780"> Download</a>
<ol>
<li><a href="#mozTocId637057"> Anonymous
Git Checkout</a></li>
<li><a href="#Installation">Installation</a></li>
</ol>
</li>
<li><a href="#mozTocId579563"> Changes in this
release</a></li>
<li><a href="#mozTocId839282">What you need to
build source-highlight</a></li>
<li><a href="#mozTocId120994">Usage and
examples</a></li>
<li><a href="#mozTocId323328">Style files</a></li>
<li><a href="#mozTocId222354">Related Software
and Links</a></li>
<li><a href="#mozTocId477197">Credits</a></li>
<li><a href="#mozTocId209397"> Feedback</a></li>
<li><a href="#mozTocId319277"> TODO</a></li>
<li><a href="#mozTocId238205"> Mailing Lists</a></li>
</ol>
</li>
</ol>
<br>
<h2><a class="mozTocH2" name="mozTocId705198"></a>On-line
Manual</h2>
This is the <a href="source-highlight.html">complete
manual</a> shipped with source-highlight.
It details all the file formats used by source-highlight and
also contains documentation on how to create your own language
definitions.
<p>
If you want to use source-highlight library inside your C++
programs, you may want to read the <a href="source-highlight-lib.html">manual of the library</a> and the <a href="api/index.html">API documentation</a>.
</p><h2><a class="mozTocH2" name="mozTocId127780"></a>
Download</h2>
You can download it from GNU's ftp site: <br>
<a href="ftp://ftp.gnu.org/gnu/src-highlite/">ftp://ftp.gnu.org/gnu/src-highlite/</a>
or from one of its mirrors (see <a href="http://www.gnu.org/prep/ftp.html">http://www.gnu.org/prep/ftp.html</a>).
<p>I do not distribute Windows binaries anymore; since, they can be built
by using Cygnus C/C++ compiler, available at
<a href="http://www.cygwin.com">http://www.cygwin.com</a>. However, if you don't feel like
downloading such compiler or you experience problems with the Boost
Regex library (please also keep in mind that if you don't have these libraries
installed, and your C/C++ compiler distribution does not provide a
prebuilt package, it might take some time, even hours, to build the
Boost libraries from sources), you can request such binaries directly to
me, by e-mail (find my e-mail at my home page) and I'll be happy to send
them to you. An MS-Windows port of Source-highlight is available from
<a href="http://gnuwin32.sourceforge.net">http://gnuwin32.sourceforge.net</a>; however, I don't maintain those
binaries personally, and they might be out of date.
<br>
</p>

<p>Language definition files and output language definition files,
which are part of source-highlight distribution, can also be downloaded
independently from, respectively:

</p><ul>
<li><a href="http://www.gnu.org/software/src-highlite/lang_files/">http://www.gnu.org/software/src-highlite/lang_files/</a></li>
<li><a href="http://www.gnu.org/software/src-highlite/outlang_files/">http://www.gnu.org/software/src-highlite/outlang_files/</a></li>
</ul>

<p></p>

<p>
However, note that the files you find at the above urls are tested with the
latest version of source-highlight (thus, e.g., they may require features
that are not present in an earlier version of source-highlight);
</p>

<h3><a class="mozTocH3" name="mozTocId637057"></a>
Anonymous Git Checkout</h3>

This project's git repository can be checked out through the following
clone instruction:

<pre>git clone git://git.savannah.gnu.org/src-highlite.git</pre>

   <p>Further instructions can be found at the address:

   <p><a href="http://savannah.gnu.org/projects/src-highlite">http://savannah.gnu.org/projects/src-highlite</a>.

   <p>And the git repository can also browsed on-line at
<a href="http://git.savannah.gnu.org/cgit/src-highlite.git">http://git.savannah.gnu.org/cgit/src-highlite.git</a>.

<p><i>NOTE: Since version 3.1.2 of Source-highlight the
CVS repository was dismissed in favor of Git
(<a href="http://git-scm.com/">http://git-scm.com/</a>)</i>.

<p>
Please notice that this way you will get the latest
development sources
of Source-highlight, which may also be unstable. This solution is the
best if you intend to correct/extend this program: you should send me
patches against the latest git repository sources.</p>
<p>If, on the contrary, you want to get the sources of a given
release,
through git, say, e.g., version X.Y.Z, you must specify the git tag
<tt>rel_X_Y_Z</tt>.</p>

<p>When you compile the sources that you get from the git
repository,
before running the <tt>configure</tt> and <tt>make</tt>
commands, you must run the command:</p>
<pre>autoreconf -i<br></pre>
<p>This will run the autotools commands in the correct order, and
also copy
possibly missing files. You should have installed recent versions of
<tt>automake</tt>, <tt>autoconf</tt> and <tt>libtool</tt>
in order for this to succeed.</p>

<p>
We strongly suggest to use shadow builds, thus, create a build
directory, say <tt>build</tt> and run configuration and make in that
directory.  To summarize, the steps to get the sources from git and make the first build
are:

<pre>     git clone git://git.savannah.gnu.org/src-highlite.git
     cd src-highlite
     autoreconf -i
     mkdir build
     cd build
     ../configure
     make
</pre>
</p>


<h3><a class="mozTocH3" name="Installation"></a>
Installation</h3>

Please, take a look at the 
<a href="source-highlight.html#Installation">Installation section of the manual</a>.
Since version 3.1.2, also a 
<a href="source-highlight.html#Building-with-qmake">qmake based building mechanism is available</a>,
though discouraged.

<h2><a class="mozTocH2" name="mozTocId579563"></a>
Changes in this release</h2>
<ul>
<li> see <a href="NEWS">NEWS</a> file for a
summary of new features
in
this release and</li>
<li> see ChangeLog for the complete list of changes sources</li>
</ul>
You can also find details about new features of source-highlight on my
blog, in this area: <a href="http://tronprog.blogspot.com/search/label/source-highlight">http://tronprog.blogspot.com/search/label/source-highlight</a>.
<h2><a class="mozTocH2" name="mozTocId839282"></a>What
you need to build source-highlight</h2>
Since version 2.0 Source-highlight relies on regular expressions as
provided by boost (<a href="http://www.boost.org">http://www.boost.org</a>),
so you need to install at least the regex library from boost.&nbsp;
Most GNU/Linux distributions provide this library already in a compiled
form.<br>
<h2><a class="mozTocH2" name="mozTocId120994"></a><a href="examples.html">Usage
and examples</a></h2>
<h2><a class="mozTocH2" name="mozTocId222354"></a>Related
Software and Links</h2>
<p>Here we list some software related to source-highlight in the
sense that
it uses it as a backend (i.e., provides an interface to
source-highlight) or it uses some of its features (e.g., definition
files):</p><ul><li>Source-highlight-qt is a library for performing syntax highlighting in
Qt documents by relying on GNU Source-Highlight library.  This library
provides an implementation of the qt abstract class QSyntaxHighlighter
class, and it deals both with Qt3 and Qt4.

     <p><a href="http://srchiliteqt.sourceforge.net/">http://srchiliteqt.sourceforge.net</a>.

     </p></li><li>QSource-Highlight is a Qt4 front-end for GNU Source-Highlight (it relies
on the library Source-Highlight-Qt).  You can highlight your code on the
fly, and have the highlighted output in all the formats supported by
source-highlight (e.g., HTML, LaTeX, Texinfo, etc.). You can then copy
the formatted output and paste it (e.g., in your blog), or save it to a
file.  A preview of the highlighted output is available for some output
formats (e.g., HTML, XHTML, etc.).

     <p><a href="http://qsrchilite.sourceforge.net/">http://qsrchilite.sourceforge.net</a>.</p></li></ul>
<ul>
<li>SourceHighlightIDE is a small IDE (for KDE) I wrote for
developing
and debugging new language definitions for source-highlight:
<p><a href="http://srchighliteide.sourceforge.net">http://srchighliteide.sourceforge.net</a>.
</p>
</li>
<li>Martin Gebert implemented a KDE interface to
source-highlight programs
(and he did a wonderful job!), and it is called <em>Ksrc2highlight</em>;
if you want to test it:
<p><a href="http://www.mgebert.de/Ksrc2highlight">http://www.mgebert.de/Ksrc2highlight</a>.
</p>
</li>
<li>There's also a Java version of java2html, you can find it
at
<p><a href="http://www.generationjava.com/projects/Java2Html.shtml">http://www.generationjava.com/projects/Java2Html.shtml</a>.
</p>
</li>
<li>This web site provides a web interface to source-highlight
so that you can highlight your code on-line:
<p><a href="http://www.alaide.com/outils_colorsyntaxe.php">http://www.alaide.com/outils_colorsyntaxe.php</a>
</p>
</li>
<li>SHJS is a JavaScript program that highlights source code
passages in
HTML documents. Documents using SHJS are highlighted on the client side
by the web browser. SHJS uses language definitions from
Source-highlight.
<p><a href="http://shjs.sourceforge.net/">http://shjs.sourceforge.net</a>
</p>
</li>
<li>Code2blog is a pyGTK front-end to source-highlight for easy
conversion
from source code to HTML.
<p><a href="http://code.google.com/p/code2blog">http://code.google.com/p/code2blog</a>
</p>
</li>
<li>Andy Buckley wrote a wrapper around source-highlight, which
can be used
as an Apache filter to highlight source code in Web pages on the fly.
<p><a href="http://www.insectnation.org/projects/filter-src-highlight">http://www.insectnation.org/projects/filter-src-highlight</a>
</p>
</li>
<li>Roger Nilsson wrote a frontend for source-highlight that is
used in a
popular webdesign app for OSX called RapidWeaver. The frontend is
called
High-Light and allows users to easily add syntax-colored code inside
RapidWeaver.
<p><a href="http://nilrogsplace.se/webdesign/rapidweaver/plugins/high-light/index_en.html">http://nilrogsplace.se/webdesign/rapidweaver/plugins/high-light/index_en.html</a>
</p>
</li>
<li>
Mauricio Zepeda published in his blog an article with a script
to automatically highlight a file and show it in Firefox:

     <p><a href="http://chillorb.com/?p=122">http://chillorb.com/?p=122</a>
</p>
</li>
<li>
Jason Blevins made a plugin for Ikiwiki that enables syntax highlighting
of source code fragments and whole files via source-highlight.

     <p><a href="http://jblevins.org/projects/ikiwiki/code">http://jblevins.org/projects/ikiwiki/code</a>
</p>
</li>
<li>
Pascal Bleser created a PHP extension that uses the GNU source-highlight
library directly from PHP, instead of relying on spawning a process or
using the source-highlight CGI.

     <p><a href="http://code.google.com/p/php-source-highlight/">http://code.google.com/p/php-source-highlight/</a>
</p>
</li>
<li>
Roberto Alsina made a partial python binding using SIP so
that you can use Source-Highlight-Qt in PyQt programs.

     <p><a href="http://marave.googlecode.com/svn/trunk/marave/highlight/">http://marave.googlecode.com/svn/trunk/marave/highlight/</a>
</p>
</li>

<li>A perl binding for source-highlight is available at CPAN:

     <p><a href="http://search.cpan.org/perldoc?Syntax::SourceHighlight">http://search.cpan.org/perldoc?Syntax::SourceHighlight</a>
</p>
</li>

     <li><a name="index-Pastebin-36"></a>Danijel Tasov wrote a pastebin service based on
perl source-highlight binding:

     <p><a href="http://pb.rbfh.de">http://pb.rbfh.de</a>
</p>
</li>

</ul>
<h2><a class="mozTocH2" name="mozTocId477197"></a>Credits</h2>
See CREDITS for detailed contributions and THANKS&nbsp; for a
complete
list of people that
helped me with Source-highlight :-)
<h2><a class="mozTocH2" name="mozTocId209397"></a>
Feedback</h2>
Please tell me if you like this software :-)
<p>Actually I want to extend it, so if you have some ideas... <br>
The most import one will be to make source-highlight more powerful
:-) </p>
<p>Please send all bug reports by electronic mail to: <br>
<font color="#3333ff">bug-source-highlight at gnu dot org</font>
</p>
<p>
Or, even better, use
</p>

<p><a href="https://savannah.gnu.org/bugs/?group=src-highlite">https://savannah.gnu.org/bugs/?group=src-highlite</a>
</p>
<h2><a class="mozTocH2" name="mozTocId319277"></a>
TODO</h2>
Here's the <a href="TODO.txt">list of TODO stuff</a>,
if you'd like to
contribute :-)
<h2><a class="mozTocH2" name="mozTocId238205"></a>
Mailing Lists</h2>
The following mailing lists are available:
<ul>
<li> <font color="#3333ff">help-source-highlight
at gnu dot org</font>,
for generic discussions about the program and for asking for help about
it (open mailing list), <a href="http://mail.gnu.org/mailman/listinfo/help-source-highlight">http://mail.gnu.org/mailman/listinfo/help-source-highlight</a></li>
<li> <font color="#3333ff">info-source-highlight
at gnu dot org</font>,
for receiving information about new releases and features (read-only
mailing list), <a href="http://mail.gnu.org/mailman/listinfo/info-source-highlight">http://mail.gnu.org/mailman/listinfo/info-source-highlight</a></li>
</ul>
if you want to subscribe to a mailing list just go to the URL and
follow the instructions, or send me an e-mail and I'll subscribe
you.
<p>My home page is <a href="http://www.lorenzobettini.it">http://www.lorenzobettini.it</a>
</p>
<p>source-highlight is free software. See the file COPYING for
copying
conditions. Anyway I won't get offended if you send me a postcard :-) </p>
<p> </p>
<hr>
<p>Return to <a href="/home.html">GNU's home page</a>.
</p>
<p>Please send FSF &amp; GNU inquiries &amp; questions to
<i><a href="mailto:gnu@gnu.org">gnu@gnu.org</a></i>.
There are also <a href="http://www.gnu.org/home.html#ContactInfo">other
ways to contact</a>
the FSF. </p>
<p>Please send comments on these web pages to <i><a href="mailto:webmasters@gnu.org">webmasters@gnu.org</a></i>,
send
other questions to <i><a href="mailto:gnu@gnu.org">gnu@gnu.org</a></i>.</p>
<p>Copyright (C) 2001 Free Software Foundation, Inc., 59 Temple
Place -
Suite 330, Boston, MA 02111, USA </p>
<p>Verbatim copying and distribution of this entire article is
permitted in any medium, provided this notice is preserved. </p>
<p>Updated:<!-- hhmts start -->9 Jan 2001 mhw<!-- hhmts end -->
<br>
</p>
<hr> <br>
<br>
<br>
<br>
<br>
<br>
</body></html>