|
i |
Man2html is an AutoOpts "Hello, world!" example that does something. It is yet another program to convert man page display text into html code. See the usage text or its own man page for more details. It is being released in conjunction with AutoGen for several reasons:
The "local only build" usage is actually very simple. Here is the full Makefile for this project:
CVSSRC = Makefile man2html.c opts.def README
SRC = opts.c man2html.c
OBJ = $(SRC:.c=.o)
DOCS = man2html.1 man2html.html
CFLAGS = -g `autoopts-config cflags`
LDFLAGS = `autoopts-config libs`
default : man2html
all : man2html $(DOCS)
opts.h : opts.c
opts.c : opts.def
autogen opts.def
$(OBJ) : opts.h
man2html : man2html.o opts.o
$(CC) -o $@ man2html.o opts.o $(LDFLAGS)
clobber :
rm -rf $(OBJ) opts.? man2html *~ $(DOCS) man2html-*
man2html.1 : opts.def
autogen -T agman-cmd.tpl -b man2html opts.def
man2html.html : man2html.1 man2html
nroff -man man2html.1 | ./man2html -u > $@
dist :
ver=`sed -n 's/^version *=//p' opts.def` ; \
ver=`eval echo $$ver` ; \
rm -rf man2html-$$ver ; mkdir man2html-$$ver ; \
cp $(CVSSRC) man2html-$$ver/. ; \
tar cvf - man2html-$$ver | gzip --best > man2html-$$ver.tar.gz ; \
rm -rf man2html-$$ver
man2html Man Page ConverterHere is the AutoGen-erated usage text:
man2html - convert nroff output to html - Ver. 2.0
USAGE: man2html [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [ <input-file> ]
Flg Arg Option-Name Description
-u no blank-lines Remove multiple blank lines
-f KWd form HTML form type (default: html PAGE)
no bs-warning Warn on unprocessed backspaces
-p no pea omit attribution
-h Str header regex for identifying page headers
- disabled as '--no-header'
- enabled by default
Str section-flag section option flag for 'man(1)'
-v opt version Output version information and exit
-? no help Display usage information and exit
-! no more-help Extended usage information passed thru pager
Options are specified by doubled hyphens and their name or by a single
hyphen and the flag character.
The input may come from standard input, or be specified on the command
line. If it is specified on the command line but cannot be found
directly, then the ``man(1)'' command will be invoked using this name.
The valid "form" option keywords are:
page xhtml body pre
or an integer from 0 through 3
Makes the following conversions:
* backspace/overstrikes to bold.
* backspace/underbar (either order) to italic.
* bar/backspace/dash to `+' (also handle bold rendering)
* bar/backspace/equals to `*' (also handle bold rendering)
* plus/backspace/o to `o'
* maps HTML special characters: '<', '>' and '&' to
'<', '>' and '&', respectively.
If a man page name is specified and the name contains a suffix,
the suffix will be stripped from the name and passed to ``man(1)''
as a separate argument. An attempt is made when ``man2html'' is
built to determine if this argument should be introduced with a ``-s''
or ``-S'' option marker, or by itself as the initial argument.
All text preceeding the ``NAME'' section marker is stripped.
Please send bug reports to: <autogen-bugs@sf.net>
Man Page for man2htmlHere is its own generated man page: NAME |