plesty.sdk.context ================== .. py:module:: plesty.sdk.context .. autoapi-nested-parse:: Cross-command context management. Attributes ---------- .. autoapisummary:: plesty.sdk.context.pass_app_context Classes ------- .. autoapisummary:: plesty.sdk.context.DocumentationSettings plesty.sdk.context.ApplicationContext Module Contents --------------- .. py:class:: DocumentationSettings(project_directory: pathlib.Path, pyproject_toml: dict[str, Any]) Settings for generating the documentation pages, which can be configured in the pyproject.toml file. Read the documentation settings specified by the user in the [tool.plesty.docs] section of the pyproject.toml file and set default values for missing settings. :param project_directory: The path to the Python project directory. :param pyproject_toml: The parsed content of the pyproject.toml file. .. py:attribute:: site_name :type: str The title of the website present on each page next to the Plesty logo. .. py:attribute:: project_directory :type: str The path to the project directory (the autoapi package scan root). .. py:attribute:: docs_dir :type: str The directory containing the .md or .rst files to generate the documentation from. .. py:attribute:: api_ignore :type: list[str] Top-level package directory names excluded from the API reference scan. .. py:attribute:: toc_file :type: str | None The path to the external TOC file. .. py:attribute:: module_type :type: str | None The plesty module type (``device``/``experiment``/…), or ``None``. .. py:class:: 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. :param project_dir: The path to the directory of the target Python project, supplied via the --project-dir option. :param quiet: Suppress progress and guidance output, supplied via the --quiet option. .. py:attribute:: project_directory :type: pathlib.Path The path to the directory of the target Python project. .. py:attribute:: quiet :type: bool Suppress progress and guidance output; failures and results still print. .. py:attribute:: _pyproject_toml :type: dict[str, Any] | None .. py:attribute:: _docs_settings :type: DocumentationSettings | None .. py:property:: pyproject_toml :type: dict[str, Any] The parsed content of the pyproject.toml file of the target Python project. .. py:property:: docs_settings :type: DocumentationSettings The documentation settings read from the pyproject.toml file. .. py:method:: 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. .. py:data:: pass_app_context Decorator to pass the application context to a Click command as the first argument.