tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: tech@mandoc.bsd.lv
Subject: Apropos NAME limitations (was: [Bug] Apropos - Xr Child of Nd Rendering)
Date: Fri, 13 Sep 2024 20:48:02 +0200	[thread overview]
Message-ID: <hx552fmnb2eud3t7msfovmjnfj3ncurpr5unspnfrgygvpoyj7@2jdfq7a6hs2c> (raw)
In-Reply-To: <ZuRfHW+gw6+KiAWX@asta-kit.de>

[-- Attachment #1: Type: text/plain, Size: 3166 bytes --]

Hi Ingo,

On Fri, Sep 13, 2024 at 05:49:49PM GMT, Ingo Schwarze wrote:
>   MANUAL STRUCTURE
>   [...]
>            NAME
>            The name(s) and a one line description of the documented material.
>            The syntax for this as follows:
> 
>                  .Nm name0 ,
>                  .Nm name1 ,
>                  .Nm name2
>                  .Nd a one line description
>   [...]
>   MACRO REFERENCE
>   [...]
>      Nd line
>           A one line description of the manual's content.  This is the
>           mandatory last macro of the NAME section and not appropriate
>           for other sections.
> 
>           Examples:
>                 .Nd mdoc language reference
>                 .Nd format and display UNIX manuals
> 
>           The Nd macro technically accepts child macros and terminates with
>           a subsequent Sh invocation.  Do not assume this behaviour: some
>           whatis(1) database generators are not smart enough to parse more
>           than the line arguments and will display macros verbatim.
> 
> So the behaviour is more or less documented to be undefined for your
> input.  Maybe the manual should discourage child macros below .Nd in
> even stronger terms.
> 
> The decision to not attempt formatting in the apropos(1) output module
> but simply print the one-line strings verbatim is deliberate.  There are
> two reasons for this decision.
> 
> First, simplicity and maintainability.  The database lookup code in
> apropos(1) is already quite complex.  Hooking into the full mdoc(7)
> and man(7) formatting modules, which are even more complex, would
> send complexity through the roof.  In general, for a small UNIX-style
> program, its a good idea to have no more than one source of complexity
> to not risk losing track of what is going on.  Besides, fancy
> formatting is really beside the point of the apropos(1) program,
> it's all about providing a simple, straighforward index.
> 
> Second point, robustness.  A small number of crazy piople do all
> kinds of crazy stuff below the .Nd macro.  In extreme cases, i
> have even seen paragraph breaks and the like in there.  If apropos(1)
> would try to honour such madness in formatting, that might utterly
> mess up the formatting of the apropos(1) output, which is supposed
> to be a simple list of one-line entries.  Where to draw the line?
> Which macros should be honoured here, which shouldn't?  Even if you
> make such set of a decisions, it is very hard to implement because
> the renderes are recursive and you will have a hard time passing in
> information from the outside where to stop processing at which lower
> level.

Do you have similar limitations for the NAME section in man(7)?  I'm
wondering if some of the pages in the Linux man-pages would cause
problems.

(I'm not maintaining them at the moment[1], but I should have a look at
 this in case I come back to the project.)

[1]  <https://lore.kernel.org/linux-man/CACKs7VB_GEt_u463R4JvWveghBBscQeqaWtKrMmxNSQ2mn+-VA@mail.gmail.com/T/#t>


Have a lovely night!
Alex

-- 
<https://www.alejandro-colomar.es/>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-09-13 18:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-02 17:01 [Bug] Apropos - Xr Child of Nd Rendering Alexander Ziaee
2024-09-13 15:49 ` Ingo Schwarze
2024-09-13 18:48   ` Alejandro Colomar [this message]
2024-09-13 20:23     ` Apropos NAME limitations (was: [Bug] Apropos - Xr Child of Nd Rendering) Ingo Schwarze
2024-09-13 21:03       ` Alejandro Colomar

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=hx552fmnb2eud3t7msfovmjnfj3ncurpr5unspnfrgygvpoyj7@2jdfq7a6hs2c \
    --to=alx@kernel.org \
    --cc=tech@mandoc.bsd.lv \
    /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).