Automatic checks¶
The starter pack comes with several automatic checks that you can (and should!) run on your documentation before committing and pushing changes.
The following checks are available:
Install prerequisite software¶
Some of the tools used by the automatic checks require npm. Install npm using the appropriate method for your operating system through one of the following methods:
Your preferred package manager
By following the node version manager installation process
For Debian and Ubuntu Linux distributions, the
sudo apt install npmcommand
To install the validation tools:
make pa11y-install
make pymarkdownlnt-install # if using Markdown
Note
pa11y is a non-blocking check in our current documentation workflow.
Default GitHub actions¶
The documentation-checks.yaml
workflow comes from the documentation-workflows repository and supports the
following inputs.
Input |
Description |
Default |
|---|---|---|
|
The root of the documentation project. This input is required. |
None |
|
The Python interpreter to use for the workflow’s jobs. |
|
|
The number of commits to fetch from your repository. |
The full history is fetched. |
|
The host system for the workflow’s runners. |
|
|
The Makefile that checks are invoked from. |
|
|
The make target for installing required tools. |
|
|
The make target to run for the spelling check. |
|
|
The make target to run for the inclusive language check |
|
|
The make target to run for the link check. |
|
The current defaults force usage of Canonical-hosted runners, which some projects
may not be able to use. You may select your own runners by providing a runs-on
value, as shown by line 6 in the following example:
1jobs:
2 documentation-checks:
3 uses: canonical/documentation-workflows/.github/workflows/documentation-checks.yaml@main
4 with:
5 working-directory: "docs"
6 runs-on: "ubuntu-22.04"
Workflow triggers¶
For efficiency, the documentation check workflows are configured to run only when
changes are made to files in the docs/ directory. If your project is structured
differently, or if you want to run the checks on other directories, modify the trigger
paths in the workflow files:
on:
pull_request:
paths:
- 'docs/**' # Only run on changes to the docs directory