xcode-man-pages
xcode-man-pages copied to clipboard
Use mandoc.css like OpenBSD man.cgi (formatting)
The OpenBSD man website is similar to this one in that it also takes the mandoc -Thtml output, but it just looks a lot better. The man.cgi code is part of upstream mandoc in... ~~oh no cvs~~ https://cvsweb.bsd.lv/mandoc/cgi.c. What really matters is the styling, which is also there pre-canned in https://cvsweb.bsd.lv/mandoc/mandoc.css?rev=1.52&content-type=text/x-cvsweb-markup.
- The page width is constrained.
- There's some fun little tooltip on macros to show what it was.
Honestly, just get the whole CSS. It's how the author intended the HTML to be used. It's all in there.
The mandoc(1) manual has a lot of useful options for -Thtml output. See https://man.openbsd.org/mandoc.1. We will need:
-Ostyle=/xcode-man-pages/mandoc.css, which causes it to inject the correct code for CSS inclusion.-Oman=/xcode-man-pages/%N.%S.html, which makes the See Also section (technically the.Xrmacro) work.
Roff2html isn't going to do any of that still, so py hack may need to be retained.
For reference, here are before and after screenshots of a sample page:
| Current |
|---|
With mandoc.css |
|---|
IMHO the constrained width, the less vibrant anchor links, and the aligned <dl> items are clear improvements over the current style.
Roff2html isn't going to do any of that still
Yay, it got removed with 24e4e034df8c2a0c3d29d36b7d25d0d6b8c46ece. It's even simpler now.
happy to take some PR here as long as it still works well with variable screen sizes!
Hmmm... I can get -Oman= to work in an isolated invocation, but I am still struggling to understand what -Ostyle wants. Going to put it off for now; maybe I will hit my head on the range hood when heating some soup and get some sudden inspiration from that.
It's only a max-width, so don't worry about screen size variability.