| 1 | # noqa: INP001, D100 |
| 2 | # Configuration file for the Sphinx documentation builder. |
| 3 | # |
| 4 | # For the full list of built-in configuration values, see the documentation: |
| 5 | # https://www.sphinx-doc.org/en/master/usage/configuration.html |
| 6 | |
| 7 | # -- Project information ----------------------------------------------------- |
| 8 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information |
| 9 | |
| 10 | import pathlib |
| 11 | import sys |
| 12 | |
| 13 | DOC_ROOT = pathlib.Path(__file__).parent |
| 14 | PROJECT_ROOT = DOC_ROOT.parent |
| 15 | |
| 16 | # If extensions (or modules to document with autodoc) are in another directory, |
| 17 | # add these directories to sys.path here. If the directory is relative to the |
| 18 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
| 19 | sys.path.insert(0, str(PROJECT_ROOT)) |
| 20 | from fastkml import about # noqa: E402 |
| 21 | |
| 22 | # General information about the project. |
| 23 | project = "FastKML" |
| 24 | copyright = "2014 -2024, Christian Ledermann & Ian Lee" # noqa: A001 |
| 25 | author = "Christian Ledermann" |
| 26 | # The short X.Y version. |
| 27 | version = ".".join(about.__version__.split(".")[:2]) |
| 28 | # The full version, including alpha/beta/rc tags. |
| 29 | release = about.__version__ |
| 30 | |
| 31 | # -- General configuration --------------------------------------------------- |
| 32 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration |
| 33 | |
| 34 | extensions = [ |
| 35 | "sphinx.ext.autodoc", |
| 36 | "sphinx.ext.doctest", |
| 37 | "sphinx.ext.napoleon", |
| 38 | "sphinx.ext.autosummary", |
| 39 | "sphinx.ext.coverage", |
| 40 | "sphinx.ext.viewcode", |
| 41 | ] |
| 42 | autosummary_generate = True |
| 43 | |
| 44 | |
| 45 | templates_path = ["_templates"] |
| 46 | exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] |
| 47 | |
| 48 | root_doc = "index" |
| 49 | |
| 50 | |
| 51 | # -- Options for HTML output ------------------------------------------------- |
| 52 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output |
| 53 | |
| 54 | # The name of the Pygments (syntax highlighting) style to use. |
| 55 | pygments_style = "sphinx" |
| 56 | |
| 57 | html_theme = "alabaster" |
| 58 | html_static_path = ["_static"] |
| 59 | try: |
| 60 | import sphinx_rtd_theme |
| 61 | |
| 62 | html_theme = "sphinx_rtd_theme" |
| 63 | html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] |
| 64 | except ImportError: |
| 65 | pass |
| 66 | |
| 67 | html_context = { |
| 68 | "display_github": True, # Integrate GitHub |
| 69 | "github_user": "cleder", # Username |
| 70 | "github_repo": "fastkml", # Repo name |
| 71 | "github_version": "main", # Version |
| 72 | "conf_py_path": "/docs/", # Path in the checkout to the docs root |
| 73 | } |