will generate in outputdirectory the documentation for your
project, where list-of-source-files is the list of all files that
are part of your project.
There are other options to lp4all, available through the
--help option:
-doutdir or --directoryoutdir: give the directory
where to output the resulting HTML. By default, current directory;
-tstr or --tagstr: use another comment wiki marker
in comments. By default, it is "w";
-pname or --projectname: set the name to use at the
root of the filepath for each page. By default it is "Project";
-cfile.css or --cssfile.css: use specified CSS
instead of the default one.
Comment marking
By default, Lp4all doesn't consider all comments to be part of the
documentation. One must use a specific tag to mark comments that
should be rendered by Lp4all. By default, this tag is the single
character w, but it can be replaced by any other character, string
using the option -t. It can also be set to nothing.
An example for the C language:
/*w
* This function computes the number of chocolate paste pots eaten
* by a pool of ^^n^^ open-source developers during ^^t^^ days.
*/
An example for the Python language:
#w This class implements a chocolate paste pots. It allows to keep
# track of the remaining quantity of chocolate paste, to keep
# statistics about chocolate paste consumption, and implements various
# methods to manipulate the chocolate paste pot.
.lp4all files
Files with suffix .lp4all are considered having comments written
with the Wiki syntax. They are processed as follow:
A file foo.lp4all generates a file foo.html in the same
directory;
If a file foo already exists, the content of file foo.lp4all
is added at the beginning of generated file foo.html (so before
the code of file foo). As an example, in Lp4all itself,
content of file lp4all.py.lp4all is
added at the beginning of HTML file
lp4all.py.html generated from source file lp4all.py.
Wiki markup
The Wiki syntax is fairly simple :
Title level 1: ====title 1====
Title level 2: ===title 2===
Title level 3: ==title 3==
Strong text: **strong**
Emphasize text: //emphasize//
Strike-through text: ~~strike-through~~
Verbatim text: ^ ^verbatim^ ^ (without spaces between ^)
Verbatim block: % %verbatim block% % (without spaces between %)
External link with text: [[http://www.gnu.org/licenses/gpl1.txt|A link]]
Cross-reference link with some text: [[#id1|link]]
Label: [@id1@]
The usage of all tags should be obvious, except probably cross-reference
links. One can put labels anywhere in the source code using the
[@labelidentifier@] syntax. Then, anywhere in your project, you can
link to this label using [[#labelidentifier|Link]].
Tips and tricks
With Mercurial, you can simply get the list of files of your
project using the hg locate command. Using Lp4all is then
really simple:
Usage
This page is part of lp4all documentation.
Documentation generation
Using Lp4all is fairly simple:
will generate in
outputdirectorythe documentation for your project, wherelist-of-source-filesis the list of all files that are part of your project.There are other options to
lp4all, available through the--helpoption:-doutdir or--directoryoutdir: give the directory where to output the resulting HTML. By default, current directory;-tstr or--tagstr: use another comment wiki marker in comments. By default, it is "w";-pname or--projectname: set the name to use at the root of the filepath for each page. By default it is "Project";-cfile.css or--cssfile.css: use specified CSS instead of the default one.Comment marking
By default, Lp4all doesn't consider all comments to be part of the documentation. One must use a specific tag to mark comments that should be rendered by Lp4all. By default, this tag is the single character
w, but it can be replaced by any other character, string using the option-t. It can also be set to nothing.An example for the C language:
An example for the Python language:
.lp4all files
Files with suffix
.lp4allare considered having comments written with the Wiki syntax. They are processed as follow:foo.lp4allgenerates a filefoo.htmlin the same directory;fooalready exists, the content of filefoo.lp4allis added at the beginning of generated filefoo.html(so before the code of filefoo). As an example, in Lp4all itself, content of filelp4all.py.lp4allis added at the beginning of HTML filelp4all.py.htmlgenerated from source filelp4all.py.Wiki markup
The Wiki syntax is fairly simple :
====title 1=======title 2=====title 3==**strong**//emphasize//~~strike-through~~^ ^verbatim^ ^(without spaces between ^)% %verbatim block% %(without spaces between %)[[http://www.gnu.org/licenses/gpl1.txt|A link]][[http://www.gnu.org/licenses/gpl2.txt]][[#id1|link]][@id1@]The usage of all tags should be obvious, except probably cross-reference links. One can put labels anywhere in the source code using the
[@labelidentifier@]syntax. Then, anywhere in your project, you can link to this label using[[#labelidentifier|Link]].Tips and tricks
With Mercurial, you can simply get the list of files of your project using the
hg locatecommand. Using Lp4all is then really simple: