plesty docs
Build, preview, and deploy the Sphinx documentation for a Plesty project.
Subcommands
plesty docs serve— local preview with live reloadplesty docs deploy— publish to a remote pages branch
What a build contains
Every PLESTY module — core, device, experiment, analyzer — builds with the
standard Read-the-Docs theme: a sidebar header with the PLESTY mark beside
a pill naming the module type ([tool.plesty] module_type, in its type colour)
and the module name below it, a version picker in the sidebar header once the
module has releases to pick between, a titles-only left navigation tree, and
the shared stylesheet (identifier table columns never wrap; prose columns do).
[mark] (EXPERIMENT)
Perovskite G2 Search
The name is site-name without a leading “Plesty” and without a trailing
type word — the mark and the pill already say them: Plesty Perovskite G2 Search Experiment reads “Perovskite G2 Search”.
Content comes from three sources:
Hand-written pages from the configured docs directory (Markdown via MyST or reStructuredText), ordered by
toc.yamlif present (sphinx-external-toc).Generated API reference (always on):
autoapiscans the project’s packages — including PEP-420 namespace packages such asplesty/<module>— and renders the full module tree underreference/, nested hierarchically in the sidebar. If the project’stoc.yamldoes not place the reference itself, an API Reference entry is appended as the last item of the navigation automatically. Directories listed inapi-ignoreare skipped.Generated device reference (device modules): the pages under
docs/_generated/— Usage, Parameters, Functions, Standard Methods — are rendered from the device’s livedoc_model()and wired into the toc automatically; no hand-written reference content is needed.
serve
plesty docs serve [--dev-addr IP:PORT]
Starts a local web server that renders the project documentation and automatically reloads
whenever a .md or .rst file changes. Useful during active documentation writing.
Options
Option |
Default |
Description |
|---|---|---|
|
|
Host and port for the preview server |
Example
# Default address
plesty docs serve
# Listen on all interfaces at a custom port
plesty docs serve --dev-addr 0.0.0.0:9000
Press Ctrl+C to stop the server.
deploy
plesty docs deploy REMOTE_URL TARGET_BRANCH (--release | --latest)
Builds the Sphinx documentation and pushes it to TARGET_BRANCH on the repository at
REMOTE_URL, suitable for GitLab Pages. The branch is created as an orphan if it does not
yet exist.
--release and --latest are mutually exclusive and one is required:
Flag |
Behaviour |
|---|---|
|
Publishes to |
|
Publishes to |
Example
# Deploy development snapshot (latest)
plesty docs deploy \
https://oauth2:${CI_BOT_TOKEN}@gitlab.com/plesty/my-device.git \
docs-build \
--latest
# Deploy a versioned release
plesty docs deploy \
https://oauth2:${CI_BOT_TOKEN}@gitlab.com/plesty/my-device.git \
docs-build \
--release
In practice this command is called by the hub-deploy-docs job of the plesty-standard-ci
component and does not need to be run manually.
Configuration — [tool.plesty.docs]
All keys are optional and live in the project’s pyproject.toml:
Key |
Default |
Meaning |
|---|---|---|
|
|
Module name shown under the mark (a leading “Plesty” and a trailing type word are dropped) |
|
|
Directory containing the documentation sources |
|
|
External toc file inside |
|
|
Top-level package directories excluded from the API scan (e.g. a deprecated compat shim) |
The API reference itself is always generated (no switch); a project controls
its sidebar position by placing a reference/… entry in toc.yaml, and its
scope via api-ignore.
Example (plesty-lib):
[tool.plesty.docs]
site-name = "LIB"
docs-dir = "docs"
api-ignore = ["plestylib"]