[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: process man(7) (or any other package of macros) without typesetting
From: |
Alejandro Colomar |
Subject: |
Re: process man(7) (or any other package of macros) without typesetting |
Date: |
Thu, 17 Aug 2023 21:14:17 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.1 |
On 2023-08-17 21:12, Alejandro Colomar wrote:
> Hi Branden,
>
> I've had this desire for a long time, and maybe now I have a strong
> reason to ask for it.
>
> In the usual groff pipeline, you have something like
>
> $ preconv foo.1 >foo.1.tbl
> $ tbl <foo.1.tbl >foo.1.eqn
> $ eqn -Tutf8 <foo.1.eqn >foo.1.man
> $ troff -Tutf8 -man <foo.1.man >foo.1.set
> $ grotty -c <foo.1.set >foo.1.cat
>
> The problem is that at no point you can have the .roff source, after
> the man(7) macros have been expanded. Would it be possible to split
> the groff(1) pipeline to have one more preprocessor, let's call it
> woman(1) (because man(1) is already taken), so that it translates
> man(7) to roff(7)? I'd like to be able to do this:
>
> $ preconv foo.1p >foo.1p.tbl
> $ tbl <foo.1p.tbl >foo.1p.eqn
> $ eqn -Tutf8 <foo.1p.eqn >foo.1p.man
> $ woman -Tutf8 <foo.1p.man >foo.1p.roff
> $ troff -Tutf8 <foo.1p.roff >foo.1p.set
> $ grotty -c <foo.1p.set >foo.1p.cat
>
> With man(7) alone, it's already interesting to have this for
> debugging purposes. But I envision a more useful thing: POSIX uses
> mm(7) for their manual pages. Ideally, I'd like to keep their
> sources with minimal modification in man-pages-posix. But of course,
> man(1) only understands man(7) and mdoc(7). If we add a mm(1)
> program that is the mm(7) equivalent of woman(1), then I'd be able
> to install a preprocessed page, with the following pipeline, and
> man(1) should be able to render it, I guess:
>
> $ preconv foo.1p >foo.1p.tbl
> $ tbl <foo.1p.tbl >foo.1p.eqn
> $ eqn -Tutf8 <foo.1p.eqn >foo.1p.man
> $ mm -Tutf8 <foo.1p.man >foo.1p.roff
Oops, I meant:
> $ eqn -Tutf8 <foo.1p.eqn >foo.1p.mm
> $ mm -Tutf8 <foo.1p.mm >foo.1p.roff
> $ install foo.1p.roff /usr/man/man1p/foo.1p
>
> Does it sound reasonable to you?
>
> Cheers,
> Alex
>
>