rust-cli / roff-rs

ROFF (man page format) generation library
docs.rs/roff
Apache License 2.0
59 stars 11 forks source link

Example in README is not correct—possible bug in .list()? #5

Closed codesections closed 2 years ago

codesections commented 5 years ago

The example in the README shows an extra line break in the man output that does not actually occur in man's output.

Specifically, the example ends with this code:

.section("options", &[
        list(
            &[bold("-n"), ", ".into(), bold("--bits"), "=".into(), italic("BITS")],
            &[
                "Set the number of bits to modify. ",
                "Default is one bit.",
            ]
        ),
    ]);

The README correctly states that this will result it this roff code:

.SH OPTIONS
.TP
.BR \-n ", " \-\-bits =\fIBITS\fR
Set the number of bits to modify.
Default is one bit.

However, that roff code will not create a line break before "Default". To do that, the roff code should either be:

Set the number of bits to modify.
.br
Default is one bit.

or

.nf
Set the number of bits to modify.
Default is one bit.
.fi

I'm not sure if this is a very minor bug in the README or a bug in the .list method—is the intent for .list to put each item on a new line?

epage commented 2 years ago

We no longer provide list, so closing. See #15