HUB
Sign inSign up

spip/docs

By spip

•Updated 3 days ago

Zensical and CI scripts to build and publish SPIP documentation sites

Image
Integration & delivery
Developer tools
0

366

spip/docs repository overview

⁠spip/docs

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⁠

⁠Supported tags

TagsZensicalpymarkdownPython
1, 1.1, 1.1.00.1.40.9.423.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).

⁠What's inside

  • Python (Debian slim image), Zensical, and pymarkdown⁠ to check the Markdown files,
  • a Makefile (/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.

⁠In GitLab CI

Through the spip-docs component of spip-league/gitlab-ci⁠:

include:
  - component: $CI_SERVER_FQDN/spip-league/gitlab-ci/spip-docs@2

⁠Locally

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
TargetDoes
helplists the targets (default)
buildbuilds the site: zensical build --strict
servepreviews the site on port 8000 (publish it with -it -p 8000:8000)
cleanremoves the built site (site/)
lintchecks the Markdown files of docs/ with pymarkdown
lint-fixfixes 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.

Tag summary
Recent tags
Content type
Image
Digest
sha256:91d319f9a…
Size
65.2 MB
Last updated
3 days ago
docker pull spip/docs:1