Building the Documentation¶
Use Python 3.11 or newer for the pinned documentation toolchain. The library itself supports Python 3.10. From the repository root:
python3 -m venv .venv-docs
source .venv-docs/bin/activate
pip install -r requirements-docs.txt
python -m mkdocs build --strict
python -m mkdocs serve --dev-addr 127.0.0.1:8000
On Windows, activate with .venv-docs\Scripts\Activate.ps1 in PowerShell. Open http://127.0.0.1:8000 while the preview command runs; stop it with Ctrl+C.
Theme and Page Sources¶
The site uses the bundled WaLSAtools theme. Shared CSS is preserved unchanged, with a separate blue accent layer for documentation content. Page navigation uses full document loads to keep the legacy theme’s controls reliable with the current MkDocs build. The homepage uses a white background, dark header text, blue accents, and outlined module cards. Its stylesheet loads only on that page; documentation pages retain the shared dark header and footer. The Python indicator is static.
mkdocs.ymlsets navigation and build options.docs/theme/contains the reference templates, CSS, scripts, icons, and original notices.docs/assets/stylesheets/homepage.csscontrols the homepage;library.cssadds space above page footers, andcontent-accent.csssets the documentation’s blue accents.- Page Markdown is organised under
getting-started/,modules/,examples/,reference/, andabout/. docs/hooks/reference.pygenerates the parameter/default tables from Python source without importing scientific packages.
Repository Examples¶
LineFit pages display the original notebooks’ saved PNG outputs. Their downloadable source is extracted from the code cells without changing the imports or settings. docs/examples/source/linefit-provenance.json records notebook and extract hashes. Each page retains access to the original notebook notices.
The SoFT example uses the upstream synthetic data and tracking settings with the WaLSAlib interface. Its downloadable script is docs/examples/source/soft-basic-usage.py; the original source, provenance record, and GPLv3 license are retained alongside it.
To refresh LineFit extracts after a notebook change, run:
The build checks notebook/source/image hashes so stale extracts are reported. It does not execute notebooks, train models, or retrieve upstream code. Build from a full source checkout containing examples/LineFit_Frontiers/.
Publishing at lib.WaLSA.tools¶
The production address is https://lib.WaLSA.tools/. site_url in mkdocs.yml supplies the canonical address and sitemap URLs. The workflow in .github/workflows/docs.yml builds pull requests and publishes successful builds from main using GitHub Pages. It uses Python 3.12 and the pinned documentation requirements; the scientific dependencies are not needed to build the website.
One-time GitHub and DNS setup¶
- In the WaLSAteam organisation’s Settings → Pages, check whether
WaLSA.toolsis verified. Verification of that domain also coverslib.WaLSA.tools. If necessary, follow GitHub’s domain verification instructions and retain the TXT record GitHub provides. - Open WaLSAteam/WaLSAlib → Settings → Pages and choose GitHub Actions as the publishing source. The repository already supplies its own workflow; no template workflow is needed.
- Set Custom domain to
lib.WaLSA.toolsand save it before configuring DNS. - In Cloudflare, open the DNS records for
WaLSA.toolsand add or update this record:
| Setting | Value |
|---|---|
| Type | CNAME |
| Name | lib |
| Target | WaLSAteam.github.io |
| Proxy status | DNS only (grey cloud) |
| TTL | Auto |
The target is a hostname, without https:// or a repository path. Replace only conflicting records for lib; keep the records serving the existing WaLSAtools website.
5. Check the DNS result and the check in GitHub’s Pages settings. DNS propagation can take up to 24 hours:
The result should point to WaLSAteam.github.io.. Once GitHub has issued the certificate, enable Enforce HTTPS.
The custom domain is configured in GitHub’s repository settings. With this Actions deployment, GitHub does not require a repository CNAME file.
See GitHub’s guides for custom domains, domain verification, and Pages workflows.
Publish the prepared documentation¶
From the source checkout containing these documentation changes, review the files and commit them on the documentation branch:
git status
git add .gitattributes README.md docs mkdocs.yml requirements-docs.txt .github/workflows/docs.yml
git diff --cached --stat
git commit -m "Add WaLSAlib documentation and GitHub Pages deployment"
git push -u origin docs-WaLSAlib
Open a pull request from docs-WaLSAlib into main. The Documentation / Build documentation check must pass. Merge the reviewed pull request, then open the repository’s Actions → Documentation run and check that both the build and publication jobs succeed. If the github-pages environment requires an approval, approve the deployment there. If that environment restricts deployment branches, allow main.
Open https://lib.WaLSA.tools/ and check the homepage, an interior page, a notebook download, and the README’s documentation link. The README screenshot is stored in docs/images/misc/WaLSAlib_documentation_screenshot.png.
Later updates¶
Edit the Markdown, navigation, or theme files, run the strict local build, and submit a pull request. Each merge into main rebuilds and publishes the website. Generated files in site/ remain local and should not be committed. A separate gh-pages branch and a personal access token are not needed.