|
| 1 | +"""Documentation configuration for `pyscript-cli`.""" |
| 2 | +from __future__ import annotations |
| 3 | + |
| 4 | +import sys |
| 5 | +from datetime import datetime |
| 6 | +from pathlib import Path |
| 7 | + |
| 8 | +import toml |
| 9 | + |
| 10 | +# Ensure the package is in the path |
| 11 | +project_root = Path(__file__).parents[2] |
| 12 | +sys.path.insert(0, (project_root / "src").as_posix()) |
| 13 | + |
| 14 | +# General information about the project. |
| 15 | +project = "pyscript-cli" |
| 16 | +author = "Anaconda" |
| 17 | +copyright = f"2022 - {datetime.now().year}, {author}" |
| 18 | + |
| 19 | +# Load the package version from pyproject.toml |
| 20 | +with (project_root / "pyproject.toml").open("r") as fp: |
| 21 | + version = toml.load(fp)["tool"]["poetry"]["version"] |
| 22 | + release = version |
| 23 | + |
| 24 | + |
| 25 | +# Add any Sphinx extension module names here, as strings. They can be |
| 26 | +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 27 | +# ones. |
| 28 | +extensions = [ |
| 29 | + "myst_parser", |
| 30 | + "sphinx.ext.doctest", |
| 31 | + "sphinx.ext.intersphinx", |
| 32 | + "sphinx.ext.coverage", |
| 33 | + "sphinx.ext.mathjax", |
| 34 | + "sphinx.ext.autodoc", |
| 35 | + "sphinx.ext.napoleon", |
| 36 | + "sphinx.ext.viewcode", |
| 37 | + "sphinx_autodoc_typehints", |
| 38 | +] |
| 39 | + |
| 40 | +# Add any paths that contain templates here, relative to this directory. |
| 41 | +templates_path = ["_templates"] |
| 42 | +exclude_patterns: list[str] = [] |
| 43 | + |
| 44 | +# The suffix(es) of source filenames. |
| 45 | +source_suffix = [".rst", ".md"] |
| 46 | + |
| 47 | +# The master toctree document. |
| 48 | +master_doc = "index" |
| 49 | + |
| 50 | +# The name of the Pygments (syntax highlighting) style to use. |
| 51 | +pygments_style = "sphinx" |
| 52 | + |
| 53 | +autodoc_default_options = { |
| 54 | + "members": None, |
| 55 | + "undoc-members": None, |
| 56 | + "show-inheritance": None, |
| 57 | +} |
| 58 | + |
| 59 | +# The theme to use for HTML and HTML Help pages. |
| 60 | +html_theme = "pydata_sphinx_theme" |
| 61 | +# html_logo = "_static/avatar.jpeg" |
| 62 | +html_favicon = "_static/avatar.jpeg" |
| 63 | +html_theme_options = { |
| 64 | + "github_url": "https://github.com/pyscript/pyscript-cli", |
| 65 | + "icon_links": [ |
| 66 | + { |
| 67 | + "name": "PyPI", |
| 68 | + "url": "https://pypi.org/project/pyscript-cli", |
| 69 | + "icon": "fas fa-box", |
| 70 | + }, |
| 71 | + ], |
| 72 | +} |
| 73 | +html_static_path = ["_static"] |
0 commit comments