Opened 15 months ago

Last modified 3 months ago

#5561 new task

Automate validation of html version of postgis manual

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 3.6.0
Component: QA/testsuite Version: master
Keywords: documentation, html Cc:

Description

At the moment the generated html is not checked for validity. This ticket is to add a Makefile check target for it.

It may be easy to do if we keep the xhtml format as xmllint could then be used to validate. See #5559 and #5555

Change History (5)

comment:1 by strk, 15 months ago

Both Ubuntu-22.04 and Debian-11 have this package available:

  • xhtml-relaxng - Implementation in RELAX NG of the modularization of XHTML

RelaxNG validation is already used for the source XML so it would be the natural way to validate the XHTML output.

comment:2 by strk, 15 months ago

Some errors are found pretty early by RelaxNG but I'm not sure they are real errors:

# xmllint --noout --relaxng /usr/share/xml/xhtml-relaxng/xhtml.rng html/postgis-en.html 
html/postgis-en.html:2: element div: Relax-NG validity error : Element body has extra content: div
html/postgis-en.html fails to validate

That's the very first <div> after <body>, which sounds perfectly fine to me …

Using the "basic" RelaxNG finds other kind of invalidities:

$ xmllint --noout --relaxng /usr/share/xml/xhtml-relaxng/xhtml-basic.rng html/postgis-en.html 
html/postgis-en.html:33: element a: Relax-NG validity error : Invalid attribute target for element a
html/postgis-en.html:39: element img: Relax-NG validity error : Element img failed to validate attributes
html/postgis-en.html:40: element img: Relax-NG validity error : Element img failed to validate attributes
html/postgis-en.html:41: element img: Relax-NG validity error : Element img failed to validate attributes
html/postgis-en.html:41: element a: Relax-NG validity error : Invalid attribute target for element a
html/postgis-en.html:43: element a: Relax-NG validity error : Invalid attribute target for element a
html/postgis-en.html:43: element hr: Relax-NG validity error : Did not expect element hr there
html/postgis-en.html:43: element hr: Relax-NG validity error : Element div has extra content: hr
html/postgis-en.html:269: element section: Relax-NG validity error : Did not expect element section there
html/postgis-en.html:269: element section: Relax-NG validity error : Element div has extra content: section
html/postgis-en.html fails to validate

comment:3 by strk, 15 months ago

Another commandline validator option (suggested from #xml on libera): https://pypi.org/project/vnu-validator/

comment:4 by strk, 14 months ago

Component: buildQA/testsuite
Keywords: html added; testsuite removed

comment:5 by robe, 3 months ago

Milestone: PostGIS 3.5.0PostGIS 3.6.0
Note: See TracTickets for help on using tickets.