schemedoc / manpages

Unix manual pages for R6RS and R7RS
https://man.scheme.org
Other
16 stars 2 forks source link

Use unroff to generate HTML #14

Closed lassik closed 1 year ago

lassik commented 1 year ago

I managed to resurrect unroff, which is a Scheme-scriptable troff parser. It runs using the version of Elk Scheme that ships in Debian (apt install elk) and produced pretty good results with little work.

I think we should ditch our patched copy of the C program man2html and patch unroff instead. It's faster and more fun, produces better output, and we'd be improving Scheme at the same time.

lassik commented 1 year ago

Check out how easy it was to add manpage-to-manpage links into the HTML output with no prior support in the codebase.

weinholt commented 1 year ago

Looks neat. Does it handle eqn and tbl macros?

lassik commented 1 year ago

It should.

In this way authors of hypertext documents can take full advantage of the usual troff facilities such as user-defined macros, conditional text, tables, equations, and drawings, automatic table of contents generation, footnotes/endnotes, indexes, etc., none of which are available when composing documents directly in plain HTML.

Example with tables

lassik commented 1 year ago

I just regenerated man.scheme.org using unroff. Example: bitwise-ior. The clickable links should work.

Elk segfaults on my computer with some pages, so those are missing. I'll look into it.

lassik commented 1 year ago

The segfault is related to call/cc and possibly has to do with alloca().

Elk seems to run crash-free on Debian.

lassik commented 1 year ago

So far, so good. The work to improve HTML generation continues at https://github.com/schemeorg-community/man.scheme.org.