Regressions in 2.4 xhtml export [was: TESTING Tarballs for 2.4.0]

Thibaut Cuvelier dourouc05 at gmail.com
Mon May 20 01:24:30 UTC 2024


On Wed, 15 May 2024 at 11:15, Pavel Sanda <sanda at lyx.org> wrote:

> On Tue, May 14, 2024 at 04:29:00PM +0200, Pavel Sanda wrote:
> > On Tue, May 14, 2024 at 04:13:49PM +0200, Pavel Sanda wrote:
> > > On Tue, May 14, 2024 at 03:27:13PM +0200, Pavel Sanda wrote:
> > > > On Mon, May 13, 2024 at 05:48:40PM -0400, Richard Kimberly Heck
> wrote:
> > > > > Tarballs for 2.4.0 are here:
> > > > >
> > > > >     http://ftp.lyx.org/pub/lyx/devel/lyx-2.4/
> > > >
> > > > Looks ok on stable and oldstable debian.
> > >
> > > not a showstopper, but with little playing I see the following problem
> with tables:
>
> InsetInfo shortcuts export to xhtml is borken compared to 2.3.
>
> In 2.3 we exported: <span class='info shortcut'>Ctrl+N</span>
> In 2.4 we expor: <bdo class="shortcut" dir="ltr">Ct+r+l+++N</bdo>
>
> Thibaut, I guess this is due to new xml routines, could you have a look?
>

Actually, it was due to the refactoring for direction in HTML5. I have
pushed 7cfe36e6aa4460ae8641cd36f4aab5f013390326 and
e3f2b10842cdc808e9f2bf235692f283009d3734 to fix that. This could make it to
2.4.0, as it is a bit serious.

Related issue:

When exporting the document (User's guide) as XHTML (I haven't configured
LaTeX with my development LyX), I am repeatedly getting this message:

Warning: No bibliography processor found!
----------------------------------------
The bibliography processor requested by this document (bibtex) is not
available and no appropriate alternative has been
found. No bibliography and references will be generated.
Please fix your installation!

The problem is that it appears repeatedly, meaning more than 10 times for
the user's guide at HEAD, apparently at each call to Inkscape to transform
SVGZ to PNG.

Pavel
>
> PS: I had a bold idea to export our manuals to xhtml and put it on the wiki
> so some of users questions can be caught by googling or asking AI bots.
> But the current state of xhtml export of our manuals looks broken on too
> many places.
>
> I'll probably file some bug with list of issues later, but quick look on
> user guide export shows:
>
> - inset info shortcut broken (above in this message)


See above.


> - nested bullet points in listings shifted by an inch and overlap with
> text - e.g. section 2.8, 3.1.4, 3.7.6 etc
>

That's both a CSS and an HTML issue: CSS for the subitems (like Ctrl in
2.8), HTML for continuing items (like Alt in 2.8). For the CSS part, adding
this rule seems to help:

li.labeling_item ul,  li.labeling_item ol {
  text-indent: 0;
  margin-left: -5em;
}

However, the result with nested lists is still very poor (with ".." being a
subitem to Home and End):

[image: image.png]

The problem is that this is configured in most layouts (HTMLStyle block),
so it is painful to fix.

The best solution in the long term, in my opinion, is to switch to HTML
definition lists, which is semantically correct (while the current output
is not a good use of lists). It mostly works out of the box, with no CSS
changes. I believe the C++ changes would be quite minimal, but it would
break any custom CSS. I am attaching an excerpt from the User's guide:
`UserGuide_list.xhtml` for the current output, `UserGuide_list -
Copy.xhtml` for my proposed refactoring. The result is quite close to what
we have in LyX. I bet this change should be delayed to 2.4.1, as it might
break a bit more, or even 2.5 if we consider this kind of change breaking.


> - horrible image sizing - e.g. section 3.3.1, 4.2, 4.4, 4.6, 6.11.1, 6.17,
> A.9.1/2
>

Modern CSS can use `scale:` instead of `width:` to mimic the meaning of
LyX' display factor better. I have pushed this as
f2660d172c3f38e2dad1f32d7b3b4d953e2efb8a. Here is the result I get, which
is better (but not exactly what I wanted):

[image: image.png]

Notice the space around the image. I could not find a solution to this
problem. If the scale factor is over 100%, the bounding box (used to draw
text) will be the one of the image file while the contents will be scaled
(and go outside the bounding box). Here is an example with 170%:

[image: image.png]

I believe this is a limitation of LyX' system: HTML supposes you don't have
oversized images, while it is very common in LaTeX to scale images so that
they fit your layout. Any solution welcome :)!
For now, I think that f2660d172c3f38e2dad1f32d7b3b4d953e2efb8a should stay
on 2.5 and not be backported (unless there is a consensus that this is
closer to the behaviour we want).


> - math broken: 5.1.4: "Invalid Markup"
>

I cannot reproduce with the current version (2.5.0~dev):

[image: image.png]


> - url is text instead of url: 6.3.1, 6.15, 6.16.1 (wrong url anyway)
>

This is not possible with the current layout format. URLs are implemented
as flex insets, with many parameters, but the current design forces that
the flex inset outputs its contents only once. For this two work, we'd need
to output it twice: as text and as a parameter. It doesn't look not too
hard to implement (my current bet is on InsetText::insetAsXHTML, around
writing the opening outer tag with `htmltag()`), but we need a new layout
version, hence not in scope for 2.4.

- bibliography items has the same huge fonts size as the section heading
>

Actually, they are output as headings (`h2`). However, I don't understand
anything about the HTML bibliography code (which is why it is completely
different in DocBook) :/. I don't understand how to set the HTMLTag for
bibliography items (it's always reset to `h2` when reaching
`xhtmlParagraphs` from `output_xhtml.cpp`'s `makeBibliography`). If anyone
understands the code well enough :). (Otherwise, maybe it'd be good to
rewrite it to be more similar to DocBook.)


> - some nomenclanture links do not work (e.g. try "Shift" or "Alt")
>

Some magic IDs are not output, especially for list items. That's what I'm
changing in 2d86b881242c3ea4756af28f8458aeb7cbfa6822, a candidate for
backporting to 2.4.1.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20240520/56b0d7fb/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 59732 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20240520/56b0d7fb/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 38917 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20240520/56b0d7fb/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 45261 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20240520/56b0d7fb/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 50746 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20240520/56b0d7fb/attachment-0007.png>
-------------- next part --------------
D:\LyX\lyx-unstable\cmake-build-debug\bin\LyX.exe
DirectWrite: CreateFontFaceFromHDC() failed (Indicates an error in an input file such as a font file.) for QFontDef(Fami
ly="Times New Roman", pointsize=8, pixelsize=11, styleHint=1, weight=50, stretch=100, hintingPreference=0) LOGFONT("seri
f", lfWidth=0, lfHeight=-11) dpi=144
DirectWrite: CreateFontFaceFromHDC() failed (Indicates an error in an input file such as a font file.) for QFontDef(Fami
ly="Arial", pointsize=8, pixelsize=11, styleHint=0, weight=50, stretch=100, hintingPreference=0) LOGFONT("sans", lfWidth
=0, lfHeight=-11) dpi=144
support\Systemcall.cpp (283): Systemcall: 'git ls-files "UserGuide.lyx"' did not start!
support\Systemcall.cpp (284): error The process failed to start. Either the invoked program is missing, or you may have
insufficient permissions to invoke the program.
Warning: Document class not available
----------------------------------------
The selected document class
        KOMA-Script Book
requires external files that are not available.
The document class can still be used, but the
document cannot be compiled until the following
prerequisites are installed:
        scrbook.cls
See section 3.1.2.2 (Class Availability) of the
User's Guide for more information.
Warning: Package not available
----------------------------------------
The module customHeadersFooters requires a package that is not
available in your LaTeX installation, or a converter that
you have not installed. LaTeX output may not be possible.
Missing prerequisites:
        fancyhdr.sty
See section 3.1.2.3 (Modules) of the User's Guide for more information.
Warning: Package not available
----------------------------------------
The module enumitem requires a package that is not
available in your LaTeX installation, or a converter that
you have not installed. LaTeX output may not be possible.
Missing prerequisites:
        enumitem.sty
See section 3.1.2.3 (Modules) of the User's Guide for more information.
Warning: No bibliography processor found!
----------------------------------------
The bibliography processor requested by this document (bibtex) is not available and no appropriate alternative has been
found. No bibliography and references will be generated.
Please fix your installation!

** (org.inkscape.Inkscape:12904): WARNING **: 19:50:50.573: No cc:license metadata found, derived license URI from cc:Li
cense: http://creativecommons.org/publicdomain/zero/1.0/
Warning: No bibliography processor found!
----------------------------------------
The bibliography processor requested by this document (bibtex) is not available and no appropriate alternative has been
found. No bibliography and references will be generated.
Please fix your installation!

** (org.inkscape.Inkscape:25184): WARNING **: 19:50:53.109: No cc:license metadata found, derived license URI from cc:Li
cense: http://creativecommons.org/publicdomain/zero/1.0/
Warning: No bibliography processor found!
----------------------------------------
The bibliography processor requested by this document (bibtex) is not available and no appropriate alternative has been
found. No bibliography and references will be generated.
Please fix your installation!

** (org.inkscape.Inkscape:23936): WARNING **: 19:50:55.141: No cc:license metadata found, derived license URI from cc:Li
cense: http://creativecommons.org/publicdomain/zero/1.0/
Warning: No bibliography processor found!
----------------------------------------
The bibliography processor requested by this document (bibtex) is not available and no appropriate alternative has been
found. No bibliography and references will be generated.
Please fix your installation!
Warning: No bibliography processor found!
----------------------------------------
The bibliography processor requested by this document (bibtex) is not available and no appropriate alternative has been
found. No bibliography and references will be generated.
Please fix your installation!
Warning: No bibliography processor found!
----------------------------------------
The bibliography processor requested by this document (bibtex) is not available and no appropriate alternative has been
found. No bibliography and references will be generated.
Please fix your installation!
Warning: No bibliography processor found!
----------------------------------------
The bibliography processor requested by this document (bibtex) is not available and no appropriate alternative has been
found. No bibliography and references will be generated.
Please fix your installation!
Warning: No bibliography processor found!
----------------------------------------
The bibliography processor requested by this document (bibtex) is not available and no appropriate alternative has been
found. No bibliography and references will be generated.
Please fix your installation!

** (org.inkscape.Inkscape:24324): WARNING **: 19:51:05.533: Ignoring unrecognized CSS property: block-progression

** (org.inkscape.Inkscape:24324): WARNING **: 19:51:05.534: Ignoring unrecognized CSS property: block-progression
Warning: No bibliography processor found!
----------------------------------------
The bibliography processor requested by this document (bibtex) is not available and no appropriate alternative has been
found. No bibliography and references will be generated.
Please fix your installation!

** (org.inkscape.Inkscape:3424): WARNING **: 19:51:07.491: Ignoring unrecognized CSS property: block-progression

** (org.inkscape.Inkscape:3424): WARNING **: 19:51:07.492: Ignoring unrecognized CSS property: block-progression
Warning: No bibliography processor found!
----------------------------------------
The bibliography processor requested by this document (bibtex) is not available and no appropriate alternative has been
found. No bibliography and references will be generated.
Please fix your installation!
Warning: No bibliography processor found!
----------------------------------------
The bibliography processor requested by this document (bibtex) is not available and no appropriate alternative has been
found. No bibliography and references will be generated.
Please fix your installation!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20240520/56b0d7fb/attachment-0004.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UserGuide_list.lyx
Type: application/octet-stream
Size: 10203 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20240520/56b0d7fb/attachment-0001.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20240520/56b0d7fb/attachment-0005.html>


More information about the lyx-devel mailing list