| 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 sys |
| 15 |
import re |
| 16 |
|
| 17 |
sys.path.insert(0, os.path.abspath('../..')) |
| 18 |
|
| 19 |
PROJECT_ROOT = os.path.dirname(__file__) |
| 20 |
# Get the version |
| 21 |
version_regex = r'__version__ = ["\']([^"\']*)["\']' |
| 22 |
with open(os.path.join(PROJECT_ROOT, '../../', 'src/h2/__init__.py')) as file_: |
| 23 |
text = file_.read() |
| 24 |
match = re.search(version_regex, text) |
| 25 |
version = match.group(1) |
| 26 |
|
| 27 |
|
| 28 |
# -- Project information ----------------------------------------------------- |
| 29 |
|
| 30 |
project = 'hyper-h2' |
| 31 |
copyright = '2020, Cory Benfield' |
| 32 |
author = 'Cory Benfield' |
| 33 |
release = version |
| 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.intersphinx', |
| 43 |
'sphinx.ext.viewcode', |
| 44 |
] |
| 45 |
|
| 46 |
# Add any paths that contain templates here, relative to this directory. |
| 47 |
templates_path = ['_templates'] |
| 48 |
|
| 49 |
# List of patterns, relative to source directory, that match files and |
| 50 |
# directories to ignore when looking for source files. |
| 51 |
# This pattern also affects html_static_path and html_extra_path. |
| 52 |
exclude_patterns = [] |
| 53 |
|
| 54 |
# Example configuration for intersphinx: refer to the Python standard library. |
| 55 |
intersphinx_mapping = { |
| 56 |
'python': ('https://docs.python.org/', None), |
| 57 |
'hpack': ('https://hpack.readthedocs.io/en/stable/', None), |
| 58 |
'pyopenssl': ('https://pyopenssl.readthedocs.org/en/latest/', None), |
| 59 |
} |
| 60 |
|
| 61 |
master_doc = 'index' |
| 62 |
|
| 63 |
|
| 64 |
# -- Options for HTML output ------------------------------------------------- |
| 65 |
|
| 66 |
# The theme to use for HTML and HTML Help pages. See the documentation for |
| 67 |
# a list of builtin themes. |
| 68 |
# |
| 69 |
html_theme = 'default' |
| 70 |
|
| 71 |
# Add any paths that contain custom static files (such as style sheets) here, |
| 72 |
# relative to this directory. They are copied after the builtin static files, |
| 73 |
# so a file named "default.css" will overwrite the builtin "default.css". |
| 74 |
html_static_path = ['_static'] |