On Wed, Jul 09, 2025 at 06:36:08AM +0000, Werner LEMBERG wrote:
> Maybe you can provide a list of the most important CSS changes, or
> maybe add a section that describes how to do the transition to Texinfo
> 7.0 and newer?

Here is what is in tta/TODO (which is more notes than TODO).  We have
not formally described that in the Texinfo manual because we do not
want to bind us to anything.


Notes on classes names in HTML
==============================
 
In january 2022 the classes in HTML elements were normalized.  There are no
rules, but here is descriptions of the choices made at that time in case one
want to use the same conventions.  The objective was to have the link between
@-commands and classes easy to understand, avoid ambiguities, and have ways to
style most of the output.
 
The class names without hyphen were only used for @-commands, with one
class attribute on an element maximum for each @-command appearing in the
Texinfo source.  It was also attempted to have such a class for all
the @-commands with an effect on output, though the coverage was not perfect,
sometime it is not easy to select an element that would correspond to the
most logical association with the @-command (case of @*ref @-commands with
both a <cite> and a <a href> for example).
 
Class names <command>-* with <command> a Texinfo @-command name were
only used for classes marking elements within an @-command but in other
elements that the main element for that @-command, in general sub elements.
For example, a @flushright lead to a <div class="flushright"> where the
@flushright command is and to <p class="flushright-paragraph"> for the
paragraphs within the @flushright.
 
Class names *-<command> with <command> a Texinfo @-command name were
reserved for uses related to @-command <command>.  For example
classes like summary-letter-printindex, cp-entries-printindex or
cp-letters-header-printindex for the different parts of the @printindex
formatting.
 
def- and -def are used for classes related to @def*, in general without
the specific command name used.
 
For the classes not associated with @-commands, the names were selected to
correspond to the role in the document rather than to the formatting style.
 
 
In HTML, some @-commands do not have an element with a class associated, or the
association is not perfect.  There is @author in @quotation, @-command affected
by @definfoenclose.  @pxref and similar @-commands have no class for references
to external nodes, and don't have the 'See ' in the element for references to
internal nodes.  In general, it is because gdt() is used instead of direct
HTML.
 


> 
> > So I think that a manual rewrite is the way to go.
> 
> Sigh.
> 
> > Hopefully, the CSS classes should not change much after 7.0, although
> > the HTML elements could change (and have changed).
> >
> > Looking at this file, it seems to me that these are already the new
> > classe names used?
> 
> Maybe partially – I guess the transition to new class names started
> even before version 7.0 – but definitely not all.  For example, we
> currently have `pre.menu-comment` in `lilypond-manuals.css` for
> Texinfo 6.8, which must be changed to `pre.menu-comment-preformatted`
> for Texinfo 7.2.

It won't help for all the classes, as it shows only the classes actually
used in CSS rules, but a way to see all the classes is to run, as said in
the Texinfo manual:

texi2any -c SHOW_BUILTIN_CSS_RULES=1

-- 
Pat

Reply via email to