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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
|
# SPDX-License-Identifier: MIT OR Apache-2.0
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the MIT License. See the LICENSE file in the root of this
# repository for complete details.
import os
from importlib import metadata
# Set canonical URL from the Read the Docs Domain
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
# Tell Jinja2 templates the build is running on Read the Docs
if os.environ.get("READTHEDOCS", "") == "True":
html_context = {"READTHEDOCS": True}
# We want an image in the README and include the README in the docs.
suppress_warnings = ["image.nonlocal_uri"]
# -- General configuration ----------------------------------------------------
extensions = [
"myst_parser",
"notfound.extension",
"sphinx.ext.autodoc",
"sphinx.ext.autodoc.typehints",
"sphinx.ext.napoleon",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinxext.opengraph",
]
myst_enable_extensions = [
"colon_fence",
"smartquotes",
"deflist",
]
mermaid_init_js = "mermaid.initialize({startOnLoad:true,theme:'neutral'});"
ogp_image = "_static/structlog_logo.png"
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# The suffix of source filenames.
source_suffix = [".rst", ".md"]
# The master toctree document.
master_doc = "index"
# General information about the project.
project = "structlog"
author = "Hynek Schlawack"
copyright = f"2013, {author}"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
# The full version, including alpha/beta/rc tags.
release = metadata.version("structlog")
# The short X.Y version.
version = release.rsplit(".", 1)[0]
if "dev" in release:
release = version = "UNRELEASED"
exclude_patterns = ["_build"]
# The reST default role (used for this markup: `text`) to use for all
# documents.
default_role = "any"
nitpick_ignore = [
("py:class", "Context"),
("py:class", "EventDict"),
("py:class", "ILogObserver"),
("py:class", "PlainFileObserver"),
("py:class", "Processor"),
("py:class", "Styles"),
("py:class", "WrappedLogger"),
("py:class", "structlog.threadlocal.TLLogger"),
("py:class", "structlog.typing.EventDict"),
("py:class", "ModuleType"),
]
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
# Move type hints into the description block, instead of the func definition.
autodoc_typehints = "description"
autodoc_typehints_description_target = "documented"
# -- Options for HTML output --------------------------------------------------
html_theme = "furo"
html_theme_options = {
"top_of_page_buttons": [],
"light_css_variables": {
"font-stack": "B612, sans-serif",
"font-stack--monospace": "BerkeleyMono, MonoLisa, ui-monospace, "
"SFMono-Regular, Menlo, Consolas, Liberation Mono, monospace",
},
}
html_logo = "_static/structlog_logo.svg"
html_static_path = ["_static"]
html_css_files = ["custom.css"]
htmlhelp_basename = "structlogdoc"
latex_documents = [
("index", "structlog.tex", "structlog Documentation", "Author", "manual")
]
# -- Options for manual page output -------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [("index", "structlog", "structlog Documentation", ["Author"], 1)]
# -- Options for Texinfo output -----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(
"index",
"structlog",
"structlog Documentation",
"Author",
"structlog",
"One line description of project.",
"Miscellaneous",
)
]
# -- Options for Epub output --------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = project
epub_author = author
epub_publisher = author
epub_copyright = copyright
# GitHub has rate limits
linkcheck_ignore = [
r"https://github.com/.*/(issues|pull|compare)/\d+",
r"https://twitter.com/.*",
]
# Twisted's trac tends to be slow
linkcheck_timeout = 300
intersphinx_mapping = {
'python': ('/usr/share/doc/python3-doc/html', '/usr/share/doc/python3-doc/html/objects.inv'),
"rich": ("https://rich.readthedocs.io/en/stable/", None),
}
|