-
-
Notifications
You must be signed in to change notification settings - Fork 483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite manual page in mdoc(7)
#230
Conversation
Signed-off-by: John Gardner <[email protected]>
I'm pretty much noob when it comes to man pages. I just wrote this man page by copy-pasting macros from other manuals. So, I"m sure this is a dumb question, but what is the point of writing a man page with the mandoc style instead of the current style? Semantic markup may be a good thing, but does this make a visible difference? Is this compatible on all Unix-like platforms, i.e. all Linux distros, BSDs and macOS? What about other projects? Do other project write their man pages in mandoc rather than the GNU-style these days? |
Yes, and it has been for the past 3 decades. I know I said
BSD's $ apropos 'Pa~\.so$' -a Ev=LD_PRELOAD Unlike a conventional search, None of these features are possible with purely presentational markup, which only concerns itself with the appearance of text (bold, underlined, indent, etc).
In the terminal, the improvements to formatting are marginal, but they spring to life when rendered in any other format (HTML, PDF, PostScript, etc). Compare: Unstyled HTML output:
BSD-derived systems (OpenBSD, FreeBSD, NetBSD, DragonflyBSD, etc) all use Today, the majority of manual pages that use
Node.js used to be an example of case #4 until I modernised it for them (see nodejs/node#18559). Footnotes
|
It looks like only 66 man pages among 3917 in my /usr/share/man/man1/ are written in the mdoc format, so it's definitely a minority. But I'm fine with mdoc because ld.lld's man page is also written in mdoc. I wrote part of it, but I wasn't aware of what that man page was written in. I'll merge this commit. One question: why is line continuation preferred over hard line break? |
Perhaps on your system, which I'm assuming is some flavour of GNU/Linux? On BSD-derived systems, Moreover, you only scanned the contents of your
When a sentence ends in an appropriate punctuation character like This tends to be much more noticeable in PDF and PostScript output, but it's also relevant in terminal output as well (particularly when densely-packaged blocks of text are involved). |
This PR refactors
docs/mold.1
to usemdoc(7)
instead ofman(7)
. Mdoc is a modern alternative to the historicman
macro-set, which abstracts presentational details from higher-level markup.Here's a before-and-after comparison to show you how the page will look when formatted for the terminal.