Generate Manual Pages from AsciiDoc

Manual page converter

Asciidoctor’s built-in man page converter generates roff-formatted manual pages from AsciiDoc documents.


The man page converter generates manual pages for software used on Unix and Unix-like operating systems. To use the man page converter, assign manpage to the backend option.

What is a manual page?

A manual page, often abbreviated to man page, is a form of software documentation found on Unix-based operating systems. The formalized structure of its content allows the man command to present the manual page as a formatted document in a terminal pager.

Generate a man page with the manpage converter

Before running Asciidoctor, make sure your source document adheres to the manpage doctype structure and the doctype attribute is assigned the value manpage.

To generate a man page, run:

$ asciidoctor -b manpage source.adoc

The manpage converter sets the output file name to progname.1, where progname is the name of the command and 1 is the volume number, as defined by the doctitle of the source document.

When converting to the man page format, Asciidoctor uppercases the titles of all level-0 and level-1 sections. This saves you from having to type section titles in all uppercase. It also makes the document portable to other output formats since this style is only needed in the man page output to align with conventions.

If you’re using Ruby 2.4 or greater, Asciidoctor will uppercase any letter in the title that is recognized by the Unicode specification as having an uppercase equivalent (which includes non-Latin letters). Prior to Ruby 2.4, Ruby could only uppercase Latin letters.

Asciidoctor can also produce HTML and PDF versions similar to the manpage output for viewing in other contexts. To see the man page in HTML, run:

$ asciidoctor source.adoc

Here is an example man page composed in AsciiDoc for the eve command:

= eve(1)
Andrew Stanton
:doctype: manpage
:manmanual: EVE
:mansource: EVE
:man-linkstyle: pass:[blue R < >]

== Name

eve - analyzes an image to determine if it's a picture of a life form

== Synopsis

*eve* [_OPTION_]... _FILE_...

== Options

*-o, --out-file*=_OUT_FILE_::
  Write result to file _OUT_FILE_.

*-c, --capture*::
  Capture specimen if it's a picture of a life form.

== Exit status

  Image is a picture of a life form.

  Image is not a picture of a life form.

== Resources

*Project web site:*

== Copying

Copyright (C) 2008 {author}. +
Free use of this software is granted under the terms of the MIT License.

Convert the man page to PostScript or PDF

Once you have created a man page, you can convert it to PostScript using the man command.

Let’s assume that the output file produced by the Asciidoctor manpage converter is progname.1, where progname is the name of the command and 1 is the volume number. You can convert progname.1 to PostScript and redirect the output to using the following man command:

$ man -t ./progname.1 >

Alternately, you can redirect the output of the man command to ps2pdf to further convert it to PDF:

$ man -t ./progname.1 | ps2pdf - progname.pdf

Using these same commands, you can convert Asciidoctor’s own man page to PDF:

$ asciidoctor -h manpage | man -t -l - | ps2pdf - asciidoctor.pdf

In this case, the -l - reads the man page content generated by the help mode of the asciidoctor command.

Keep in mind that the files in this section are not generated using Asciidoctor. If you want to generate PDF files directly from Asciidoctor, you may be interested in checking out Asciidoctor PDF.

Man page doctype

The manpage doctype has the following required parts:

Document Header

A manpage document header is mandatory. The title line contains the man page name followed immediately by the manual section number in round brackets. The title name should not contain white space. The manual section number is a single digit optionally followed by a single character.

The NAME Section

The first manpage section is mandatory, must be titled “NAME” and must contain a single paragraph (usually a single line) consisting of a list of one or more comma-separated command name(s) separated from the command purpose by a dash character. The dash must have at least one white space character on either side.

The SYNOPSIS Section

The second manpage section is mandatory and must be titled “SYNOPSIS”.

Subsequent sections are optional, but typical sections include “SEE ALSO”, “BUGS REPORTS”, “AUTHORS” and “COPYRIGHT”.

Man page attributes

Several built-in document attributes only affect man pages. These attributes must be set in the document header.

Built-in manpage document attributes
Attribute Description Value (as parsed from example above)


Alternative way to set the man page name.



Manual section number.



Alternative way to set the command name.



Alternative way to set the command purpose.

converts AsciiDoc source files


Style the links in the manpage output. A valid link format sequence.

blue R <>


The source to which the manpage pertains. When producing DocBook, it becomes a DocBook refmiscinfo attribute and appears in the footer.



The version of the man page. Defaults to revnumber if not specified. When producing DocBook, it becomes a DocBook refmiscinfo attribute and appears in the footer. Not used by Asciidoctor.



Manual name. When producing DocBook, it becomes a DocBook refmiscinfo attribute and appears in the footer.

Asciidoctor Manual

Refer to the AsciiDoc source of the Asciidoctor man page to see a complete example. The manual page for Asciidoctor is produced using the manpage converter. The manual pages for git are also produced from AsciiDoc documents, so you can use those as another example to follow.