Hi Ralph, On 3/10/23 12:26, Ralph Corderoy wrote: > Hi Alejandro, > >>> I haven't studied what you're doing, but are you aware of preconv(1)? > ... >> So, the actual pipeline that I should be using is more like >> >> preconv | tbl | eqn | troff | grotty > > Yes. The problem with groff(1) existing is it hides information and > stops newcomers learning the basics. :-) ā-Vā helps.
The problem with man(1) existing is it hides information and stops
newcomers learning the basics. Not even '-V' helps. :-)
Heh, that's actually been quite true in my case, and I guess in the
case of many. 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.
>
> $ groff -Tascii -kpt -V
> preconv | pic | tbl | troff -Tascii | grotty
> $
Does man(1) run pic(1)? If so, I should also add it to the pipeline
in my testing.
>
>> and then `... | col | grep` for checking the 80-col limit is respected
>> in the output. Right?
>
> col would need at least -x and -b.
Yup, I run -pbx (IIRC, per your recommendation). I just showed the
commands without flags for simplicity. The acutal pipeline that I
run is this:
$ touch man2/membarrier.2
$ make lint-man-groff V=1 | grep -v LINT
preconv man2/membarrier.2 >tmp/lint/man2/membarrier.2.tbl
tbl <tmp/lint/man2/membarrier.2.tbl >tmp/lint/man2/membarrier.2.eqn
eqn -Tutf8 <tmp/lint/man2/membarrier.2.eqn 2>&1
>tmp/lint/man2/membarrier.2.troff \
| ( ! grep . )
troff -man -t -M ./etc/groff/tmac -m checkstyle -rCHECKSTYLE=3 -ww -Tutf8
-rLL=78n <tmp/lint/man2/membarrier.2.troff >tmp/lint/man2/membarrier.2.grotty
grotty -c <tmp/lint/man2/membarrier.2.grotty >tmp/lint/man2/membarrier.2.col
col -b -p -x <tmp/lint/man2/membarrier.2.col >tmp/lint/man2/membarrier.2.grep
! grep -n '.\{80\}.' tmp/lint/man2/membarrier.2.grep /dev/null >&2
touch tmp/lint/man2/membarrier.2.lint-man.groff.touch
Please feel free to comment if you see anything that could be improved
there. 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 check grotty(1) to see its
> options can remove the need for col.
Nah, col(1) is fine. That way, we may even teach some casual readers
that it exists, and can be useful.
>
>> Do you recommend that I use a fallback-encoding (-D)? Or should it be
>> unnecessary?
>
> If this is within your environment then I'd have thought the testing
> framework would mean -D is not needed.
So far it seems it's not needed. After adding plain `preconv` to the
pipeline, everything works.
<https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/?id=7c6ae1a3ee9a43124490b32d1b462e97cb38441b>
Cheers,
Alex
--
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
OpenPGP_signature
Description: OpenPGP digital signature
