From nobody Thu Jun 9 21:13:40 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 27DBB852BD1 for ; Thu, 9 Jun 2022 21:13:49 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LJxfN1hPcz3r81; Thu, 9 Jun 2022 21:13:48 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.16.1/8.16.1) with ESMTPS id 259LDfTS037627 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 9 Jun 2022 14:13:41 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.16.1/8.16.1/Submit) id 259LDebo037626; Thu, 9 Jun 2022 14:13:40 -0700 (PDT) (envelope-from sgk) Date: Thu, 9 Jun 2022 14:13:40 -0700 From: Steve Kargl To: Steffen Nurpmeso Cc: Baptiste Daroussin , freebsd-hackers@freebsd.org Subject: Re: mandoc and volume titles Message-ID: Reply-To: sgk@troutmask.apl.washington.edu References: <20220609071702.umix3bbub3qxunlq@aniel.nours.eu> <20220609152904.gc9ue%steffen@sdaoden.eu> <20220609165536.A5vGK%steffen@sdaoden.eu> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220609165536.A5vGK%steffen@sdaoden.eu> X-Rspamd-Queue-Id: 4LJxfN1hPcz3r81 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=washington.edu (policy=none); spf=none (mx1.freebsd.org: domain of sgk@troutmask.apl.washington.edu has no SPF policy when checking 128.95.76.21) smtp.mailfrom=sgk@troutmask.apl.washington.edu X-Spamd-Result: default: False [-0.70 / 15.00]; HAS_REPLYTO(0.00)[sgk@troutmask.apl.washington.edu]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.93)[-0.926]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_ADDR_EQ_FROM(0.00)[]; NEURAL_HAM_MEDIUM(-0.43)[-0.430]; NEURAL_SPAM_SHORT(0.66)[0.661]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:73, ipnet:128.95.0.0/16, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[washington.edu : No valid SPF, No valid DKIM,none] X-ThisMailContainsUnwantedMimeParts: N On Thu, Jun 09, 2022 at 06:55:36PM +0200, Steffen Nurpmeso wrote: > Steve Kargl wrote in > : > |On Thu, Jun 09, 2022 at 05:29:04PM +0200, Steffen Nurpmeso wrote: > |> Steve Kargl wrote in > |> : > |>|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. > ... > |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: > ... > |> S-POSTGRAY(8) BSD in_fear_of_fear S-POSTGRAY(8) > | > |Where does the BSD come from? Seems a bit odd to randomly appear. > > These are all strings from the doc-common mdoc(7) (g)roff file > which are then picked up by mdoc(7) as required by the context. > (g)roff can give you what you want like this: > > .ds volume-operating-system steve > .ds volume-ds-8 kargl > > (before the [.Dd,].Dt,.Os preamble), and i get then > > S-POSTGRAY(8) steve kargl S-POSTGRAY(8) > > Ingo Schwarze just currently has a run on mandoc in the OpenBSD > source tree since a couple of days, maybe if a FreeBSD folk would > point him to doc-common strings (or at least the volume-ds-* > ones), you would be fine out with the next release of mandoc. > The first 6 lives of my file are .ds volume-operating-system steve .ds volume-ds-8 kargl .Dd June 8, 2022 .Dt TDI 1 .Sh NAME .Nm tdi % mandoc tdi.1 | head -1 TDI(1) FreeBSD General Commands Manual TDI(1) I cannot find mention of .ds in mandoc(1) nor mdoc(7) man pages. Depending groff documentation, which might not be installed as it is a port, seems to be a bit dubious. % groff -T ascii -mdoc tdi.1 | head -1 TDI(1) FreeBSD General Commands Manual TDI(1) It appears to no work? -- Steve