Hi Ralph, On 3/10/23 13:08, Ralph Corderoy wrote: > Hi Alejandro, > >> To me man(1) is still a black box (I have looked at its source code >> occasionally, but not very often), and there's no way to know what >> it's doing, since it provides no equivalent to groff(1)'s -V. > > Colin Watson's man(1) uses his libpipeline(3). > > $ PIPELINE_DEBUG=1 man ls 2>&1 >/dev/null | grep '^Starting pipeline:' > Starting pipeline: > zcat > [input: {0, /usr/share/man/man1/ls.1p.gz}, output: {-1, NULL}] > Starting pipeline: > zcat > [input: {0, /usr/share/man/man1/ls.1.gz}, output: {-1, NULL}] > Starting pipeline: > zcat > [input: {0, /usr/share/man/man1/ls.1.gz}, output: {-1, NULL}] > Starting pipeline: > (echo .nh && echo .de hy && echo .. && echo .na && echo .de ad && > echo .. && zcat) > [input: {0, /usr/share/man/man1/ls.1.gz}, output: {-1, NULL}] > Starting pipeline: > (cd /usr/share/man && /usr/lib/man-db/zsoelim) | > (cd /usr/share/man && /usr/lib/man-db/manconv -f UTF-8:ISO-8859-1 -t > UTF-8//IGNORE) | > (cd /usr/share/man && preconv -e UTF-8) | > (cd /usr/share/man && tbl) | > (cd /usr/share/man && nroff -mandoc -rLL=265n -rLT=265n -Tutf8) > [input: {-1, NULL}, output: {-1, NULL}] > Starting pipeline: > col -b -p -x | > sed -e '/^[[:space:]]*$/{ N; /^[[:space:]]*\n[[:space:]]*$/D; }' > [input: {-1, NULL}, output: {0, NULL}] > Starting pipeline: > zcat > [input: {3, NULL}, output: {-1, NULL}] > Starting pipeline: > Waiting for pipeline: zcat > [input: {3, NULL}, output: {-1, NULL}] > $
Interesting! > >>> $ groff -Tascii -kpt -V >>> preconv | pic | tbl | troff -Tascii | grotty >>> $ >> >> Does man(1) run pic(1)? > > It can do. It sometimes reads the man page to find out the > preprocessors to use. Read around ‘MANROFFSEQ’ in man(1). Hmm, then I'll add it. Not sure if we want to really use pic(1) in the pages, but it doesn't hurt to have it there, and might be useful in some corner case :) > >> BTW, you may notice I added some trick to make eqn(1) fail: >> >> <https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/?id=e728d5d1e639e5c803a84480ad727e7b02bac222> > > I'd grep for ^ as otherwise the code doesn't match the commit message. > :-) A bit pedantic, isn't it? Would eqn(1) write just newlines to stderr? A bit gross of eqn(1), it would be :-) But yes, I think it's interesting to have it, even if just for preventing people from copy&pasting from there into other situations where that might actually happen. Thanks! Alex -- <http://www.alejandro-colomar.es/> GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
OpenPGP_signature
Description: OpenPGP digital signature