Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 09 Jun 2022 17:29:04 +0200
From:      Steffen Nurpmeso <steffen@sdaoden.eu>
To:        Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc:        Baptiste Daroussin <bapt@freebsd.org>, freebsd-hackers@freebsd.org
Subject:   Re: mandoc and volume titles
Message-ID:  <20220609152904.gc9ue%steffen@sdaoden.eu>
In-Reply-To: <YqIEl0SgJytjD%2BAW@troutmask.apl.washington.edu>
References:  <YqEyLFHI8GQi6NLc@troutmask.apl.washington.edu> <20220609071702.umix3bbub3qxunlq@aniel.nours.eu> <YqIEl0SgJytjD%2BAW@troutmask.apl.washington.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20220609152904.gc9ue%steffen>