Skip to content

Building the documentation#

The Webhooks documentation is built with Zensical. Its configuration remains in mkdocs.yml, following Zensical's migration guide. Markdown pages live in docs/, and the generated website is written to site/.

Install the documentation tools#

Use Python 3.11 or later. From the Webhooks module directory, create a virtual environment and install the version shared with CI:

1
2
python3 -m venv .venv-docs
.venv-docs/bin/python -m pip install -r requirements-docs.txt

The documentation dependencies are independent of Drupal and Composer.

Preview changes#

1
.venv-docs/bin/zensical serve

Open http://localhost:8000. Zensical rebuilds the preview as you edit pages.

Add new pages to nav in mkdocs.yml so readers can find them. The configuration uses Zensical's classic theme variant, retaining the existing navigation, light and dark palettes, logo styling, code highlighting, and Markdown extensions.

Check a production build#

1
.venv-docs/bin/zensical build --clean --strict

This is the same build command used in CI. Strict mode fails the build on warnings, including invalid documentation links. Do not commit site/, .cache/, or the virtual environment.

CI and publishing#

The documentation job automatically builds documentation changes in merge requests. Its site artifact can be downloaded for inspection; this job does not publish the production website.

The pages job uses the same dependencies and build command. It publishes documentation changes pushed to the project's default branch at https://project.pages.drupalcode.org/webhooks/. Changes to the configuration, documentation dependencies, CI definition, or project logo also trigger a build. Other release branches receive validation builds in merge requests but do not replace the production Pages site.

In an issue fork, a manual Pages job provides a preview. Set SKIP_PAGES=1 to skip documentation jobs. To rebuild the default branch without a source change, select the default branch when starting a manual or scheduled pipeline with _PAGES_FORCE_REBUILD=1.

Update Zensical#

Change the pinned version in requirements-docs.txt, reinstall the documentation dependencies, and run a clean strict build. Review representative pages, code blocks, navigation, search, and both color palettes before submitting the change.

The Drupal CI template still provides a MkDocs-based Pages job. The project overrides its builder, artifact directory, and rules in .gitlab-ci.yml so that all documentation builds use Zensical and the same dependency file.