canonical / sphinx-docs-starter-pack

A documentation starter-pack
https://canonical-starter-pack.readthedocs-hosted.com/
Other
13 stars 35 forks source link

Unmet dependencies to use accessibility check leads to poor UX #173

Closed pmatulis closed 6 months ago

pmatulis commented 7 months ago

The accessibility check is applied via the pa11y make target:

pa11y: pa11y-install html
    find $(BUILDDIR) -name *.html -print0 | xargs -n 1 -0 $(PA11Y)

This calls the pa11y-install make target:

pa11y-install:
    @type $(PA11Y) >/dev/null 2>&1 || { \
            echo "Installing \"pa11y\" from npm... \n"; \
            mkdir -p $(SPHINXDIR)/node_modules/ ; \
            npm install --prefix $(SPHINXDIR) pa11y; \
        }

This assumes the npm package manager is available on the host system and will report an error if it is not:

make pa11y
Installing "pa11y" from npm...

/bin/sh: 4: npm: not found
make: *** [Makefile:56: pa11y-install] Error 127

The software should first conduct a check for the presence of npm and, if not found, bail with a user-friendly message. The user needs to do:

sudo apt install npm
akcano commented 6 months ago

@pmatulis I see your point and thought about that, too. However, I have two concerns about such a move:

pmatulis commented 6 months ago

Perhaps this is a documentation fail then. We should specify requirements in the README.

akcano commented 6 months ago

Good point, I'll add a note.

akcano commented 6 months ago

@pmatulis https://github.com/canonical/sphinx-docs-starter-pack/pull/189