Skip to content
Myr

conf.py

This file

Path

docs/conf.py

97 lines · 3.2 KiB · Python

Last changed by

Merge branch '3.0.x'David Lordbefore adoption6ab71ed

History of this file

Take it

The walk stopped after 200 commits: lines older than 48fe965 point at it.

Merge branch '2.1.x'David Lordbefore adoption48fe965

lines 1–13why, one step back
1import packaging.version
2from pallets_sphinx_themes import get_version3from pallets_sphinx_themes import ProjectLink45# Project --------------------------------------------------------------67project = "Flask"8copyright = "2010 Pallets"9author = "Pallets"10release, version = get_version("Flask")1112# General --------------------------------------------------------------13

Merge branch '3.0.x'David Lordbefore adoption6ab71ed

line 14why, one step back
14default_role = "code"

Merge branch '2.1.x'David Lordbefore adoption48fe965

lines 15–16why, one step back
15extensions = [
16 "sphinx.ext.autodoc",

Merge branch '3.0.x'David Lordbefore adoption6ab71ed

line 17why, one step back
17 "sphinx.ext.extlinks",

Merge branch '2.1.x'David Lordbefore adoption48fe965

lines 18–20why, one step back
18 "sphinx.ext.intersphinx",
19 "sphinxcontrib.log_cabinet",20 "sphinx_tabs.tabs",

Merge branch '3.0.x'David Lordbefore adoption6ab71ed

line 21why, one step back
21 "pallets_sphinx_themes",

Merge branch '2.1.x'David Lordbefore adoption48fe965

line 22why, one step back
22]

Merge branch '3.0.x'David Lordbefore adoption6ab71ed

line 23why, one step back
23autodoc_member_order = "bysource"

Merge branch '2.1.x'David Lordbefore adoption48fe965

line 24why, one step back
24autodoc_typehints = "description"

Merge branch '3.0.x'David Lordbefore adoption6ab71ed

lines 25–29why, one step back
25autodoc_preserve_defaults = True
26extlinks = {27 "issue": ("https://github.com/pallets/flask/issues/%s", "#%s"),28 "pr": ("https://github.com/pallets/flask/pull/%s", "#%s"),29}

Merge branch '2.1.x'David Lordbefore adoption48fe965

lines 30–37why, one step back
30intersphinx_mapping = {
31 "python": ("https://docs.python.org/3/", None),32 "werkzeug": ("https://werkzeug.palletsprojects.com/", None),33 "click": ("https://click.palletsprojects.com/", None),34 "jinja": ("https://jinja.palletsprojects.com/", None),35 "itsdangerous": ("https://itsdangerous.palletsprojects.com/", None),36 "sqlalchemy": ("https://docs.sqlalchemy.org/", None),37 "wtforms": ("https://wtforms.readthedocs.io/", None),

Merge branch '2.1.x'David Lordbefore adoption02a0851

line 38why, one step back
38 "blinker": ("https://blinker.readthedocs.io/", None),

Merge branch '2.1.x'David Lordbefore adoption48fe965

lines 39–59why, one step back
39}
4041# HTML -----------------------------------------------------------------4243html_theme = "flask"44html_theme_options = {"index_sidebar_logo": False}45html_context = {46 "project_links": [47 ProjectLink("Donate", "https://palletsprojects.com/donate"),48 ProjectLink("PyPI Releases", "https://pypi.org/project/Flask/"),49 ProjectLink("Source Code", "https://github.com/pallets/flask/"),50 ProjectLink("Issue Tracker", "https://github.com/pallets/flask/issues/"),51 ProjectLink("Chat", "https://discord.gg/pallets"),52 ]53}54html_sidebars = {55 "index": ["project.html", "localtoc.html", "searchbox.html", "ethicalads.html"],56 "**": ["localtoc.html", "relations.html", "searchbox.html", "ethicalads.html"],57}58singlehtml_sidebars = {"index": ["project.html", "localtoc.html", "ethicalads.html"]}59html_static_path = ["_static"]

Merge pull request #5073 from pallets/new-logoDavid Lordbefore adoption2b2a764

lines 60–61why, one step back
60html_favicon = "_static/shortcut-icon.png"
61html_logo = "_static/flask-vertical.png"

Merge branch '2.1.x'David Lordbefore adoption48fe965

lines 62–97why, one step back
62html_title = f"Flask Documentation ({version})"
63html_show_sourcelink = False6465# Local Extensions -----------------------------------------------------666768def github_link(name, rawtext, text, lineno, inliner, options=None, content=None):69 app = inliner.document.settings.env.app70 release = app.config.release71 base_url = "https://github.com/pallets/flask/tree/"7273 if text.endswith(">"):74 words, text = text[:-1].rsplit("<", 1)75 words = words.strip()76 else:77 words = None7879 if packaging.version.parse(release).is_devrelease:80 url = f"{base_url}main/{text}"81 else:82 url = f"{base_url}{release}/{text}"8384 if words is None:85 words = url8687 from docutils.nodes import reference88 from docutils.parsers.rst.roles import set_classes8990 options = options or {}91 set_classes(options)92 node = reference(rawtext, words, refuri=url, **options)93 return [node], []949596def setup(app):97 app.add_role("gh", github_link)