[LyX/master] Merge branch 'features/indexmacros'

Thibaut Cuvelier dourouc05 at gmail.com
Fri Dec 23 00:00:59 UTC 2022


On Mon, 21 Nov 2022 at 08:56, Kornel Benko <kornel at lyx.org> wrote:

> Am Sun, 20 Nov 2022 15:23:58 -0500
> schrieb Scott Kostyshak <skostysh at lyx.org>:
>
> > On Sun, Nov 20, 2022 at 08:24:41PM +0100, Thibaut Cuvelier wrote:
> > > On Sun, 20 Nov 2022 at 16:47, Scott Kostyshak <skostysh at lyx.org>
> wrote:
> > >
> > > > On Sun, Nov 20, 2022 at 04:33:36PM +0100, Thibaut Cuvelier wrote:
> > > > > > When I open the exported de Math.xhtml in Chromium, I get:
> > > > > >
> > > > > >   "error on line 7159 at column 22: Entity 'imaginary' not
> defined"
> > > > > >
> > > > >
> > > > > That's unrelated to this branch, it was a problem in the MathML
> > > > > configuration.
> > > >
> > > > Ah, I was wondering why xmllint didn't catch it but I guess it
> doesn't
> > > > catch MathML issues. Probably there is a way to catch them in the
> > > > ctests, but I don't know if we want to make our ctests more strict.
> If
> > > > we make them more strict, I will bug you more about test failures :)
> > > >
> > >
> > > xmllint is probably not the best tool for (X)HTML, it just validates
> XML
> > > syntax (HTML is not necessarily XML, but what LyX generates is; there
> are
> > > many constraints that xmllint doesn't know about).
> > >
> > > There are many tools to validate HTML as command-line utilities, but
> most
> > > of them are in JavaScript; maybe http://www.html-tidy.org/ could be
> > > included as a test dependency? It should be more or less easy to
> integrate,
> > > as it's just C buildable with CMake and no dependency.
> >
> > I would be happy to help incorporate that if Kornel does not object (he
> > knows the most about the ctest framework).
>
> Not objecting.
>
> > Let's first figure out whether we want the checks in the ctests though.
> > I think a good rule of thumb is: if a test starts to fail (i.e., suppose
> > the test with this stricter check used to pass, but some commit that
> > affects XML output causes the test to fail), will you give priority to
> > either quickly fixing things so that the test passes, or reverting the
> > commits that caused the tests to fail? If yes, then they are a good
> > candidate to be included in the ctests.
> >
> > If not, probably it is better for you to use the tool locally on your
> > side. I can help figure out a script for this as well. For example, it
> > could just loop through all the .lyx files in the repository, export
> > with xhtml, and check which files pass the stricter test. It would be
> > easy to set up an ignore list, etc. Or we could put the script in
> > https://gitlab.com/scottkosty/lyx-tester which has various scripts for
> > testing.
> >
> > Let me know what sounds best.
> >
> > Scott
>
> +1
>

Here is a patch that adds a script that validates every export LyX test
case. It's not fast to run, approximately 10 minutes (roughly 200 calls to
LyX to get the HTML files, then 200 calls to the JVM for validation -- each
time starting from scratch). The slowest part seems to be LyX, though, so
that batching the calls to the validator will not drastically cut the run
times (maybe 30%).

The results are excellent: all files are valid with the current master :D!
Running the script every so often would keep it that way.

To make its output easier to understand, do you know if there is a way to
remove these messages from LyX when it runs in CLI?

Warning: Document class not available
----------------------------------------
The selected document class
Springer Monographs (svmono)
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:
svmono.cls
See section 3.1.2.2 (Class Availability) of the
User's Guide for more information.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20221223/f825e914/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-LyXHTML-add-a-script-to-validate-all-the-generated-f.patch
Type: application/octet-stream
Size: 4360 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20221223/f825e914/attachment-0001.obj>


More information about the lyx-devel mailing list