groff
[Top][All Lists]
Advanced

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

Re: [Groff] groff developments - query about any interest?


From: John Gardner
Subject: Re: [Groff] groff developments - query about any interest?
Date: Sun, 20 Nov 2016 03:42:08 +1100

Hey Ingo,

Don't worry, I'm very much aware of mandoc. It's fast and the results are
excellent. The OpenBSD team did a hell of a job. =)

However, the feature being implemented/requested is really a gimmick. It's
essentially terminal emulation from inside Atom <https://atom.io/>, which
is a modern graphical editor built upon Chromium (a framework called
Electron <http://electron.atom.io/>). The majority of its users are those
with a background in modern web development (myself included).

Atom includes a built-in facility for preview markdown on the fly as one
types, an idea I'm basically modelling this feature to resemble. I realised
it'd be nice to have real-time previews of Roff with every keystroke
(particularly since the language is so fun to play with), so I deemed it a
feature worth implementing, even if it is somewhat frivolous.

I'll stop explaining, because I'm sure half of this list are cringing at
how absurd this all sounds (don't worry, I'm inclined to agree with you).

#younger-generation


On 20 November 2016 at 03:05, Ingo Schwarze <address@hidden> wrote:

> Hi John,
>
> John Gardner wrote on Sun, Nov 20, 2016 at 02:27:43AM +1100:
>
> > Regarding HTML... I fully hear what you're saying. Somebody asked for a
> > realtime preview of manual-page editing
> > <https://github.com/Alhadis/language-roff/issues/3> for Atom (a text
> editor
> > which is built using web technologies: HTML, CSS, JavaScript, etc). I
> > thought it'd be simple to implement in barebones HTML, but quickly
> realised
> > what I was getting myself into.
> >
> > So I've decided to use HTML5 <canvas> instead, piping Groff's
> intermediate
> > output through a separate process and lexing the instructions to plot
> basic
> > drawing operations in a side pane. Heck of a lot simpler than translating
> > HTML to/from *Roff... =)
>
> For that particular task, you may want to consider using mandoc(1) -Thtml
> rather than groff, see http://mdocml.bsd.lv/ .
> Even though groff (Postscript, PDF, ...) typesetting abilities are
> far superior to mandoc and mandoc is limited to the mdoc(7), man(7),
> tbl(1), and eqn(1) languages, mandoc HTML output for manual pages
> may be better than groff output, see http://man.openbsd.org/ for
> examples.  You certainly don't need any lexing, mandoc generates
> polyglot HTML5 out of the box.  Mandoc HTML output contains many
> semantic class="..." annotations, so you can easily customize it
> with CSS.  For HTML output of manual pages, mandoc may be up to two
> orders of magnitude faster than groff:
>
>   address@hidden $ time groff -mdoc -Thtml ksh.1 > /dev/null
>     0m02.58s real     0m02.72s user     0m00.09s system
>   address@hidden $ time mandoc -mdoc -Thtml ksh.1 > /dev/null
>     0m00.03s real     0m00.03s user     0m00.00s system
>
>   address@hidden $ time groff -man -Thtml perltoc.1 > /dev/null
>     0m08.86s real     0m09.18s user     0m00.30s system
>   address@hidden $ time mandoc -man -Thtml perltoc.1 > /dev/null
>     0m00.21s real     0m00.19s user     0m00.02s system
>
>   address@hidden $ time groff -man -Thtml bash.1 > /dev/null
>     0m04.23s real     0m04.38s user     0m00.14s system
>   address@hidden $ time mandoc -man -Thtml bash.1 > /dev/null
>     0m00.04s real     0m00.03s user     0m00.02s system
>
> That may matter for repeated processing, in particular on a web server.
> Finally, from a security perspective, groff may not be quite ideal
> for running on a web server; it is relatively old, not quite security-
> centric code, while mandoc has been exhaustively tested with the afl(1)
> fuzzer and in addition to that, the HTML output module got a complete
> manual security review by Sebastien Marie.
>
> Yours,
>   Ingo
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]