|
| 1 | +# Configuration file for the Sphinx documentation builder. |
| 2 | +# |
| 3 | +# This file only contains a selection of the most common options. For a full |
| 4 | +# list see the documentation: |
| 5 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html |
| 6 | + |
| 7 | +# -- Path setup -------------------------------------------------------------- |
| 8 | + |
| 9 | +# If extensions (or modules to document with autodoc) are in another directory, |
| 10 | +# add these directories to sys.path here. If the directory is relative to the |
| 11 | +# documentation root, use os.path.abspath to make it absolute, like shown here. |
| 12 | +# |
| 13 | +import os |
| 14 | +import re |
| 15 | +import sys |
| 16 | + |
| 17 | + |
| 18 | +sys.path.insert(0, os.path.abspath("..")) |
| 19 | + |
| 20 | +# -- Project information ----------------------------------------------------- |
| 21 | + |
| 22 | +project = "Mystbin" |
| 23 | +copyright = "2021, Alex Nørgaard" |
| 24 | +author = "Alex Nørgaard" |
| 25 | + |
| 26 | +# The full version, including alpha/beta/rc tags |
| 27 | +version = "" |
| 28 | + |
| 29 | +with open("../mystbin/__init__.py") as f: |
| 30 | + version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1) |
| 31 | + |
| 32 | +release = version |
| 33 | + |
| 34 | + |
| 35 | +# -- General configuration --------------------------------------------------- |
| 36 | + |
| 37 | +# Add any Sphinx extension module names here, as strings. They can be |
| 38 | +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 39 | +# ones. |
| 40 | +extensions = [ |
| 41 | + "sphinx.ext.autodoc", |
| 42 | + "sphinx.ext.extlinks", |
| 43 | + "sphinx.ext.intersphinx", |
| 44 | + "sphinx.ext.napoleon", |
| 45 | + "sphinxcontrib_trio", |
| 46 | +] |
| 47 | + |
| 48 | +# Add any paths that contain templates here, relative to this directory. |
| 49 | +templates_path = ["_templates"] |
| 50 | + |
| 51 | +autodoc_typehints = "none" |
| 52 | + |
| 53 | +# List of patterns, relative to source directory, that match files and |
| 54 | +# directories to ignore when looking for source files. |
| 55 | +# This pattern also affects html_static_path and html_extra_path. |
| 56 | +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] |
| 57 | + |
| 58 | +# Links used for cross-referencing other documentation |
| 59 | +intersphinx_mapping = { |
| 60 | + "py": ("https://docs.python.org/3", None), |
| 61 | + "aio": ("https://docs.aiohttp.org/en/stable/", None), |
| 62 | + "req": ("https://docs.python-requests.org/en/latest/", None), |
| 63 | +} |
| 64 | + |
| 65 | +# Prolog for asynchronous functions |
| 66 | +rst_prolog = """ |
| 67 | +.. |coro| replace:: This function is a |coroutine_link|_. |
| 68 | +.. |maybecoro| replace:: This function *could be a* |coroutine_link|_. |
| 69 | +.. |coroutine_link| replace:: *coroutine* |
| 70 | +.. _coroutine_link: https://docs.python.org/3/library/asyncio-task.html#coroutine |
| 71 | +""" |
| 72 | + |
| 73 | +# -- Options for HTML output ------------------------------------------------- |
| 74 | + |
| 75 | +# The theme to use for HTML and HTML Help pages. See the documentation for |
| 76 | +# a list of builtin themes. |
| 77 | +# |
| 78 | +html_theme = "furo" |
| 79 | + |
| 80 | +# Add any paths that contain custom static files (such as style sheets) here, |
| 81 | +# relative to this directory. They are copied after the builtin static files, |
| 82 | +# so a file named "default.css" will overwrite the builtin "default.css". |
| 83 | +html_static_path = ["_static"] |
0 commit comments