[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SGML processing (fwd)
Maybe someone knows what this person is talking about, but for the most
part I'm dumb and ignorant with regards to SGML, LaTex, etc.
-Aaron
--
Aaron Turner, Core Developer http://vodka.linuxkb.org/~aturner/
Linux Knowledge Base Organization http://www.linuxkb.org/
Hanlon's Razor:
Never attribute to malice, that which is adequately explained by stupidity.
---------- Forwarded message ----------
Date: Sun, 4 Jul 1999 21:09:50 +0100 (GMT)
From: root <root@trix.dircon.co.uk>
To: aturner@linuxkb.org
Subject: SGML processing
Three thoughts for your text site:
(1) SPIN_py
I have a python API into SP (nsgmls), which is rather quick.
There are issues such as non-8859 text, (Python has only 8-bit),
so you'd eventually have to split up names (tags, attrs) from text.
You will probably want to completely rewrite the Python layer.
Currently I format "LDOC" (linuxdoc96.dtd) into HTML, with
added features for <URL_MAN>ls(1)</> and so-on. I also use
a strange tuple: (eleminfo, attslist, datalist) for the
OUTPUT html, and an automatic SGML indenter.
However, that is the point of SPIN_py, it's an interface
between the two, you rewrite the Python side to suit your own
requirements. Note that you do get special text handling,
such as intelligent word-edge detection, space-migration
and tag-specific knowledge (preformatted) abstracted out.
Plus SP/Jade is designed to handle all char-encoding/fonts
(if you can figure how to switch it over).
Your CGI requirements will completely reshape the code anyway.
And when you are finished, you can push the SGML back through
Jade to get TeX. You can get SPIN_py from my home page:
http://www.users.dircon.co.uk/~trix/
But get the older version labelled "active".
(2) SGML for MAN and for INFO pages
When converting things like INFO and MAN pages,
I think that you shoudl convert to an intermediary SGML.
But not "doc-book" or "linuxdoc".
Instead you should use tags that are as close to the NROFF
or TEXINFO original as possible. The first filter is simply
parsing the input syntax, and balencing things like
\fB...\fR
Then a second filter, to match what you get against
a "style". Eg normal man pages have a standard interpretation,
though the technology could go further.
Then filter into doc-book.
You may also want to look in the Tcl distribution, for a tcl script
that reads nroff files into some mid-way format.
(3) CGI links
<URL MAN>ls(1)</> creates:
<A HREF="http://localhost/cgi-bin/man2html?sec=1,ls">
That requires a local CGI server, (or somewhere on the WEB - maybe you?).
Particularly for users thinking about Linux from a W95 box,
it would be nice to have a standard set of ports/dirs for
MAN INFO and other. W95 portability might come with Tcl - httpd
(and something to process the ROFF/INFO - preferably in a way
that allows resizable widows).
Graham