Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I write a man page?

Where can I find a reference of all formatting codes?

Are there any good tutorials on writing man pages?

What is the most convenient way to write a man page? Should I enter it directly in a text editor? Are there WYSIWYG editors? Or should I write it in a different format and then convert?

What rules should a good man page follow?


locked by HopelessN00b Mar 13 '15 at 17:50

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

closed as too broad by Jenny D, kasperd, HBruijn, MadHatter, mdpc Oct 16 '14 at 0:54

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

This question appears to be too broad. It has only succeeded in attracting a bunch of link-only answers and a few unsupported opinions. – 200_success Oct 15 '14 at 8:57
man man, man groff. – Jenny D Oct 15 '14 at 9:19

There are tools for writing man pages that bypass troff formatting. manpages are a small, well delimited language and easy to target.

Two popular tools are:

yodl and zoem seem to be other nice formats in this space.

All in all I'd recommend xmltoman because it's a very manpage specific dsl that will guide you closely.

"dsl" == "domain specific language"? – Dennis Williamson Feb 4 '10 at 16:23
yes (da. si. 15 chars.) – Tobu Feb 4 '10 at 16:46
Another good option is ronn, which reads the more-widely-used Markdown text markup language. – poolie Aug 10 '13 at 6:07

I have written a rather extensive blog article about the topic, which you can find here:

It'd be helpful if you could at least summarize the article here -- links alone are worthless once the linked page inevitably moves or disappears. – Caleb Jun 26 '13 at 16:09
I do not agree with Caleb. This is the web. The web is based on links, and stackexchange does not carry any special exception to this. Copying content is counterproductive. Whatever bad thing can happen to that page or document can also happen to this one. We cannot hoard scraped copies of all content just because the rest of the web might disappear. (Leave that job to sites like the wayback machine). – Kaz Oct 9 '13 at 21:23
Kaz, you may not agree, but Caleb's comment is definitely ServerFault best-practice. – MadHatter Oct 15 '14 at 8:03

I do not know of any IDEs or tutorials, but you can start by copying an existing man page and modify it to suit your needs.

For a reference of the groff language with MAN macros (which is what is used by a man page) consult the groff_man man page, or read it online here


Take a look at the ronn project. Its a markdown to man page generator. It can also generate the man pages in html, like this.

I like the idea of writing all my software documentation in one format. Markdown IMO is a good choice


Not the answer you're looking for? Browse other questions tagged or ask your own question.