autoopts_back

man2html - AutoOpts Simple Client

Main
AutoGen
Pages

Home
Announce
FAQ
docs
XML Defs
testimonials
downloads

Automated
Options

AutoOpts
Comparison
Man example
Redistribute
Licensing
local use
using getopt

GCC's
Fixincludes

fixincludes

Automated
FSM

description
example
usagefsm

Addons
addon

Autoconf
Config
Tests

create form
M4 Quoting

Automated
XDR

xdr project

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:

An AutoOpts example
This is a very simple example showing how to use AutoOpts for local-only builds.

The Perl man2html is broken
Unfortunately, it seems to have bugs and drops sections of output.

Output form
Most man2html programs presume they are producing the entire page. This one does not, so the output can be formatted to fit within a frame or HTML table entry (as in this page).

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 agman1.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 Converter

Here is the AutoGen-erated usage text:

/bin/bash: line 61: man2html: command not found

Man Page for man2html

Here is its own generated man page:

NAME

This man page was converted to HTML by man2html

top  Viewable With Any Browser  SourceForge Logo   Support This Project   Valid XHTML 1.0!


AutoGen, AutoOpts, columns, getdefs, AutoFSM, AutoXDR and these web pages copyright (c) 1999-2002 Bruce Korb, all rights reserved.
Last modified: Sun Nov 8 10:02:32 PST 2009