u2ps icon indicating copy to clipboard operation
u2ps copied to clipboard

rewrite manpages in mdoc(7)

Open janstary opened this issue 2 years ago • 0 comments

Currently, the manpages u2ps(1) and psfrem(1) are written in the traditional man(7) markup language. I am proposing to rewrite them into the semantic markup of the mdoc(7) language. I am willing to do the work.

Both the man(7) and mdoc(7) languages have been around for decades, and are supported by the prevalent formatters: groff(1) on most Linuxes and mandoc(1) on the *BSDs and some others. In particular, there is nothing to install or reconfigure on most systems

  • both formats can be rendered with man(1) or processed into plaintext, html, pdf, or ps.

The main point is that mdoc(7) allows for constructs like

    .Op Fl f Ar arg

meaning

    there is an optional 'f' flag
    which takes an 'arg' argument

as opposed to

    switch to italics, type a bracket, a dash, "f",
    then switch to boldface and type "arg"

in the physical roff markup of man(7).

Similarly for other constructs like cross-references, filenames, author emails, env variables, etc.

As an example, here is a rewrite of psfrem.1; while here,

  • spell the [options] out explicitly
  • fix "-d var" vs "-d name"
  • slight reformulations

janstary avatar Jun 23 '23 11:06 janstary