AminetAminet
Search:
84782 packages online
About
Recent
Browse
Search
Upload
Setup
Services

dev/misc/highlight-1.2.lha

Mirror:Random
Showing: ppc-morphos icongeneric icon
No screenshot available
Short:Converts source code to HTML, XHTML, RTF or La(Tex)
Author:"André Simon" saalen at gmx.de
Uploader:Diego Casorran <dcr8520 amiga org>
Type:dev/misc
Version:1.2
Architecture:m68k-amigaos
Date:2003-08-24
Download:dev/misc/highlight-1.2.lha - View contents
Readme:dev/misc/highlight-1.2.readme
Downloads:746

highlight converts source code to HTML, XHTML, RTF or La(Tex) with syntax
highlighting (HTML formatted by Cascading Style Sheets).

--------------
Deutsch: siehe unten...
---------------

highlight converts sourcecode to (x)html, RTF or TEX files with syntax highlighting.
(X)HTML is formatted by Cascading Style Sheets. So you can store the style information
in one file and change the style anytime without problems, affecting all html files
which reference the style file.
The former formatting with <font>-tags is deprecated by the W3C and should not be
used any longer. CSS-formatted files are also smaller sized than the <font>-
formatted ones.

FEATURES:
- highlighting of keywords, strings, numbers, escape characters, directive lines
  and comments
- output of linenumbers
- output in HTML, XHTML 1.0, RTF, TeX or LaTeX format
- choice to include the CSS-definitions into the output file or to save them in
  a seperate CSS-file ((X)HTML only)
- 2 built-in highlight-styles (emacs and kwrite)


HOW IT WORKS:

You can get the help by typing highlight -h:

  -b, --batch=<wildcard>         convert all matching files in current directory
                                 (Example: highlight -b cpp)
  -d, --hilfe                    gibt eine deutsche Hilfe aus
  -f, --fragment                 omit file header and footer
  -h, --help                     print this help
  -i, --input=<file>             name of input file
  -l, --linenumbers              print line numbers in output file
  -S, --syntax=<type>          specify type of source code
  -o, --output=<file>            name of output file
  -s, --style=<style>            specify CSS-style which should be used
                                 (emacs | kwrite)
  -t, --deletetabs=<num>         replace tabs by num spaces
  -v, --verbose                  print debug info to stderr
  -L, --latex                    generate LaTeX file
  -R, --rtf                      generate RTF file
  -T, --tex                      generate TeX file
  -X, --xhtml                    generate XHTML 1.0 file

      --version                  print version and copyright information

  (X)HTML options:
  -c, --cssfilename=<file>       name of CSS-definition file
  -I, --includecss               include CSS-definition in HTML-file


highlight uses stdin/stdout if no in-/outfile-parameters are given.
The following commands write the content of hello.c to hello.html:

highlight -o hello.html -i hello.c
highlight -o hello.html hello.c
highlight -o hello.html -L c < hello.c
highlight -L c < hello.c > hello.html

If no inputfile is given, you have to pass highlight the usual file-suffix of
the sourcecode files via -L. If you want to convert a c-file, highlight looks
after the c.lang - language definition file, for example. If there exist
multiple suffixes (like c, C, cc, cpp with c/c++ - files), highlight tries
to fetch the matching language definition file.

In batch mode, highlight will save the generated files with the original filename,
appending .html or .xhtml, if -x is set.

Example:

highlight -xb cpp
converts all *.cpp files in the current directory to xhtml files.

Concerning (X)HTML output:
You may include the CSS-definitions in the html output file, or save them in
an external css file. If you do not set any option regarding this, highlight
saves the css crap in "highlight.css" in the same directory where you invoked
it, and inserts a link to "highlight.css" in the outfile. You can set the name
of the css file by -c. highlight will try to save the css definitions in the
given path.
Beware: Existing css files will not be overwritten.

LANGUAGE DEFINITION FILES:

It is easy to make own definition files. Just put all keywords and symbols (like
comment etc) of the programming language in the right category. Save the new file
in /usr/share/highlight or /usr/local/bin/highlight with the following name:
<usual suffix of sourcecode files>.lang
Examples: PHP -> php.lang, Java -> java.lang

FORMAT OF FILE:

Comments start with # as the first character in a line.

Scr2css will read the following parameters:

# List of keywords:
KEYWORDS=<List>

# List of types and type-modifiers
TYPESMODS=<List>

# List of String delimiters
STRINGDELIMITERS=<List>

# List of strings which start one line comments
SINGLELINECOMMENT=<List>

# comment begin and end (delimiters of multi-line comments)
MULTILINECOMMENT=<comment_begin comment_end>

# set to true/yes if programming language is case sensitive
ISCASESENSITIVE=<true|yes / false>

# beginning string of preprocessor directive lines
# ending symbols are not recogniced yet (like Pascal {$..} )
DIRECTIVE=<1 string>

# List of escape characters in Strings (normally "\")
ESCCHAR=<List>

IMPORTANT: All keywords etc must be in ONE line! Strings after a newline will
be ignored! (maybe fixed in release 0.2)

You may copy keywords from  syntax files of other programmes like VIM.


Example:

---

#Content of pas.lang (Pascal/Objekt Pascal)

KEYWORDS=true false if else then nil maxint [...] implementation uses private public

TYPESMODS=array boolean char integer file pointer real set string text record

STRINGDELIMITERS=" '

SINGLELINECOMMENT=//

MULTILINECOMMENT={ }

ISCASESENSITIVE=false

---

It would be cool to receive some new definition files (saalen@gmx.de) ;))

------------------------
André Simon
saalen@gmx.de
http://www.saalen.de.vu/



##############################################################################




DEUTSCH:

highlight konvertiert Sourcecode in XHTML, HTML, RTF oder (LA)TEX-Dateien mit
Syntaxhervorhebung. HTML wird mit Cascading Style Sheets formatiert.
So kann man die Gestaltung der HTML-Dateien in einer zentralen CSS-Datei speichern
und jederzeit ohne Probleme aendern. Die bisher uebliche Art der Schriftformatierung
mit <font>-Tags wurde vom W3C-Konsortium auf die Abschussliste gesetzt und sollte
daher nicht mehr eingesetzt werden. Ausserdem sind die CSS-formatierten HTML-
Dateien kleiner als diejenigen, die mit <font> formatiert werden.

FEATURES:

- Hervorhebung von Schlüsselwörtern, Strings, Zahlen, Escape Character, Direktiven
  und Kommentaren
- Ausgabe im HTML-, XHTML-, RTF-, TeX, oder LaTeX- Format
- Ausgabe von Zeilennummern
- Speichern der CSS-Definition wahlweise in separater Datei oder innerhalb der
  Ausgabedatei
- 2 eingebaute CSS-Stile (emacs and kwrite)


FUNKTIONSWEISE:

Die Parameter von highlight koennen mit "highlight -h" abgerufen werden:

  -b, --batch=<wildcard>         konvertiert alle Dateien mit der Endung <wildcard>
                                 im aktuellen Verzeichnis (Beispiel: highlight -b cpp)
  -d, --hilfe                    gibt diese Hilfe aus
  -f, --fragment                 Header/Footer wird weggelassen
  -h, --help                     prints english help
  -i, --input=<file>             Name der Eingabedatei
  -l, --linenumbers              gibt Zeilennummern in Ausgabe aus
  -S, --syntax=<type>            gibt den Typ des Quelltextes an
  -o, --output=<file>            Name der Ausgabedatei
  -s, --style=<style>            gibt den zu verwendenden Farbstil an
                                 (emacs | kwrite)
  -t, --deletetabs=<num>         ersetzt Tabs durch num Leerzeichen
  -v, --verbose                  gibt Debug-Info nach stderr aus
  -L, --latex                    gibt eine LaTeX - Datei aus
  -R, --rtf                      gibt eine RTF- Datei aus
  -T, --tex                      gibt eine TeX - Datei aus
  -X, --xhtml                    gibt eine XHTML 1.0 - Datei aus

      --version                  gibt Versionshinweis aus

  (X)HTML -Optionen:
  -c, --cssfilename=<file>       Name der CSS-Definitionsdatei
  -I, --includecss               fuegt CSS-Definition in HTML-Datei ein


Nuetzlich ist die automatische Aus- und Eingabe nach stdout bzw. stdin, wenn
die entsprechenden Parameter (Name der Ein- bzw Ausgabedatei) beim Aufruf
weggelassen werden.

Folgende Aufrufe schreiben den Inhalt von hallo.c nach hallo.html:

highlight -o hallo.html -i hallo.c
highlight -o hallo.html hallo.c
highlight -o hallo.html -L c < hallo.c
highlight -L c < hallo.c > hallo.html

Wenn kein Name der Eingabedatei angegeben wird, muss mit -L die uebliche
Endung dieser Datei angegeben werden, weil highlight zB bei einer .c-Datei
nach der Sprachdefinitionsdatei c.lang sucht. highlight ist allerdings in der
Lage, bei mehreren gebraeuchlichen Endungen die passende lang-Datei zu finden
(zB C, cpp, cc, h bei C/C++ -Sourcecode).

Im Batchmodus speichert highlight die generierten Dateien unter dem Originalnamen mit
der Endung .html (.xhtml, wenn -x gesetzt wurde) ab.

Beispiel:

highlight -xb cpp
Konvertiert alle *.cpp Dateien im aktuellen Verzeichnis in XHTML-Dateien.

Zur (X)HTML-Ausgabe:
Man kann angeben, ob die CSS-Definitionen innerhalb der HTML-Datei gespeichert
werden sollen oder in einer zentralen css-Datei ausgelagert werden.
Wird kein diesbezüglicher Parameter angegeben, werden die CSS-Definitionen in der
Datei highlight.css im aktuellen Verzeichnis  gespeichert und innerhalb der neuen
HTML-Datei wird ein Verweis auf "highlight.css" angelegt.
Mit der -c Option kann dieser Verweis jedoch angepasst werden (zB dann noetig,
wenn sich die HTML-Dateien in einem anderen Verzeichnis als die CSS-Datei befinden.)
highlight versucht dann, unter dem angegebenen Pfad die CSS-Datei anzulegen.
Achtung: highlight ueberschreibt dabei keine vorhandenen CSS-Dateien!

SPRACHDEFINITIONSDATEIEN:

Es ist ziemlich simpel, eigene Sprachdefinitionen zu erstellen. Man muss bloss
alle Schluesselwoerter und Symbole (wie zB Anfang von Kommentaren) der jeweiligen
Programmiersprache bestimmten Parametern zuweisen. Die Datei muss dann im
Verzeichnis von highlight (/usr/share/highlight oder /usr/local/bin/highlight) unter
folgendem Namen gespeichert werden:
<Uebliche Endung der Sourcecodedateien>.lang
Bei PHP also php.lang, bei C c.lang etc.

Format der Datei:

Kommentare beginnen mit #.
# muss das erste Zeichen in der Zeile sein!

highlight liest folgende Parameter ein:

# Liste der Schluesselwoerter
KEYWORDS=<Liste Bez.>

# Liste der Typen und Typ-Modifizierer
TYPESMODS=<Liste Bez.>

# Liste der Stringbegrenzer
STRINGDELIMITERS=<Liste Bez.>

# Liste der Bezeichner, die einen einzeiligen Kommentar einleiten
SINGLELINECOMMENT=<Liste Bez.>

# Kommentarbeginn  und -ende beim mehrzeilgen Kommentar
MULTILINECOMMENT=<Bez. Kommentarbeginn UND Bez. Kommentarende>

# Falls Programmiersprache case-sensitive ist, auf true/yes setzen
ISCASESENSITIVE=<true|yes / false>

# Einleitender Bezeichner von Compilerdirektiven
# zur Zeit werden keine abschliessenden Symbole erkannt, wie sie zB in Pascal noetig waeren ( {$..} )
DIRECTIVE=< 1 Bez.>

# Liste der Escapecharacter innerhalb von Strings (normalerweise \)
ESCCHAR=<Liste Bez.>

WICHTIG: Alle Bezeichner muessen in EINER Zeile stehen! Bei Zeilenumbruch wird
die Eingabe abgebrochen (das wird evtl. in highlight 0.2 verbessert).

Beim Erstellen neuer Dateien kann man die Schluesselwoerter aus Dateien anderer
Programme mit Syntaxhighlighting (z.B VIM) kopieren.


Beispiel:

---

#Inhalt von pas.lang (Pascal/Objekt Pascal)


KEYWORDS=true false if else then nil maxint [...] implementation uses private public

TYPESMODS=array boolean char integer file pointer real set string text record

STRINGDELIMITERS=" '

SINGLELINECOMMENT=//

MULTILINECOMMENT={ }

ISCASESENSITIVE=false

---

Waere cool, ein paar neue Definitionen zu bekommen (saalen@gmx.de) ;))

------------------------

André Simon
saalen@gmx.de
http://www.saalen.de.vu/




ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`
`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø

Latest update of this package can be found at  http://amiga.sourceforge.net/

ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`ø°`
`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø`°ø




·············································A·r·c·h·i·v·e··C·o·n·t·e·n·t·s··
LhA Freeware Version 2.2
Copyright © 1991-94 by Stefan Boberg.
Copyright © 1998-2000 by Jim Cooper and David Tritscher.

Listing of archive 'highlight-1.2.lha':
Original  Packed Ratio    Date     Time    Name
-------- ------- ----- --------- --------  -------------
      28      28  0.0% 09-Jul-02 21:00:52 +AUTHORS
    1304     655 49.7% 05-Oct-02 11:15:44 +ChangeLog
   15131    5860 61.2% 09-Jul-02 21:00:52 +COPYING
  236028   91879 61.0% 07-Oct-02 20:09:54 +highlight
    2330    1162 50.1% 19-Aug-02 18:38:44 +highlight.1
    1624     906 44.2% 20-Aug-02 21:00:20 +c.lang
    4224    1951 53.8% 26-Aug-02 15:39:12 +cob.lang
    1442     803 44.3% 16-Aug-02 17:09:00 +cs.lang
    1746     922 47.1% 26-Aug-02 15:26:18 +fortran.lang
    1393     759 45.5% 29-Jul-02 13:21:12 +js.lang
    1342     751 44.0% 29-Jul-02 13:21:12 +pas.lang
   24889    8819 64.5% 29-Jul-02 13:21:12 +php.lang
    1452     802 44.7% 29-Jul-02 11:36:50 +sh.lang
    1941    1079 44.4% 29-Jul-02 13:21:12 +sql.lang
   11542    4377 62.0% 16-Aug-02 14:46:22 +README
      31      31  0.0% 24-Jul-02 20:44:24 +TODO
    1677     901 46.2% 19-Aug-02 15:22:56 +ada.lang
    3081    1557 49.4% 29-Jul-02 13:21:12 +asm.lang
    1390     774 44.3% 29-Jul-02 13:21:12 +java.lang
    1753     935 46.6% 22-Jul-02 21:58:38 +lua.lang
    1134     633 44.1% 29-Jul-02 12:32:08 +pl.lang
    1917    1039 45.8% 29-Jul-02 13:44:02 +py.lang
    1414     752 46.8% 26-Aug-02 15:58:48 +rb.lang
    2463    1321 46.3% 16-Aug-02 17:54:16 +tcl.lang
    1571     870 44.6% 29-Jul-02 12:31:42 +vb.lang
-------- ------- ----- --------- --------
  322847  129566 59.8% Operation successful.




_____________________________
.Readme created with:  MRea  \
==============================================================================
>»>»>»>»> Some additional info about this archive:

Source:   http://prdownloads.sf.net/amiga/highlight-1.2.lha?download
FileSize: 130818 Bytes

CRC: 5BB8D8BC
MD5: 6C58A3E87E516458B6C52A999D1D8B73
SHA: 3637F508AD9BB43D491819ABB89A03F9BBBC4876
==============================================================================


Contents of dev/misc/highlight-1.2.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO     CRC       STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[generic]                   28      28 100.0% -lh0- 7182 Jul  9  2002 highlight-1.2/AUTHORS
[generic]                  655    1304  50.2% -lh5- e057 Oct  5  2002 highlight-1.2/ChangeLog
[generic]                 5860   15131  38.7% -lh5- 5509 Jul  9  2002 highlight-1.2/COPYING
[generic]                91879  236028  38.9% -lh5- a977 Oct  7  2002 highlight-1.2/highlight
[generic]                 1162    2330  49.9% -lh5- d95e Aug 19  2002 highlight-1.2/highlight.1
[generic]                  906    1624  55.8% -lh5- 5953 Aug 20  2002 highlight-1.2/langs/c.lang
[generic]                 1951    4224  46.2% -lh5- 14b4 Aug 26  2002 highlight-1.2/langs/cob.lang
[generic]                  803    1442  55.7% -lh5- e717 Aug 16  2002 highlight-1.2/langs/cs.lang
[generic]                  922    1746  52.8% -lh5- 384b Aug 26  2002 highlight-1.2/langs/fortran.lang
[generic]                  759    1393  54.5% -lh5- 7cc5 Jul 29  2002 highlight-1.2/langs/js.lang
[generic]                  751    1342  56.0% -lh5- 9585 Jul 29  2002 highlight-1.2/langs/pas.lang
[generic]                 8819   24889  35.4% -lh5- 2965 Jul 29  2002 highlight-1.2/langs/php.lang
[generic]                  802    1452  55.2% -lh5- 8d9f Jul 29  2002 highlight-1.2/langs/sh.lang
[generic]                 1079    1941  55.6% -lh5- d879 Jul 29  2002 highlight-1.2/langs/sql.lang
[generic]                 4377   11542  37.9% -lh5- f0a8 Aug 16  2002 highlight-1.2/README
[generic]                   31      31 100.0% -lh0- 1ab0 Jul 24  2002 highlight-1.2/TODO
[generic]                  901    1677  53.7% -lh5- 086b Aug 19  2002 highlight-1.2/langs/ada.lang
[generic]                 1557    3081  50.5% -lh5- e27d Jul 29  2002 highlight-1.2/langs/asm.lang
[generic]                  774    1390  55.7% -lh5- 58fe Jul 29  2002 highlight-1.2/langs/java.lang
[generic]                  935    1753  53.3% -lh5- 2ea8 Jul 22  2002 highlight-1.2/langs/lua.lang
[generic]                  633    1134  55.8% -lh5- 5fed Jul 29  2002 highlight-1.2/langs/pl.lang
[generic]                 1039    1917  54.2% -lh5- 58c1 Jul 29  2002 highlight-1.2/langs/py.lang
[generic]                  752    1414  53.2% -lh5- 54b5 Aug 26  2002 highlight-1.2/langs/rb.lang
[generic]                 1321    2463  53.6% -lh5- a189 Aug 16  2002 highlight-1.2/langs/tcl.lang
[generic]                  870    1571  55.4% -lh5- 8012 Jul 29  2002 highlight-1.2/langs/vb.lang
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total        25 files  129566  322847  40.1%            Aug 24  2003
Page generated in 0.03 seconds
Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>