Skip to content

Commit

Permalink
Use pa11y-ci instead of pa11y (#294)
Browse files Browse the repository at this point in the history
* Use pa11y-ci instead of pa11y

Main improvement: improved readability of logs, as well as "potential"
performance improvements.

* Revert `pa11y` target name changes for backwards compatibility

* Fix more leftover `pa11y-ci` rename-revert mistakes
  • Loading branch information
tarek-y-ismail authored Oct 22, 2024
1 parent d7f19e5 commit af9a5ab
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
11 changes: 11 additions & 0 deletions .sphinx/pa11y-ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"defaults": {
"chromeLaunchConfig": {
"args": [
"--no-sandbox"
]
}
},
"reporter": "cli",
"standard": "WCAG2AA"
}
9 changes: 0 additions & 9 deletions .sphinx/pa11y.json

This file was deleted.

10 changes: 5 additions & 5 deletions Makefile.sp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SOURCEDIR = .
METRICSDIR = $(SOURCEDIR)/metrics
BUILDDIR = _build
VENVDIR = $(SPHINXDIR)/venv
PA11Y = $(SPHINXDIR)/node_modules/pa11y/bin/pa11y.js --config $(SPHINXDIR)/pa11y.json
PA11YCI = $(SPHINXDIR)/node_modules/pa11y-ci/bin/pa11y-ci.js --config $(SPHINXDIR)/pa11y-ci.json
VENV = $(VENVDIR)/bin/activate
TARGET = *
ALLFILES = *.rst **/*.rst
Expand Down Expand Up @@ -58,10 +58,10 @@ sp-woke-install:
{ echo "Installing \"woke\" snap... \n"; sudo snap install woke; }
sp-pa11y-install:
@type $(PA11Y) >/dev/null 2>&1 || { \
echo "Installing \"pa11y\" from npm... \n"; \
@type $(PA11YCI) >/dev/null 2>&1 || { \
echo "Installing \"pa11y-ci\" from npm... \n"; \
mkdir -p $(SPHINXDIR)/node_modules/ ; \
npm install --prefix $(SPHINXDIR) pa11y; \
npm install --prefix $(SPHINXDIR) pa11y-ci; \
}
sp-install: $(VENVDIR)
Expand Down Expand Up @@ -105,7 +105,7 @@ sp-woke: sp-woke-install
-c https://github.com/canonical/Inclusive-naming/raw/main/config.yml
sp-pa11y: sp-pa11y-install sp-html
find $(BUILDDIR) -name *.html -print0 | xargs -n 1 -0 $(PA11Y)
$(PA11YCI) $(shell find $(BUILDDIR) -name *.html)
sp-vale: sp-install
@. $(VENV); test -d $(SPHINXDIR)/venv/lib/python*/site-packages/vale || pip install vale
Expand Down

0 comments on commit af9a5ab

Please sign in to comment.