Hi Colin,

On Sun, Nov 03, 2024 at 12:47:23AM +0000, Colin Watson wrote:
> I'm not trying to stop you committing whatever you want to your
> repository, of course, but I want to be clear that this doesn't actually
> solve the right problem for manual page indexing.  The point of the
> parsing code in mandb(8) - and I'm not claiming that it's great code or
> the perfect design, just that it works most of the time - is to extract
> the names and summary-descriptions from each page so that they can be
> used by tools such as apropos(1) and whatis(1).  Splitting on section
> boundaries is just the simplest part of that problem, and I don't think
> that doing it in a separate program really gains anything.

Splitting on section boundaries is the minimum thing so that mandb(8)
can use groff(1) directly to parse the section (instead of rolling your
own man(7) parser).

groff(1) could also be used --avoiding a shell script--, but that would
need a new feature in groff(1) --which Breanden has suggested--.  I
prefer avoiding the growth of groff(1), if a simple sed(1) invocation
can do it.

The script will be useful for now to me, so I'll probably commit it.
Feel free to use it if you find it useful.  (If so, please let me know
so that I keep the interface stable.)


Cheers,
Alex

> (That's leaving aside things like localized man pages, which I know some
> folks on the groff list tend to sniff at but I think they're important,
> and the fact that the NAME section has both semantic and presentational
> meaning means that like it or not the parser needs to be aware of this.)
> 
> -- 
> Colin Watson (he/him)                              [cjwat...@debian.org]
> 
> 

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

Attachment: signature.asc
Description: PGP signature

Reply via email to