Zensical and CI scripts to build and publish SPIP documentation sites
366
Documentation container for SPIP projects: Zensical, the scripts of the
spip-docs GitLab CI component, which builds documentation sites and publishes them on GitLab Pages
(pages.spip.net), and a Makefile to build, preview and check a documentation locally.
Source, issues and build script: github.com/spip-remix/docker
| Tags | Zensical | pymarkdown | Python |
|---|---|---|---|
1, 1.1, 1.1.0 | 0.1.4 | 0.9.42 | 3.15 |
The tag is the version of the image: a new Zensical version or a change in the scripts makes a new
image version. The versions of Zensical, pymarkdown and Python are also in the image labels
(net.spip.docs.zensical, net.spip.docs.pymarkdown, net.spip.docs.python).
/Makefile) for local use, see below,spip-docs-check-head: exits with code 75 when the commit of the pipeline is no longer the head of
the default branch, so that an older pipeline does not overwrite the site of a newer one,spip-docs-assemble: assembles the documentation of several branches into one site, with
versions.json for the version selector of the theme, a redirection and a 404 page at the root,spip-docs-publish: triggers a pipeline on the default branch, to republish the site after a change
in the documentation of another branch.The scripts read the GitLab CI predefined variables (CI_*) and the SPIP_DOCS_* variables set by
the component. The container runs as root in /build/app, like the Python image.
Through the spip-docs component of spip-league/gitlab-ci:
include:
- component: $CI_SERVER_FQDN/spip-league/gitlab-ci/spip-docs@2
Mount your project in /build/app, and give the targets of the Makefile:
docker run --rm -v "$(pwd)":/build/app spip/docs:1 # list of the targets
docker run --rm -v "$(pwd)":/build/app spip/docs:1 build # same check as the CI
docker run --rm -it -p 8000:8000 -v "$(pwd)":/build/app spip/docs:1 serve # http://localhost:8000/
docker run --rm -v "$(pwd)":/build/app spip/docs:1 lint # check the Markdown files
| Target | Does |
|---|---|
help | lists the targets (default) |
build | builds the site: zensical build --strict |
serve | previews the site on port 8000 (publish it with -it -p 8000:8000) |
clean | removes the built site (site/) |
lint | checks the Markdown files of docs/ with pymarkdown |
lint-fix | fixes what pymarkdown can fix, then checks again |
Variables: CONFIG (configuration file of Zensical, zensical.toml by default), DOCS (Markdown
files, docs), SITE (built site, site), for example spip/docs:1 CONFIG=zensical-fr.toml build.
lint uses the .pymarkdown.json of the project, or a default of the image (lines of 160 characters,
code blocks and HTML allowed).
The commands of the image still work as in version 1.0: spip/docs:1 zensical build --strict.
Local shortcut:
alias spip-docs='docker run --rm -it -p 8000:8000 -v "$(pwd)":/build/app spip/docs:1'
spip-docs build lint # same checks as the CI, and the Markdown files
spip-docs serve # preview on http://localhost:8000/
Add it to your ~/.zshrc or ~/.bashrc to keep it.
docker pull spip/docs:1