cpp2html

2009. 1. 29. 09:05 from 셈말짓기/터놓은글


아래와 같이 명령을 하면 도움말을 볼 수가 있습니다.

E:\>cpp2html.exe -h

  ***I tweeked the original source code to get it to compile  on
 Windows 2000.  The original source code requires Cygnus.dll. This
 version does not.  The original Credits and Authors are down below.
 You can get the source code from http://www.gnu.org

                                         - mdevi@liu.edu
       *************************************
 Usage
cpp2html only does a lexical analisys of the source code, so the
C++ program is assumed to be correct !
here's how to run it:

cpp2html --input <file (a C++ prog)> --output <file (an html)>
If you do not specify the name of the output file, the name will
be the one of the source file with a .html appended.
if you want a real html document, specify --doc option at the
end.Otherwise you just get some text to copy and paste in you
own html pages. If you choose -doc option the page will have a
white background and your source file name as title. --tab n option
apply a substitution of tab characters with n spaces. You also may
want to specify the title of the page with --title "my title"
option (this implies -doc). Now you can also generate an html with
CSS format, by using --css "url of .css" (try some .css files
included in the package). The order of the options is not relevant.
Here are some links to some of the sources of cpp2html colored with
cpp2html itself:

main.cc.html
generators.cc.html
tags.cc.html
messages.cc.html
These files have been generated with the following commands:
cpp2html --doc main.cc
cpp2html --doc generators.cc
cpp2html --doc tags.cc
cpp2html --doc messages.cc
Obviosly it works with C files as well:
cmdline.c.html
Created with the command:
cpp2html -i cmdline.c -o cmdline.c.html --css="cpp2html.css"
And obviously it works with header files as well (which we colored in
black and white :-)
main.h.html
decorators.h.html
generators.h.html
list.h.html
tags.h.html
cmdline.h.html
created with the command:
cpp2html *.h --css="mono.css"
And here's the output of `cpp2html -help`

Usage: cpp2html [OPTION]... [INPUT-FILE]...
       cpp2html < INPUT-FILE > OUTPUT-FILE [OPTION]...

given a source C/C++ file, produces an html source with syntax highlighting.

  -v, --verbose           verbose mode on
  -d, --doc               creates html with title, header...
  -c, --css=URL           use a css for formatting (implies --doc)
  -T, --title=TITLE       give title to the html (implies --doc)
  -i, --input=FILE        input file (default standard input)
  -o, --output=FILE       output file (default standard output)
  -t, --tab=TABLEN        specify tab length (default 8)
  -V, --version           print version
As it handles standard output and input you may also run it like
cat MyFile.cpp | cpp2html | lpr
You may want to specify your options for syntax highlighting in the file
tags.j2h. If this file is not present in the current directory, some
default colors will be used. Here's the tags.j2h file that comes with
this distribution:

keyword blue b ;
type green ;
string red ;
comment brown i ;
number purple ;
as you might see the syntax of this file is quite straightforward:
b = bold
i = italics
u = underline

You may also specify more than on of these options separated by commas
e.g.
keyword blue u, b ;
you may see all possible colors in the file colors.html

if something goes wrong with your options try to run cpp2html with --verbose opt
ion enabled.

Credits
These people helped me with java2html, and I used such features in cpp2html
as well, so:
Marcus G. Daniels <marcusd@gnu.org> who gave me some good advices about GNU stan
dards,
Osvaldo Pinali Doederlein <osvaldo@visionnaire.com.br> for tab option idea,
Richard Freedman <rich_freedman@chiinc.com> for feed back and bugs signalations

John Constantine <John.Constantine@mail.cc.trincoll.edu> for some great suggesti
ons I'll surely apply.
Raymond Lambe <rlambe@morgan.ucs.mun.ca>, for quotation bug signalation
Robert J. Clark <clark@klgroup.com> for adding -input, -output, -title options
Hans-Peter Bischof <hpb@cs.rit.edu> for suggestions (to apply).
Luc Maisonobe <Luc.Maisonobe@cnes.fr> for the patch for const char * in order to
 make it work under gcc 2.95
Jari Korva <jari.korva@iki.fi> for the bug of " inside a string and & treatme nt
, and especially for adding CSS options and handling
Kaloian Doganov <kaloian@stones.com> for .css suggestion and for providing some
nice .css files
Ziv Caspi <zivc@peach-networks.com> found the bug of \ in chars
Chris Mason <cjmaso@essex.ac.uk> found the darkgreen bug, and that --tab was not
 documented


                                  ****  Have Fun - mdevi@liu.edu

E:\>

Posted by 셈말짓기 :