discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Cameron Katri <me@cameronkatri.com>
Cc: discuss@mandoc.bsd.lv
Subject: Re: Specify man section name at runtime
Date: Mon, 4 Oct 2021 10:06:59 +0200	[thread overview]
Message-ID: <YVq2I0bI8dYoNPWk@asta-kit.de> (raw)
In-Reply-To: <20211003231630.mb65kbrsb4cpb4yn@FreeBSDY540>

Hi Cameron,

Cameron Katri wrote on Sun, Oct 03, 2021 at 07:16:30PM -0400:

> Well this is a very niche use case, but on FreeBSD they patch msec.in
> to say "FreeBSD General Commands Manual" etc.

I think that patching is ill-advised.  In manual pages, the operating
system name is supposed to be printed in the footer line (lower left
corner), not in the header line.   One consequence of the FreeBSD
patching is that if you format manual pages of another operating system
on FreeBSD, the header line will always include the misleading string
"FreeBSD" anyway, and as you observed, there is no way to tell mandoc
to leave it out.

The string in the footer line, on the other hand, defaults to uname(3),
which already includes "FreeBSD" by default, and can be overridden
both by the "-I os=" option on the command line and by the .Os macro
in the manual page.

The file msec.in does not exist for the purpose of branding that
FreeBSD abuses it for, but to accomodate differing volume conventions
of operating systems.  For example, illumos has traditionally been
using the System V convention that includes

  LINE("4", "File Formats and Configurations")
  LINE("5", "Standards, Environments, and Macros")
  LINE("6", "Games and Demos")
  LINE("7", "Device and Network Interfaces")
  LINE("8", "Maintenance Procedures")
  LINE("9", "Kernel Concepts")

and many subsections, in particular in volume 3.

Of course, that also implies that formatting BSD device driver manuals
on illumos will show the misleading volume title "File Formats and
Configurations", but that can't be helped because manual page files do
not contain any indication which volume numbering scheme they adhere to.

> which means that when I use mandoc -T html to generate my website

I assume you use a Makefile for that purpose, or at least some kind
of script to regenerate the website when needed?

> I have to use a different build of mandoc so that the volume title
> just says "Miscellaneous Information Manual"
> instead of "FreeBSD Miscellaneous Information Manual."

What's wrong with saying something like

  index.html: index.mdoc
    mandoc -T html index.mdoc | sed '/head-vol/s/FreeBSD //' > index.html

in that script?

I doubt that use case warrants adding a feature that makes the
documentation longer and hence harder to read for every user.

Yours,
  Ingo
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv


  reply	other threads:[~2021-10-04  8:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-03 17:49 Cameron Katri
2021-10-03 18:40 ` Jan Stary
2021-10-03 18:49 ` Ingo Schwarze
2021-10-03 23:16   ` Cameron Katri
2021-10-04  8:06     ` Ingo Schwarze [this message]
2021-10-04 18:07       ` Cameron Katri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YVq2I0bI8dYoNPWk@asta-kit.de \
    --to=schwarze@usta.de \
    --cc=discuss@mandoc.bsd.lv \
    --cc=me@cameronkatri.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).