git clone http://www.coincoin169.org/git/vomitpage.git vomitpage
vomitpage - generate manpages and HTML pages
vomitpage
[ --man
| --html
| --latex
] [ FILE
]
Create manpages, HTML pages or LaTeX pages.
vomitpage
reads FILE
and writes the document on the standard
output. Several files can be specified. With no FILE
or when FILE
is -
, then read standard input.
--man
Generate roff code. Note that the page title (.TH
macro, see
groff_man
(7) for more details) is not generated by vomitpage
.
You shall put it manually.
--html
Generate HTML code. Note that the HTML elements HTML
, BODY
are not
generated by vomitpage
. You shall put them in the document manually.
--latex
Generate LaTeX code. Note that the LaTeX commands
\documentclass
, \begin{document}
and \end{document}
are not
generated by vomitpage
. You shall put them in the document manually.
If no --man
, --html
or --latex
is specified, then roff code is
generated by default.
vomitpage --man file1 file2
Read from file1
, then file2
and generates roff code.
vomitpage file1
Read from file1
and generates roff code.
vomitpage --html file1
Read from file1
and generates HTML code.
vomitpage file1 - file2
Read from file1
, then standard input, then file2
and generates
roff code.
The input format is very simple: `verbatim` is verbatim
,
*emphasized* is emphasized.
Characters can be escaped: \`
is `
, \*
is *
, \=
is =
,
\#
is #
, more generally \c
will give c
where c
is a single
byte character. Long lines can be cut with a trailing \
.
==section title==
===subsection title===
##
comments
comments
##
``
verbatim text
ideal for code listing
``
A itemized list is following:
> item 1
indented text for item 1.
ideal for options listing or examples.
> item 2
some text here
Next we have a standard list.
- this is thte first item
- item 2
- you can have nested items
- nested item 2
- item 3
This a normal paragraph with some text. Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua.
This is another normal paragraph. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.
Paragraphs are separated by one or more consecutive empty lines.
Note that the input is expected to be ASCII
(7). The behavior
of vomitpage
is undefined when input is not ASCII.
Lists can be nested. To determine whether an item is nested into
another vomitpage
counts the number of spaces contained within
the indentation. For example
- item1
- item2
- item3
item2
is nested within item1
because there is 2 spaces before
the -
of item2
. Indentations must be multiples of 2.
If there are bad indentations in the input, vomitpage
will do
its best to warn you. Warnings do not stop the execution of
vomitpage
. The maximum nested depth is 10. If vomitpage
finds deeper nested items, an error will be produce and the
execution will stop.
vomitpage
supports currently 3 output formats: HTML, manpages
and LaTeX. New output formats can be easily added.
The .TH
macros is not generated by vomitpage
. For example the
manpage you are reading has been generated with the following:
$ vomitpage --man --gpl "This file is part of vomitpage" \
> "Guillaume Quintin" > vomitpage.1
$ echo ".TH vomitpage 1" >> vomitpage.1
$ vomitpage --man vomitpage.man >> vomitpage.1
where vomitpage.man
contains the text.
The HTML tags HTML
, BODY
, HEAD
and TITLE
are not generated
by vomitpage
. For example an HTML page can be generated with the
following:
$ echo "<html><head>" > out.html
$ echo "<title>your title</title>" >> out.html
$ echo "</head><body>" >> out.html
$ vomitpage --html source.txt >> out.html
$ echo "</body></html>" >> out.html
where source.txt
contains the text. You can also add Cascading
Style Sheets to your HTML page.
Normal paragraph will be marked with <p>...</p>
.
==section==
will give <h2>section</h2>
.
===subsection===
will give <h3>subsection</h3>
.
*emphasized*
will give <em>emphasized</em>
.
`code`
will give <code>code</code>
.
An itemized list
> item1
text1.
> item2
text2.
will give
<dl>
<dt>item1</dt>
<dd><p>text1.</p>
</dd>
<dt>item2</dt>
<dd><p>text2.</p>
</dd>
</dl>
An unordered list
- item 1
- item 2
will give
<ul>
<li>item 1</li>
<li>item 2</li>
</ul>
A sample of code
``
int main(void) {
return 0;
}
``
will give
<pre><code>int main(void) {
return 0;
}</code></pre>
The LaTeX commands \documentclass{...}
, \begin{document}
and
\end{document}
are not generated by vomitpage
. You can generate
complete LaTeX documents with the following
$ echo "\\documentclass{article}" > out.tex
$ echo "\\begin{document}" >> out.tex
$ vomitpage --latex source.txt >> out.tex
$ echo "\\end{document}" >> out.tex
where source.txt
contains the text.
It is recommanded that you use the T1 fonc encoding.
\usepackage[T1]{fontenc}
A simple example:
==NAME==
example - is an example
==SYNOPSIS==
This is an example of cctxt.
Some `verbatim text` here and some *emphasized text* here.
==DESCRIPTION==
The description here.
> -1
Explanation of option 1 here.
- A nested list to better
- explain the option.
> -2
Explanation of option 2 here.
> -a
Explanation of option a here.
> -b
Explanation of option b here.
===subsection 1 here===
Text here
===subsection 2 here===
Text here
Written by Guillaume Quintin (coincoin169@gmail.com).
roff
(7), groff_man
(7), groff_char
(7), ASCII
(7), UTF-8
(7)