Search code examples
manpage

.Bl, .It to render list in mandoc doesn't work on both macOS and Ubuntu 16.04


I try to use a proper macro like .Bl with its .It to render list in mandoc (or per say man page) with the following syntax (as seen in mdoc.7)

The arguments are as follows: 
.Bl -tag -width Ds 
.It Fl v 
Print verbose information. 
.El

Tried both on macOS and Ubuntu 16.04 by putting into .SH DESCRIPTION, and it doesn't render expected output. All I see is

The arguments are as follows: Print verbose information.

The steps I do this is

  1. Edit mandoc file
  2. Symlink it to target file at /usr/local/share/man/man3/
  3. See result by man <filename>

PS. I didn't go any gzip.

What did I miss? How can I properly render list in mandoc?


Solution

  • Instead, I look at mandoc's code of /usr/share/man/man1/bash.1 in which I view such man page via man /usr/share/man/man1/bash.1 for safety to ensure I view the right file.

    It uses the following syntax

    .TP 10
    .BI Item Name
    Item description
    .TP
    .BI Item Name 2
    Item 2 description
    

    This will properly renders those two items in which the first column has 10 character in width. The second item will use the same column width as defined before. Much cleaner and simpler than what I tried but with not success in the question.

    You will see the following output using above syntax

    enter image description here