Hi, Phi Debian wrote on Sat, Nov 15, 2025 at 08:49:09AM +0100:
> I got a tool producing man-pages, i.e page that will be displayed by > man(1) on tty device UTF8 capable with SGR's (namely vt100 emulator) Please stop right there. The whole point of manual pages is that they use semantic markup in the manual page source code and formatters can transform the semantic information to various output formats (PostScript, PDF, HTML, or ASCII or UTF-8 terminal output and more). Your approach completely ruins the whole point by narrowing the usefulness down to one submode of one submode of one output device (SGR mode of UTF-8 submode of terminal output). That's so excessively specific that my opinion is that what you are doing can no longer be considered "producing manual pages". Besides, you are not even saying what you are actually doing, we can only guess. I guess your tool generates man(7) files - but i could be wrong. You certainly have no business writing a man(7) generator when you appear to not even know what man(7) is (not saying that definitely is what is going on here, but it certainly sounds as if it were). Are you aware that well above a dozens different man(7) generators exist out there in the wild and that almost all of them are of horrible quality? That more or less the only exception of a man(7) generator producing man(7) code of tolerable quality is pod2man(1)? > In my generated man-page (that will feed groff...grotty) Again, stop right there. While groff is the dominant manual page formatter nowadays, it is not the only one. For example, basically all BSDs use mandoc(1) instead of groff(1) nowadays. Even some Linux distros do the same, and some other Linux distros provide a configuration option to users to switch groff(1) to mandoc(1) for manual display on individual machines (for example, Arch, OpenSUSE, Fedora, Gentoo ...). Many web sites that provide manual page collections on the WWW use neither groff nor mandoc for formatting, but have their own parsers. Some run software you might not expect - for example, manpages.debian.org uses the mandoc formatting engine. More, less common, formatters exist. > I'd like to be able to emit ledgit escape sequence (again when in > tty mode) What a terrible idea. Not all people allow their pager to interpret ANSI escape sequences. So again, even when you manage to do what you want, all you achieve is making your pages non-portable. On top of that, hardcoding colours in manual pages is a bad idea even for people who allow their pager and terminal to display colours because what you do will almost certainly clash with their personal colour scheme. The manual page should specifiy the semantics, not the presentation, and leave the presentation to the formatter. Finally, various kinds of colour blindness are more common than you might think. Hardcoding colours also makes your pages inaccessible, in particular in the unlikely case that you manage to actually achieve what you want and aren't already defeated by a toolchain preventing it. I think your whole project is utterly misguided and should be abandoned completely. Yours, Ingo
