diff --git a/docs/conf.py b/docs/conf.py index 7637087b..876ed962 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -8,35 +8,33 @@ from pathlib import Path from setuptools_scm import get_version - from sphinx.application import Sphinx from sphinx.util.docutils import SphinxDirective from myst_parser import __version__ - # -- Path setup -------------------------------------------------------------- PROJECT_ROOT_DIR = Path(__file__).parents[1].resolve() # pylint: disable=no-member get_scm_version = partial(get_version, root=PROJECT_ROOT_DIR) # -- Project information ----------------------------------------------------- -github_url = 'https://github.com' -github_repo_org = 'ansible' -github_repo_name = 'ansible-language-server' -github_repo_slug = f'{github_repo_org}/{github_repo_name}' -github_repo_url = f'{github_url}/{github_repo_slug}' -github_sponsors_url = f'{github_url}/sponsors' +github_url = "https://github.com" +github_repo_org = "ansible" +github_repo_name = "ansible-language-server" +github_repo_slug = f"{github_repo_org}/{github_repo_name}" +github_repo_url = f"{github_url}/{github_repo_slug}" +github_sponsors_url = f"{github_url}/sponsors" project = "MyST Parser" copyright = "2020, Executable Book Project" author = "Executable Book Project" # The short X.Y version -version = '.'.join( - get_scm_version( - local_scheme='no-local-version', - ).split('.')[:3], +version = ".".join( + get_scm_version(local_scheme="no-local-version",).split( + "." + )[:3], ) # The full version, including alpha/beta/rc tags @@ -54,7 +52,7 @@ extensions = [ "myst_parser", "sphinx.ext.autodoc", - 'sphinx.ext.extlinks', + "sphinx.ext.extlinks", "sphinx.ext.intersphinx", "sphinx.ext.viewcode", "sphinxcontrib.bibtex", @@ -62,7 +60,7 @@ "sphinxext.rediraffe", "sphinxcontrib.mermaid", "sphinxext.opengraph", - 'sphinxcontrib.towncrier', # provides `towncrier-draft-entries` directive + "sphinxcontrib.towncrier", # provides `towncrier-draft-entries` directive ] # Add any paths that contain templates here, relative to this directory. @@ -72,8 +70,10 @@ # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. exclude_patterns = [ - "_build", "Thumbs.db", ".DS_Store", - 'changelog-fragments.d/**', # Towncrier-managed change notes + "_build", + "Thumbs.db", + ".DS_Store", + "changelog-fragments.d/**", # Towncrier-managed change notes ] @@ -121,10 +121,10 @@ "tasklist", ] myst_substitutions = { - 'project': project, - 'release': release, - 'release_l': f'`{release}`', # Needed in draft changelog for spelling ext - 'version': version, + "project": project, + "release": release, + "release_l": f"`{release}`", # Needed in draft changelog for spelling ext + "version": version, } myst_heading_anchors = 2 myst_footnote_transition = True @@ -142,7 +142,7 @@ # -- Options for towncrier_draft extension ----------------------------------- -towncrier_draft_autoversion_mode = 'draft' # or: 'sphinx-version', 'sphinx-release' +towncrier_draft_autoversion_mode = "draft" # or: 'sphinx-version', 'sphinx-release' towncrier_draft_include_empty = True towncrier_draft_working_directory = PROJECT_ROOT_DIR # Not yet supported: towncrier_draft_config_path = 'pyproject.toml' # relative to cwd @@ -186,11 +186,11 @@ def run_apidoc(app): # -- Options for extlinks extension ------------------------------------------ extlinks = { - 'issue': (f'{github_repo_url}/issues/%s', '#'), # noqa: WPS323 - 'pr': (f'{github_repo_url}/pull/%s', 'PR #'), # noqa: WPS323 - 'commit': (f'{github_repo_url}/commit/%s', ''), # noqa: WPS323 - 'gh': (f'{github_url}/%s', 'GitHub: '), # noqa: WPS323 - 'user': (f'{github_sponsors_url}/%s', '@'), # noqa: WPS323 + "issue": (f"{github_repo_url}/issues/%s", "#"), # noqa: WPS323 + "pr": (f"{github_repo_url}/pull/%s", "PR #"), # noqa: WPS323 + "commit": (f"{github_repo_url}/commit/%s", ""), # noqa: WPS323 + "gh": (f"{github_url}/%s", "GitHub: "), # noqa: WPS323 + "user": (f"{github_sponsors_url}/%s", "@"), # noqa: WPS323 } intersphinx_mapping = {