[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Man page customization after 1.23?
From: |
Lennart Jablonka |
Subject: |
Re: Man page customization after 1.23? |
Date: |
Fri, 4 Aug 2023 00:58:02 +0000 |
Quoth Nate Bargmann:
seems to work as expected, at least on my Arch. However, I don't see
that OSC 8 links work in evince. Hmmm.
OSC is a kind of control sequence, OSC 8 is the way with which we
get links to a terminal. Links in PDFs are interesting, but the
correct term is not “OSC 8.”
Are there plans to give users access to coloring the various text styles
when grotty is set to generate SGR output? Right now only the -i option
is available. The reason I ask is that even though italics catch my eye
in a PDF or on the printed page, they seem to slip by when mixed with
normal text in a terminal. Perhaps that is mostly because I've gotten
used to man pages on the display having such emphasized text in color or
my preferred Gnome Terminal doesn't stylize the characters enough. More
than likely it's a matter of training.
First: What you’re trying to do is a hack. However you
accomplish it, it’ll be a hack. The manual author said “This is
italic.” It’s unlikely you colorize the italic text in a book
you bought. A hack, and nothing but.
Now, ways to get the colors: You could modify an.tmac and
doc.tmac, as well as the font description files. I’m not sure
what features for colors groff has; maybe it allows you to define
a font “I” with a certain color, maybe not.¹ You can change the
definitions of .I, .IR, .RI & Co., though.
You could modify grotty to give you colors. Right now, it just
spits out SGI control sequences. You could change that.
I’m playing with grotty and terminfo. My first conclusion is
that terminfo isn’t great. I might finish in a few weeks. If
grotty uses terminfo sometime, you could change the terminal
description. Something like
xterm-man|xterm with nice italics replaced by green,
sitm=\E[32m,
ritm=\E[39m,
use=xterm,
would allow you to have MANROFFOPT=-P-Txterm-man give you green
non-italic italics. What a giant hack. “This text is italic.”
“Sure, how do I make text italic?” “To make the text italic, do
what makes it green.” “Here you have your italic text!”
The least hacky way might be to let your terminal emulator do the
job: You configure it so that it renders italic text as colorful.
Still a hack.
¹ If \fI didn’t work, it wouldn’t be a big deal, though: It’s
a hack anyway.
As noted above, italicized text on the console is colored green on black
which I presume is a choice of grotty, but perhaps it is a function of
the console hardware driver.
That’s a function of the Linux terminal.