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

This documentation seems to be written as if you were using the Pygments
code as Python rather than running it from the command line.  However, the
documentation for "pygmentize" says you can use the -O option to give options:

   Lexer and formatter options can be given using the -O option:

https://pygments.org/docs/cmdline/

Hence, I'd be hopeful of something like "-O classprefix=pm-" working.

Reply via email to