Skip to content

Commit

Permalink
perf: refer the current deployment plugin
Browse files Browse the repository at this point in the history
Signed-off-by: msclock <[email protected]>
  • Loading branch information
msclock committed Dec 18, 2023
1 parent ef1e172 commit 382c105
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 deletions.
26 changes: 26 additions & 0 deletions docs/api/sphinx_deployment.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
sphinx\_deployment package
==========================

.. automodule:: sphinx_deployment
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

sphinx\_deployment.cli module
-----------------------------

.. automodule:: sphinx_deployment.cli
:members:
:undoc-members:
:show-inheritance:

sphinx\_deployment.sphinx\_setup module
---------------------------------------

.. automodule:: sphinx_deployment.sphinx_setup
:members:
:undoc-members:
:show-inheritance:
5 changes: 5 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
from __future__ import annotations

import importlib.metadata
import sys
from pathlib import Path

sys.path.append(Path("../src").resolve())

project = "sphinx-deployment"
copyright = "2023, msclock"
Expand All @@ -16,6 +20,7 @@
"sphinx_autodoc_typehints",
"sphinx_copybutton",
"sphinx_inline_tabs",
"sphinx_deployment",
]

source_suffix = [".rst", ".md"]
Expand Down
2 changes: 1 addition & 1 deletion src/sphinx_deployment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
from __future__ import annotations

from ._version import version as __version__
from .sphinx_ext import setup
from .sphinx_setup import setup

__all__ = ["__version__", "setup"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,25 @@
from typing import Any

from loguru import logger
from sphinx.application import Sphinx

from ._version import version


def setup(app: Sphinx) -> dict[str, Any]:
def setup(app: Any) -> dict[str, Any]:
"""
A description of the entire function, its parameters, and its return types.
Parameters:
app: The app to set up.
Returns:
A dictionary with version, parallel_read_safe, and parallel_write_safe keys.
"""
logger.info(app.confdir)
logger.info(app.config)

return {
"version": version,
"parallel_read_safe": True,
"parallel_write_safe": True,
}
}

0 comments on commit 382c105

Please sign in to comment.