On Fri, 20 Apr 2018 01:44:06 +1000 John Gardner <gardnerjo...@gmail.com> wrote:
> > You might like to believe that eqn, tbl, and pic could be processed > > with grohtml > > I've seen grohtml's complexity and was bewildered. Hence why I > intend to write my own. The procedures for inferring structural or > semantic metadata from low-level intermediate output commands will be > an entertaining challenge. =) For lack of a better term, I think it's an abstraction mismatch. The ditroff language presupposes a dot-addressable canvas, onto which lines and strings of text are drawn. That model fits most printers (these days) and terminals. But it doesn't describe HTML at all. I discussed HTML output with Ted Faber, of grap, upon a time. He produces HTML from a handful of his own macros. ISTM ms macros map onto HTML pretty well: .SH => <h1> .PP => <p> .I => <i> .B => <b> and so on. But what, for example, is HTML to do with line justification, and why should the browser honor the (implied) line breaks, when it has its own line-wrapping logic and style sheet, and the page size is dynamic? Similarly, it's fairly easy, up to a point, to imagine tbl generating HTML tables directly, easier (for me, anyway) than imagining how to infer the table structure after it's passed through groff. But then there are little niggles like <a href> and HTML's table/cell borders. <rant> I've said before that it's a terrible, terrible shame HTML ever was invented. It didn't need to be, and the cost is surely measured in billions of man-hours. When it was invented, the roff language was already 10 years old and in widespread use. It could have been adapted to the www through the simple expediency of writing a ditroff interface to the browser, such that the browser accepted and rendered ditroff output, as a postprocessor. The few novel aspects of that HTML introduced (relative to roff) -- hypherlinks, POST -- could have been added to roff. The escape mechanism was already there. And, voila! The thousands of roff documents already extant would have been instantantly accessible, and the skill of using the language extended to a new realm. We wouldn't be talking about how to convert/adapt/generate, because there'd be only one language. Yeah, I inow the history. Yet, even now, there's no low-level dot-addressable interface to the browser. It has to *interpret* everything: SVG, PNG, you name it. Why use anything if you can reinvent it? .rant off --jkl