plesty.sdk.commands.docs.deploy =============================== .. py:module:: plesty.sdk.commands.docs.deploy .. autoapi-nested-parse:: The plesty docs deploy command. Attributes ---------- .. autoapisummary:: plesty.sdk.commands.docs.deploy.RELEASE_TAG Functions --------- .. autoapisummary:: plesty.sdk.commands.docs.deploy.deploy_command plesty.sdk.commands.docs.deploy.run_git plesty.sdk.commands.docs.deploy.version_tuple plesty.sdk.commands.docs.deploy.write_redirect plesty.sdk.commands.docs.deploy.update_versions_json Module Contents --------------- .. py:data:: RELEASE_TAG .. py:function:: 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 of the repository at . The branch is created if it does not yet exist. .. py:function:: run_git(args: list[str], expected_exit_codes: set[int] = {0}) -> int Run a git command in the current working directory. :param args: The arguments and flags to be passed to the git command. :param expected_exit_codes: Exit codes that should not raise an exception. :returns: The exit code of the git command. :raises click.ClickException: If the exit code is not in `expected_exit_codes`. .. py:function:: version_tuple(version_tag: str) -> tuple[int, int] Parse a version tag into a tuple of the form (major, minor). :param version_tag: The version tag to be parsed in 'major.minor' format. :returns: Version tuple of the form (major, minor) as integers. .. py:function:: write_redirect(path: str, target: str) -> None Write an HTML stub that forwards a directory index to `target`. A meta refresh rather than a script: the stubs sit at the entry points a reader reaches first, and they have to work before — and without — any JavaScript. :param path: The file to write. :param target: The redirect target, relative to the stub's own directory. .. py:function:: update_versions_json(html_dir: str, new_version_tag: str | None) -> list[str] Rewrite the manifest the sidebar version picker reads, plus the two redirect stubs that point a bare directory URL at a real page. Every entry's URL is relative to `html_dir`, the module root — the picker resolves them against that root, which is // on docs.plesty.net and /// on GitLab Pages. Releases are listed newest first, below the latest development docs. Both deploy modes call this. A release adds its own entry; a latest deploy adds none but still refreshes the manifest, which is how modules that have never been tagged get a picker at all, and how branches written by an older SDK pick up the current format. A release whose pages cannot show the picker is published and reachable by URL, but is left out of the manifest: advertising a version the reader cannot switch back out of is worse than not offering it. :param html_dir: The module root, containing latest/ and releases/. :param new_version_tag: The release tag to add in 'major.minor' format, or None when deploying the latest development docs. :returns: The release tags left out of the manifest, in descending order.