On 11/24/25 8:41 AM, Gavin Smith wrote:
On Sun, Nov 23, 2025 at 12:43:19PM -0800, Raymond Toy wrote:
Sorry for the really long delay. I finally got around to testing this
out the latest git version of texinfo. It works just fine with a minor
tweak that it should be |pygmentize -f html -l %l|.
And AFAICT, there are no conflicts. I updated the CC for the maxima
manual to include CSS for the default style and a dark style. The
examples show up with the expected colors in both the light and dark
style.
Nope, I was wrong. texinfo produces |<small class="sc">|. The class "sc" is
also used by pygments. I assume I can solve this by defining a CSS rule for
|small.sc|.
I haven't tried it but I found a reference to the "classprefix" option
in the Pygments documentation:
classprefix
Since the token types use relatively short class names, they may
clash with some of your own class names. In this case you can use the
classprefix option to give a string to prepend to all Pygments-generated
CSS class names for token types. Note that this option also affects the
output of get_style_defs().
https://pygments-doc.readthedocs.io/en/latest/formatters/html.html
Thank you very much for this! I haven't done any research since I sent
the message, so I really appreciate this.
Using classprefix makes the classes pretty unique (or as unique as I
want to make it). And pygmentize can automatically generate the
appropriate CSS style file with the prefix already added. Nice! (For the
record, I just used |-O classprefix=pyg-|.)
I look forward to the next release of texinfo with this support.
​