tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Groff



Aleksej Saushev <asau%inbox.ru@localhost> wrote:
 |tlaronde%polynum.com@localhost writes:
 |> On Mon, Jun 01, 2015 at 05:50:07PM +0000, David Holland wrote:
 |>> On Sun, May 31, 2015 at 09:24:48PM -0400, Andrew Cagney wrote:

 |>>> (oh and please delete C++ groff,  just replace it with that AWK script)

 |>> (quite seriously, I've been looking for a while for an alternative to
 |>> groff for typesetting the miscellaneous articles in base.
 |>
 |> (Delenda Carthago...) Once more, I will re-advertise that the complete
 |> Donald E. Knuth typesetting system is available, that can be even 
 |> restricted to strictly just D.E.K.'s work (even with the fonts,
 |> this is a matter of far less than 10 MB); that is pure C89
 |> (some auxiliaries invoke POSIX.2 utilities, mainly sh(1) but these

 |>  http://www.kergis.com/en/kertex.html

 |There's a lot better approach that beats all the above on all accounts.
 |
 |Import libxml2, libxslt, w3m that are all readily available, convert man
 |pages to a human-readable and human-writable format, which is XML,
 |and stop using archaic formats.
 |
 |This has a number of significant benefits over TeX or roff:
 |1. XML is well-known, the syntax doesn't require anything special to learn.

It is even more unreadable as mdoc(7).

 |2. There's abundancy of software to process it.

Why do you need that?

 |3. XML can be used immediately, without preprocessing step (just point
 |web browser at it, and it will load stylesheet and perform XSL
 |transformation for you).

lynx(1) does not.  (Despite not being in the base system.)

[Resorting a bit to increase the excitement]

 |6. You can enforce all those rules that are currently enforced manually
 |by wizd(8) with an already existing Schema definition.

Well wizd(8) sometimes hangs, and even Schema verification won't
help if normal variables are defined as environment variables, or
functions being declared as commands or whatever.

 |4. Desktop users will have really good rendering as provided by Firefox
 |or Webkit.
 |5. You can have better searching and indexing tools (because they exist
 |already).

So this *could* become a false point of yours for at least the
traditional BSD mdoc(7) manual format over time if mdoc(7) would
gain the mdocmx(7) reference extension:

  The mdoc(7) manual semantic markup language doesn't support any
  kind of anchoring: whereas you can exactly state what x is
  whenever you refer to it – variable, function etc. –, you have no
  option to define the exact place where x is itself defined, or
  wether it is at all defined in a given manual page.

  Also, whereas mdoc(7) does support differentiation in between
  anchors and references for headlines (.Sh / .Ss and .Sx,
  respectively), referencing a headline is only of notational
  interest, the reference is in no way “active”, never.

  mdocmx(7) extends mdoc(7) by adding all the missing functionality
  and (much) more with a single new multiplexer command: .Mx.

There are mature patches for groff(1) available (the enhancement
request is at [1], online manual [2]), and it will be a regular
part of my own GPL2 groff(1) fork, S-roff.  I'm still hoping the
mdocml developers implement it, too.  What i really like about
this is that you can work on the terminal and simply say "$ man
xy" and use the "normal" less(1) to get an interactive manual
reading experience, being able to gain a table-of-content, follow
references to local anchors and even those to external manuals
(after additional confirmation).

  [1] http://savannah.gnu.org/bugs/?45034
  [2] http://sdaoden.users.sourceforge.net/code-mdocmx.html

(What is not so nice is that (a) normal man(7) isn't enhanced and
(b) preformatted manuals had to pre-select globally wether
mdocmx(7) shall be enabled or not.  For DB-based approaches,
however, one could think about storing preformatted BLOBs without,
and only the difference with enabled mdocmx(7), even joining the
two to compress only a single BLOB, or whatever, then reacting
accordingly dependent on the user choice.  Or a similar approach.)

 |Just in case you don't know, nearly any user has libxml2 and libxslt
 |installed anyway.

Not consciously, no.  (expat(1), though.)
Btw., nothing would prevent adding configurable syntax-
highlighting to the mdoc(7) troff(1) macros.

--steffen



Home | Main Index | Thread Index | Old Index