Re: mandoc and volume titles

From: Steffen Nurpmeso <steffen_at_sdaoden.eu>
Date: Thu, 09 Jun 2022 15:29:04 UTC
Steve Kargl wrote in
 <YqIEl0SgJytjD+AW@troutmask.apl.washington.edu>:
 |On Thu, Jun 09, 2022 at 09:17:02AM +0200, Baptiste Daroussin wrote:
 |> On Wed, Jun 08, 2022 at 04:35:08PM -0700, Steve Kargl wrote:
 ...
 |>> mandoc and mdoc(7) are a convenient system for writing
 |>> documentation, but it has a drawback.  The volume
 |>> title is hardcoded to a FreeBSD manual page.  For my
 |>> personal projects, I would like to change the volume
 |>> title.  For example.
 |>> 
 |>> % mandoc tier.1 | head -1
 |>> TIER(1)           FreeBSD General Commands Manual             TIER(1)
 |>> 
 |>> I have hacked up mandoc to accept a -V option, which allows e.g.,
 |>> 
 |>> % mandoc -V "Steve's Menagerie" tier.1 | head -1
 |>> TIER(1)                  Steve's Menagerie                     TIER(1)

Note .Dt has optional parameters.
And mandoc honours the third parameter for this purpose.
(Of course it extends the general thing, as in

  .Dt \*(XX 8 several_upstreams_exist

ending up as

  S-POSTGRAY(8)  System Manager's Manual (several_upstreams_exist) S-POSTGRAY(8)

) but that it is!  If i were you i would simply assign something
to the string volume-ds-8, as early as possible in the document
(before the mdoc(7) preamble), as in:

  .Dd June 7, 2022
  .\" ..
  .ds volume-ds-8 in_fear_of_fear
  .
  .Dt \*(XX 8 several_upstreams_exist
  .Os
  .Mx -enable

This then gives

  S-POSTGRAY(8)                 BSD in_fear_of_fear S-POSTGRAY(8)

for regular *roff upstreams, unfortunately not for mandoc which
cooks its own soup, so to say.  But that still handles the
optional argument.

That is to say, your "regular upstream" should simply honour the
strings in the regular BSD mdoc package instead, then assigning
values to those strings would do the right thing (tm).

Ciao.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)