Skip to content
Myr

conf.py

This file

Path

docs/conf.py

98 lines · 3.3 KiB · Python

Last changed by

Merge branch '2.0.x'David Lordbefore adoption83f7efa

History of this file

Take it

The walk stopped after 200 commits: lines older than 2b517a1 point at it.

Merge pull request #3668 from pallets/dependabot/pip/tox-3.16.1dependabot-preview[bot]before adoption2b517a1

lines 1–20why, 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 --------------------------------------------------------------1314master_doc = "index"15extensions = [16 "sphinx.ext.autodoc",17 "sphinx.ext.intersphinx",18 "sphinxcontrib.log_cabinet",19 "pallets_sphinx_themes",20 "sphinx_issues",

Add command switch tabs for Bash, CMD and Powershell with sphinx-tabs (#3714)Grey Libefore adoption1035efc

line 21why, one step back
21 "sphinx_tabs.tabs",

Merge pull request #3668 from pallets/dependabot/pip/tox-3.16.1dependabot-preview[bot]before adoption2b517a1

line 22why, one step back
22]

Merge pull request #4003 from pallets/autodoc-typehintsDavid Lordbefore adoption2c88e8a

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

Merge pull request #3668 from pallets/dependabot/pip/tox-3.16.1dependabot-preview[bot]before adoption2b517a1

lines 24–30why, one step back
24intersphinx_mapping = {
25 "python": ("https://docs.python.org/3/", None),26 "werkzeug": ("https://werkzeug.palletsprojects.com/", None),27 "click": ("https://click.palletsprojects.com/", None),28 "jinja": ("https://jinja.palletsprojects.com/", None),29 "itsdangerous": ("https://itsdangerous.palletsprojects.com/", None),30 "sqlalchemy": ("https://docs.sqlalchemy.org/", None),

Merge pull request #3723 from greyli/fix-intersphinx-linkGrey Libefore adoptionfd0f89e

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

Merge pull request #3668 from pallets/dependabot/pip/tox-3.16.1dependabot-preview[bot]before adoption2b517a1

lines 32–41why, one step back
32 "blinker": ("https://pythonhosted.org/blinker/", None),
33}34issues_github_path = "pallets/flask"3536# HTML -----------------------------------------------------------------3738html_theme = "flask"39html_theme_options = {"index_sidebar_logo": False}40html_context = {41 "project_links": [

Merge pull request #3922 from pallets/consistencyDavid Lordbefore adoptiondcd3b5c

lines 42–43why, one step back
42 ProjectLink("Donate", "https://palletsprojects.com/donate"),
43 ProjectLink("PyPI Releases", "https://pypi.org/project/Flask/"),

Merge pull request #3668 from pallets/dependabot/pip/tox-3.16.1dependabot-preview[bot]before adoption2b517a1

lines 44–45why, one step back
44 ProjectLink("Source Code", "https://github.com/pallets/flask/"),
45 ProjectLink("Issue Tracker", "https://github.com/pallets/flask/issues/"),

Merge pull request #3922 from pallets/consistencyDavid Lordbefore adoptiondcd3b5c

lines 46–48why, one step back
46 ProjectLink("Website", "https://palletsprojects.com/p/flask/"),
47 ProjectLink("Twitter", "https://twitter.com/PalletsTeam"),48 ProjectLink("Chat", "https://discord.gg/pallets"),

Merge pull request #3668 from pallets/dependabot/pip/tox-3.16.1dependabot-preview[bot]before adoption2b517a1

lines 49–51why, one step back
49 ]
50}51html_sidebars = {

Merge branch '2.0.x'David Lordbefore adoption83f7efa

lines 52–53why, one step back
52 "index": ["project.html", "localtoc.html", "searchbox.html", "ethicalads.html"],
53 "**": ["localtoc.html", "relations.html", "searchbox.html", "ethicalads.html"],

Merge pull request #3668 from pallets/dependabot/pip/tox-3.16.1dependabot-preview[bot]before adoption2b517a1

line 54why, one step back
54}

Merge branch '2.0.x'David Lordbefore adoption83f7efa

line 55why, one step back
55singlehtml_sidebars = {"index": ["project.html", "localtoc.html", "ethicalads.html"]}

Merge pull request #3668 from pallets/dependabot/pip/tox-3.16.1dependabot-preview[bot]before adoption2b517a1

lines 56–80why, one step back
56html_static_path = ["_static"]
57html_favicon = "_static/flask-icon.png"58html_logo = "_static/flask-icon.png"59html_title = f"Flask Documentation ({version})"60html_show_sourcelink = False6162# LaTeX ----------------------------------------------------------------6364latex_documents = [(master_doc, f"Flask-{version}.tex", html_title, author, "manual")]6566# Local Extensions -----------------------------------------------------676869def github_link(name, rawtext, text, lineno, inliner, options=None, content=None):70 app = inliner.document.settings.env.app71 release = app.config.release72 base_url = "https://github.com/pallets/flask/tree/"7374 if text.endswith(">"):75 words, text = text[:-1].rsplit("<", 1)76 words = words.strip()77 else:78 words = None7980 if packaging.version.parse(release).is_devrelease:

Merge remote-tracking branch 'origin/2.0.x'David Lordbefore adoption19f458f

line 81why, one step back
81 url = f"{base_url}main/{text}"

Merge pull request #3668 from pallets/dependabot/pip/tox-3.16.1dependabot-preview[bot]before adoption2b517a1

lines 82–98why, one step back
82 else:
83 url = f"{base_url}{release}/{text}"8485 if words is None:86 words = url8788 from docutils.nodes import reference89 from docutils.parsers.rst.roles import set_classes9091 options = options or {}92 set_classes(options)93 node = reference(rawtext, words, refuri=url, **options)94 return [node], []959697def setup(app):98 app.add_role("gh", github_link)