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

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jun 09, 2022 at 05:29:04PM +0200, Steffen Nurpmeso wrote:
> 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)


So, I changed my local manpage to 

Dd June 8, 2022
.Dt TDI \*(XX 1 "Steve's Menagerie"
.Sh NAME

On FreeBSD, it produces 

TDI(1)    FreeBSD General Commands Manual (steve's menagerie)          TDI(1)

That is not what I'm after.  First, I want to completely replace the
"FreeBSD General ..." volume title.  Second, the optional third
parameter is in lower case.

If mdoc had a .Vl macro, I could do

.Vl Steve's Menagerie
.Dd June 8, 2022
.Dt TDI \*(XX 1 "Steve's Menagerie"
.Sh NAME

TDI(1)    Steve's Menagerie          TDI(1)

> 
> ) 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)

Where does the BSD come from?  Seems a bit odd to randomly appear.

-- 
Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YqIiLQUI7Y/QH3Qg>