1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# requests-cache documentation build configuration file
import os
import sys
from os.path import abspath, dirname, join
# Add project path
sys.path.insert(0, os.path.abspath('..'))
from requests_cache import __version__ # noqa: E402
PROJECT_DIR = abspath(dirname(dirname(__file__)))
PACKAGE_DIR = join(PROJECT_DIR, 'requests_cache')
# General information about the project.
project = 'requests-cache'
copyright = '2021, Roman Haritonov'
needs_sphinx = '3.0'
master_doc = 'index'
source_suffix = ['.rst', '.md']
version = release = __version__
html_static_path = ['_static']
exclude_patterns = ['_build']
templates_path = ['_templates']
# Sphinx extension modules
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosectionlabel',
'sphinx.ext.extlinks',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx_autodoc_typehints',
'sphinx_copybutton',
'sphinxcontrib.apidoc',
'm2r2',
]
# Exclude auto-generated page for top-level __init__.py
exclude_patterns = ['_build', 'modules/requests_cache.rst']
# Enable automatic links to other projects' Sphinx docs
intersphinx_mapping = {
'boto3': ('https://boto3.amazonaws.com/v1/documentation/api/latest/', None),
'botocore': ('http://botocore.readthedocs.io/en/latest/', None),
'pymongo': ('https://pymongo.readthedocs.io/en/stable/', None),
'python': ('https://docs.python.org/3', None),
'redis': ('https://redis-py.readthedocs.io/en/stable/', None),
'requests': ('https://docs.python-requests.org/en/master/', None),
'urllib3': ('https://urllib3.readthedocs.io/en/latest/', None),
}
extlinks = {
'boto3': ('https://boto3.amazonaws.com/v1/documentation/api/latest/reference/%s', None),
}
# Enable Google-style docstrings
napoleon_google_docstring = True
napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = False
# Strip prompt text when copying code blocks with copy button
copybutton_prompt_text = r'>>> |\.\.\. |\$ '
copybutton_prompt_is_regexp = True
# Use apidoc to auto-generate rst sources
apidoc_module_dir = PACKAGE_DIR
apidoc_output_dir = 'modules'
apidoc_excluded_paths = []
apidoc_module_first = True
apidoc_toc_file = False
autosectionlabel_prefix_document = True
# HTML theme settings
pygments_style = 'sphinx'
html_theme = 'sphinx_rtd_theme'
def setup(app):
"""Run some additional steps after the Sphinx builder is initialized"""
app.add_css_file('collapsible_container.css')
|