plesty.sdk.commands.docs
CLI commands for previewing and deploying Sphinx documentation pages.
Submodules
Attributes
Decorator to pass the application context to a Click command as the first argument. |
Classes
Container class for storing data shared across multiple commands. |
Functions
|
Build and push the documentation pages for the Plesty project in the |
|
Start a local development webserver to preview the documentation pages |
|
Preview and deploy documentation pages. |
Package Contents
- plesty.sdk.commands.docs.deploy_command(context: plesty.sdk.context.ApplicationContext, remote_url: str, target_branch: str, release: bool) None
Build and push the documentation pages for the Plesty project in the current working directory to the <TARGET_BRANCH> of the repository at <REMOTE_URL>. The branch is created if it does not yet exist.
- Parameters:
context (plesty.sdk.context.ApplicationContext)
remote_url (str)
target_branch (str)
release (bool)
- Return type:
None
- plesty.sdk.commands.docs.serve_command(context: plesty.sdk.context.ApplicationContext, dev_addr: str) None
Start a local development webserver to preview the documentation pages for the Plesty project in the current working directory. Changes to the .md or .rst files are applied immediately via live reload.
- Parameters:
context (plesty.sdk.context.ApplicationContext)
dev_addr (str)
- Return type:
None
- class plesty.sdk.commands.docs.ApplicationContext(project_dir: pathlib.Path, quiet: bool = False)
Container class for storing data shared across multiple commands.
Initialize the application context with option values from the top-level ‘plesty’ command and populate property backing fields.
- Parameters:
project_dir (pathlib.Path) – The path to the directory of the target Python project, supplied via the –project-dir option.
quiet (bool) – Suppress progress and guidance output, supplied via the –quiet option.
- project_directory: pathlib.Path
The path to the directory of the target Python project.
- quiet: bool
Suppress progress and guidance output; failures and results still print.
- _pyproject_toml: dict[str, Any] | None
- _docs_settings: DocumentationSettings | None
- property pyproject_toml: dict[str, Any]
The parsed content of the pyproject.toml file of the target Python project.
- Return type:
dict[str, Any]
- property docs_settings: DocumentationSettings
The documentation settings read from the pyproject.toml file.
- Return type:
- ensure_docs_index() None
Ensure that the docs directory exists and contains an index.md or index.rst file, as well as the external TOC file, if specified in the documentation settings.
- Raises:
click.ClickException – If a required file is missing.
- Return type:
None
- plesty.sdk.commands.docs.pass_app_context
Decorator to pass the application context to a Click command as the first argument.
- plesty.sdk.commands.docs.docs_command(context: plesty.sdk.context.ApplicationContext) None
Preview and deploy documentation pages.
- Parameters:
context (plesty.sdk.context.ApplicationContext)
- Return type:
None