From nobody Thu Jun 9 15:29:04 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 8E35683A0CE for ; Thu, 9 Jun 2022 15:29:14 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4LJp0n53fDz4SHP; Thu, 9 Jun 2022 15:29:13 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from kent.sdaoden.eu (kent.sdaoden.eu [192.0.2.2]) by sdaoden.eu (Postfix) with ESMTPS id 623471605A; Thu, 9 Jun 2022 17:29:06 +0200 (CEST) Received: by kent.sdaoden.eu (Postfix, from userid 1000) id DCBE989B7A; Thu, 9 Jun 2022 17:29:04 +0200 (CEST) Date: Thu, 09 Jun 2022 17:29:04 +0200 Author: Steffen Nurpmeso From: Steffen Nurpmeso To: Steve Kargl Cc: Baptiste Daroussin , freebsd-hackers@freebsd.org Subject: Re: mandoc and volume titles Message-ID: <20220609152904.gc9ue%steffen@sdaoden.eu> In-Reply-To: References: <20220609071702.umix3bbub3qxunlq@aniel.nours.eu> User-Agent: s-nail v14.9.24-254-g443e374be3 OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Rspamd-Queue-Id: 4LJp0n53fDz4SHP X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of steffen@sdaoden.eu designates 217.144.132.164 as permitted sender) smtp.mailfrom=steffen@sdaoden.eu X-Spamd-Result: default: False [-0.78 / 15.00]; ARC_NA(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[sdaoden.eu]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_SPAM_MEDIUM(0.52)[0.518]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15987, ipnet:217.144.128.0/20, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[192.0.2.2:received] X-ThisMailContainsUnwantedMimeParts: N 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 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. 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)