| 1 |
# Configuration file for the Sphinx documentation builder. |
| 2 |
# |
| 3 |
# This file does only contain a selection of the most common options. For a |
| 4 |
# full list see the documentation: |
| 5 |
# http://www.sphinx-doc.org/en/master/config |
| 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 |
from pathlib import Path |
| 16 |
|
| 17 |
sys.path.insert(0, str(Path(__file__).parent.parent)) |
| 18 |
|
| 19 |
from url_matcher import __version__ |
| 20 |
|
| 21 |
# -- Project information ----------------------------------------------------- |
| 22 |
|
| 23 |
project = "url-matcher" |
| 24 |
copyright = "2021, Zyte" |
| 25 |
author = "Zyte" |
| 26 |
|
| 27 |
# The short X.Y version |
| 28 |
version = "" |
| 29 |
# The full version, including alpha/beta/rc tags |
| 30 |
release = __version__.__version__ |
| 31 |
|
| 32 |
|
| 33 |
# -- General configuration --------------------------------------------------- |
| 34 |
|
| 35 |
# If your documentation needs a minimal Sphinx version, state it here. |
| 36 |
# |
| 37 |
# needs_sphinx = '1.0' |
| 38 |
|
| 39 |
# Add any Sphinx extension module names here, as strings. They can be |
| 40 |
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 41 |
# ones. |
| 42 |
extensions = [ |
| 43 |
"sphinx.ext.autodoc", |
| 44 |
"sphinx.ext.intersphinx", |
| 45 |
"sphinx.ext.ifconfig", |
| 46 |
"sphinx.ext.viewcode", |
| 47 |
"sphinx.ext.githubpages", |
| 48 |
"sphinx.ext.autosummary", |
| 49 |
] |
| 50 |
|
| 51 |
# Add any paths that contain templates here, relative to this directory. |
| 52 |
templates_path = ["_templates"] |
| 53 |
|
| 54 |
# The suffix(es) of source filenames. |
| 55 |
# You can specify multiple suffix as a list of string: |
| 56 |
# |
| 57 |
# source_suffix = ['.rst', '.md'] |
| 58 |
source_suffix = {".rst": "restructuredtext"} |
| 59 |
|
| 60 |
# The master toctree document. |
| 61 |
master_doc = "index" |
| 62 |
|
| 63 |
# The language for content autogenerated by Sphinx. Refer to documentation |
| 64 |
# for a list of supported languages. |
| 65 |
# |
| 66 |
# This is also used if you do content translation via gettext catalogs. |
| 67 |
# Usually you set "language" from the command line for these cases. |
| 68 |
language = "en" |
| 69 |
|
| 70 |
# List of patterns, relative to source directory, that match files and |
| 71 |
# directories to ignore when looking for source files. |
| 72 |
# This pattern also affects html_static_path and html_extra_path. |
| 73 |
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] |
| 74 |
|
| 75 |
# The name of the Pygments (syntax highlighting) style to use. |
| 76 |
pygments_style = None |
| 77 |
|
| 78 |
|
| 79 |
# -- Options for HTML output ------------------------------------------------- |
| 80 |
|
| 81 |
# The theme to use for HTML and HTML Help pages. See the documentation for |
| 82 |
# a list of builtin themes. |
| 83 |
# |
| 84 |
html_theme = "sphinx_rtd_theme" |
| 85 |
|
| 86 |
# Theme options are theme-specific and customize the look and feel of a theme |
| 87 |
# further. For a list of options available for each theme, see the |
| 88 |
# documentation. |
| 89 |
# |
| 90 |
# html_theme_options = {} |
| 91 |
|
| 92 |
# Add any paths that contain custom static files (such as style sheets) here, |
| 93 |
# relative to this directory. They are copied after the builtin static files, |
| 94 |
# so a file named "default.css" will overwrite the builtin "default.css". |
| 95 |
# html_static_path = ['_static'] |
| 96 |
|
| 97 |
# Custom sidebar templates, must be a dictionary that maps document names |
| 98 |
# to template names. |
| 99 |
# |
| 100 |
# The default sidebars (for documents that don't match any pattern) are |
| 101 |
# defined by theme itself. Builtin themes are using these templates by |
| 102 |
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', |
| 103 |
# 'searchbox.html']``. |
| 104 |
# |
| 105 |
# html_sidebars = {} |
| 106 |
|
| 107 |
|
| 108 |
# -- Options for HTMLHelp output --------------------------------------------- |
| 109 |
|
| 110 |
# Output file base name for HTML help builder. |
| 111 |
htmlhelp_basename = "url-matcher-doc" |
| 112 |
|
| 113 |
|
| 114 |
# -- Options for LaTeX output ------------------------------------------------ |
| 115 |
|
| 116 |
latex_elements: dict = { |
| 117 |
# The paper size ('letterpaper' or 'a4paper'). |
| 118 |
# |
| 119 |
# 'papersize': 'letterpaper', |
| 120 |
# The font size ('10pt', '11pt' or '12pt'). |
| 121 |
# |
| 122 |
# 'pointsize': '10pt', |
| 123 |
# Additional stuff for the LaTeX preamble. |
| 124 |
# |
| 125 |
# 'preamble': '', |
| 126 |
# Latex figure (float) alignment |
| 127 |
# |
| 128 |
# 'figure_align': 'htbp', |
| 129 |
} |
| 130 |
|
| 131 |
# Grouping the document tree into LaTeX files. List of tuples |
| 132 |
# (source start file, target name, title, |
| 133 |
# author, documentclass [howto, manual, or own class]). |
| 134 |
latex_documents = [ |
| 135 |
( |
| 136 |
master_doc, |
| 137 |
"url-matcher.tex", |
| 138 |
"url-matcher Documentation", |
| 139 |
"Zyte", |
| 140 |
"manual", |
| 141 |
), |
| 142 |
] |
| 143 |
|
| 144 |
|
| 145 |
# -- Options for manual page output ------------------------------------------ |
| 146 |
|
| 147 |
# One entry per manual page. List of tuples |
| 148 |
# (source start file, name, description, authors, manual section). |
| 149 |
man_pages = [(master_doc, "url-matcher", "url-matcher Documentation", [author], 1)] |
| 150 |
|
| 151 |
|
| 152 |
# -- Options for Texinfo output ---------------------------------------------- |
| 153 |
|
| 154 |
# Grouping the document tree into Texinfo files. List of tuples |
| 155 |
# (source start file, target name, title, author, |
| 156 |
# dir menu entry, description, category) |
| 157 |
texinfo_documents = [ |
| 158 |
( |
| 159 |
master_doc, |
| 160 |
"url-matcher", |
| 161 |
"url-matcher Documentation", |
| 162 |
author, |
| 163 |
"url-matcher", |
| 164 |
"URL matching rules library to connect URLs with resources", |
| 165 |
"Miscellaneous", |
| 166 |
), |
| 167 |
] |
| 168 |
|
| 169 |
|
| 170 |
# -- Options for Epub output ------------------------------------------------- |
| 171 |
|
| 172 |
# Bibliographic Dublin Core info. |
| 173 |
epub_title = project |
| 174 |
|
| 175 |
# The unique identifier of the text. This can be a ISBN number |
| 176 |
# or the project homepage. |
| 177 |
# |
| 178 |
# epub_identifier = '' |
| 179 |
|
| 180 |
# A unique identification for the text. |
| 181 |
# |
| 182 |
# epub_uid = '' |
| 183 |
|
| 184 |
# A list of files that should not be packed into the epub file. |
| 185 |
epub_exclude_files = ["search.html"] |
| 186 |
|
| 187 |
|
| 188 |
# -- Extension configuration ------------------------------------------------- |
| 189 |
|
| 190 |
# -- Options for intersphinx extension --------------------------------------- |
| •191 |
def check_object_path(key, url, path): |
| 192 |
if path and os.path.isfile(path): |
| 193 |
return {key: (url, path)} |
| 194 |
return {} |
| 195 |
|
| 196 |
intersphinx_mapping = {} |
| 197 |
intersphinx_mapping.update( |
| 198 |
check_object_path( |
| 199 |
"python", |
| 200 |
"https://docs.python.org/3", |
| •201 |
"/usr/share/doc/python%d.%d/html/objects.inv" % sys.version_info[:2], |
| 202 |
) |
| •203 |
) |
| 204 |
|
| 205 |
autodoc_default_options = { |
| 206 |
"special-members": "__init__,__call__", |
| 207 |
"undoc-members": True, |
| 208 |
} |
| 209 |
|
| 210 |
add_module_names = False |
| 211 |
autosummary_generate = True |