Manpages From .odt (OpenOffice/LibreOffice) Documents (oloman)
This is a Lisp program (with shell script, documentation, and so on) which converts xhtml documents exported by OpenOffice or LibreOffice into troff manpages.
I've was never satisfied with the look and appearance of manpages generated using markup languages. The manpages themselves are OK: there aren't a lot of options there. But the programs which create html manpages from the same markup yield ugly (to me, anyway) documents. Since there is no markup scheme to make good html documents (except for html itself) and the html-to-troff converters didn't do a good job for my purposes, I decided to start with a word processor then export xhtml. Then the xhtml is converted to troff using the Lisp program.
It works because, when OpenOffice or LibreOffice export xhtml, they decorate the result with style names from the original .odt document. xhtml is easy to parse, so I defined some styles needed for man pages, and when I see the styled text it's straightforward to emit the appropriate troff. For example, file names are usually shown in manpages as italic text, so I created a “manpage filename” style which is marked in troff as italics. This method has the advantage that I can give any appearance I want to filenames in the html or pdf versions of the manpage. The oloman program doesn't care about the appearance of the xhtml form, it only cares about the style name. So, for instance, I can make filenames any colour, italic or not, in the html or pdf version, and they'll still be rendered appropriately for the troff version.
The program isn't yet finished: it can parse the html but doesn't extract the style data, nor yet generate the troff. The main incentive for the oloman project is another project, cl-manpages, for which I'm creating a set of manpages for the programming language, Common Lisp.
The project includes its own man pages along with the usual README, LICENSE, and other files. Until I post them all, you can see the main Lisp program here.
Eventually, I'll make a tarball available on this site, but until then (and after, too) you can find the project at https://github.com/wakinyantanka/oloman
Copyright 2018 Michael Marking. All Rights Reserved.