multivalent.std.adaptor
Class ManualPage
public
class
ManualPage
extends MediaAdaptorByte
Media adaptor for UNIX manual pages (directly from roff -man source).
Along with HTML and ASCII, example of a media adaptor directly building the tree rather than first translating to a big HTML String.
No need for nroff, rman, or caching formatted pages.
Parsing is much faster than TkMan, because TkMan can't parse in Tcl (waaay to slow) and rman costs and exec and generating a big string and processing a big string by Tk text widget.
In fact, this is so fast that there is no need for preformatted cat versions of pages,
or for progressive rendering as manual pages are usually local and even is bash (200K) short enough to be fast (4 seconds, with decompression while playing MP3 on 500MHz Pentium III).
To do
- tables, if / if-else / else, tabs, macros, named characters, better special characters taken from Unicode
- handle other macro sets: Solaris, SunOS, HPUX, maybe BSD, ...
- maybe some macros imply man page link
- extract and display information from .TH
- fill in glyphs table more (but glyph codes > 255 often not defined in font)
- collect statistics
- let external behavior determine man page refs?
Discarded ideas / Not going to happen
- keep track of sections+subsections and insert a table of contents at head => executive summary is better
- directly support Solaris 7+ by exec'ing sgml2roff => convert with catman -c
Later, perhaps
- automatically make anchors of section names, for reference by external links
- could support HP-UX by checking for ".../man/manX.Z/page.X" and adding GZIPInputStream on top of what cache returns
Version: $Revision: 1.15 $ $Date: 2003/06/02 05:40:19 $
See Also: ManualPageVolume
public Object parse(
INode root)
Parse *roff, translate to document tree.
Since not all man page references are recognizable as such, have docpopup choice to treat current word as man page ref.
public void setInputStream(InputStream is)