Skip to content

Commit 9f4b884

Browse files
committed
Dropping html5validator in favour of vnu binary - fixing CI pipeline
1 parent ad66690 commit 9f4b884

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/node_modules
2-
*~~
1+
/node_modules/
2+
/vnu-runtime-image/

run.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@ install () {
1111
install_dev () {
1212
npm install -g eslint htmlhint stylelint
1313
npm install -D eslint eslint-plugin-unicorn @eslint/js @eslint/eslintrc stylelint-config-standard
14-
pip install html5lib html5validator pre-commit
14+
pip install html5lib pre-commit
1515
pre-commit install
1616
}
1717

1818
test_ludochaordic () {
19+
if ! [ -e vnu-runtime-image ]; then
20+
curl -ROLs https://github.com/validator/validator/releases/download/latest/vnu.linux.zip \
21+
&& unzip vnu.linux.zip \
22+
&& rm vnu.linux.zip \
23+
&& vnu-runtime-image/bin/vnu --version
24+
fi
25+
THEME_DIR=$PWD
1926
cd ..
2027
if ! [ -d pelican-plugins ]; then
2128
git clone https://github.com/getpelican/pelican-plugins.git
@@ -27,18 +34,19 @@ test_ludochaordic () {
2734
cd ludochaordic
2835
pip install -r requirements.txt
2936

30-
../pelican-mg/gen_imgs_from_mds.py content/*.md
37+
$THEME_DIR/gen_imgs_from_mds.py content/*.md
3138
sed -i '/PLUGINS +=/d' publishconf.py
3239
invoke publish -- -D
3340
git checkout HEAD publishconf.py
3441

3542
# Too many missing img alt attributes in thoses:
3643
rm output/street-art-and-hedonogeolostism-in-london.html output/variante-2-joueurs-pour-bang-le-jeu-de-des.html
3744

38-
html5validator --root output/ --ignore-re='.*(Element "eof" not allowed as child of element "p" in this context.|Element "style" not allowed as child of element.*|Text not allowed in element "iframe" in this context.|Attribute "allow" not allowed on element "iframe" at this point.|No "p" element in scope but a "p" end tag seen.|End tag "p" implied, but there were open elements.|Unclosed element "a".|End tag "div" seen, but there were open elements.)' # issue with pelican renderer: <p> contains legally only inline-/inline-block-elements
39-
40-
cp ../pelican-mg/.htmlhintrc output/
45+
cp $THEME_DIR/.htmlhintrc output/
4146
htmlhint output/
47+
48+
$THEME_DIR/vnu-runtime-image/bin/vnu --Werror --filterfile .vnurc output/index.html
49+
$THEME_DIR/vnu-runtime-image/bin/vnu --Werror --filterfile .vnurc output/quelques-sites-web-que-jai-concu.html
4250
}
4351

4452
eval "$1"

0 commit comments

Comments
 (0)