Re: deroff(1) and deroff (1b) with mdoc(7) (was: demandoc(1))

From: Bakul Shah <bakul_at_iitbombay.org>
Date: Sun, 06 Aug 2023 15:27:46 UTC
On Aug 6, 2023, at 4:32 AM, Graham Perrin <grahamperrin@freebsd.org> wrote:
> 
> deroff(1) /usr/local/heirloom/usr/5bin/deroff is potentially more useful than
> deroff(1b) /usr/local/heirloom/usr/ucb/deroff however
> deroff(1) removes a little too much; <https://reviews.freebsd.org/P600$148-153>.

Heirloom deroff was derived from plan9 deroff.

> 
> <https://www.freshports.org/devel/plan9port/>
> 
> deroff(1) in Plan 9 from User Space has:
> 
> - a manual page that differs from deroff(1) and deroff(1b) in the Heirloom Toolchest
> 
> - the same glitch (below).
> 
> 
> % cat /usr/src/share/man/man8/rc.8 | grep Operation\ of
> .Ss Operation of Nm
> .Ss Operation of Nm rc.shutdown
> % /usr/local/plan9/bin/deroff /usr/src/share/man/man8/rc.8 | grep Operation
> Operation
> Operation   rc.shutdown
> %

Why not try to fix deroff to also support mdoc just as it supports mm and ms
macros? I hope you are not talking about adding demandoc to the base!

Incidentally FreeBSD man fails at properly formatting deroff.1 man page.

It produces
       -mm    Remove titles, attachments, etc., as well as ordinary troff
              constructs, from or mm documents.

nroff -man produces this:
       -mm    Remove titles, attachments, etc., as well as ordinary troff con‐
              structs, from ms(7) or mm(7) documents.

9 man
          -mm Remove titles, attachments, etc., as well as ordinary
              troff constructs, from ms(7) or mm documents. 
	
mandoc man page says:

             By default, the
             input language is automatically detected for each file: if the
             first macro is Dd or Dt, the mdoc(7) parser is used; otherwise,
             the man(7) parser is used.  With other arguments, -m is silently
             ignored.

So either it is using the wrong parser or the parser is doing the wrong thing!