> PS: Another option is to rewrite the Dictionary in some templatized,
> plain-text-friendly format which could be readily converted to HTML.
I did exactly that in 1999. The juggle CVS contrib section provides
the Release 4 DoJ re-typed from scratch, based on the printed
edition, in a simple markup form, totalling to 7687 lines or 180KB.
Included are also sample converters to other formats and a J "help"
verb for the jconsole which is pretty much the equivalent of the
IDE's Ctrl-F1 context help.
I decided not to use a general-purpose markup but to devise a small
"domain-specific" notation suited to denote the DoJ contents. The
format uses about a dozen very simple one-letter tags and is designed
to be parsable by simple code. (For example, embedded J expressions
in a description are bracketed and may not span lines.) The
converters generating HTML output or troff input also take care of
generating an index and hyperlinks.
For example, this is the entry for the monad Open:
N Open
M >
R 0
T
Open is the inverse of box, that is, [[><y]] is [[y]].
When applied to an open array (that has no boxed
elements), open has no effect. Opened atoms are
brought to a common shape as discussed in Sec. II B.
H
Since the rank of open is [[0]], it applies to each
atom of its argument. For example:
E
]a=: 1 2 3;4 5 6;7 8 9
>a
H
Results of different shapes are padded as defined in
Section II B. For example:
E
(>1;2 3;4 5 6); (>'a';'bc';'def'); (<\i.4); (><\i.4)
The markup preserves the distinction between defining text (boxed in
the original layout) and additional hints/notes (beneath the boxed part),
using the T vs. H markers as in the sample above.
I decided to get rid of the 2-column layout -- monad and dyad of a
verb are independent, self-standing entries in this version. This
involved slight editorial changes where the original switches between
the 2- and 1-column layout, mostly for the hints and examples sections.
Sometimes I found it appropriate to split the non-boxed parts, sometimes
I had to duplicate a non-boxed part or fragments of it.
For all J examples, the text only notes the input expressions but
not their resulting output. My primary idea was of course that I'm
lazy -- manually typing in the results would be just a silly,
redundant task better done by the J engine itself, either "live"
or during pre-formatting. My second idea was that an option just
to see the input expressions from the DoJ could also serve as a
nice excercise for the more ambitious Dictionary reader.
However, I must admit that I never got around to code any (live or
pre-processing) sample evaluator. This part is still missing,
patches are welcome.
Martin
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm