Skip to content
Myr

conf.py

This file

Path

docs/conf.py

95 lines · 3.1 KiB · Python

Last changed by

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

History of this file

Take it

The walk stopped after 200 commits: lines older than 4f3dbb3 point at it.

Merge branch '1.1.x'David Lordbefore adoptiona3f0782

line 1why, one step back
1import packaging.version

Merge branch '1.0-maintenance'David Lordbefore adoption4f3dbb3

lines 2–7why, one step back
2from pallets_sphinx_themes import get_version
3from pallets_sphinx_themes import ProjectLink45# Project --------------------------------------------------------------67project = "Flask"

Merge branch '1.0.x'David Lordbefore adoption1351d0a

lines 8–9why, one step back
8copyright = "2010 Pallets"
9author = "Pallets"

Merge branch '1.0-maintenance'David Lordbefore adoption4f3dbb3

lines 10–19why, one step back
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",

Merge pull request #3174 from icreatedanaccount/masterDavid Lordbefore adoption8ef56c8

line 20why, one step back
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 branch '1.0-maintenance'David Lordbefore adoption4f3dbb3

lines 22–24why, one step back
22]
23intersphinx_mapping = {24 "python": ("https://docs.python.org/3/", None),

Merge branch '1.0.x'David Lordbefore adoption1351d0a

line 25why, one step back
25 "werkzeug": ("https://werkzeug.palletsprojects.com/", None),

Merge branch '1.0-maintenance'David Lordbefore adoption4f3dbb3

line 26why, one step back
26 "click": ("https://click.palletsprojects.com/", None),

Merge pull request #3427 from greyli/update-old-linksDavid Lordbefore adoption25a5d30

line 27why, one step back
27 "jinja": ("https://jinja.palletsprojects.com/", None),

Merge branch '1.0-maintenance'David Lordbefore adoption4f3dbb3

lines 28–29why, one step back
28 "itsdangerous": ("https://itsdangerous.palletsprojects.com/", None),
29 "sqlalchemy": ("https://docs.sqlalchemy.org/", None),

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

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

Merge branch '1.0-maintenance'David Lordbefore adoption4f3dbb3

lines 31–32why, one step back
31 "blinker": ("https://pythonhosted.org/blinker/", None),
32}

Merge pull request #3174 from icreatedanaccount/masterDavid Lordbefore adoption8ef56c8

line 33why, one step back
33issues_github_path = "pallets/flask"

Merge branch '1.0-maintenance'David Lordbefore adoption4f3dbb3

lines 34–48why, one step back
34
35# HTML -----------------------------------------------------------------3637html_theme = "flask"38html_theme_options = {"index_sidebar_logo": False}39html_context = {40 "project_links": [41 ProjectLink("Donate to Pallets", "https://palletsprojects.com/donate"),42 ProjectLink("Flask Website", "https://palletsprojects.com/p/flask/"),43 ProjectLink("PyPI releases", "https://pypi.org/project/Flask/"),44 ProjectLink("Source Code", "https://github.com/pallets/flask/"),45 ProjectLink("Issue Tracker", "https://github.com/pallets/flask/issues/"),46 ]47}48html_sidebars = {

Merge branch '1.0.x'David Lordbefore adoption1351d0a

lines 49–50why, one step back
49 "index": ["project.html", "localtoc.html", "searchbox.html"],
50 "**": ["localtoc.html", "relations.html", "searchbox.html"],

Merge branch '1.0-maintenance'David Lordbefore adoption4f3dbb3

line 51why, one step back
51}

Merge branch '1.0.x'David Lordbefore adoption1351d0a

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

Merge branch '1.0-maintenance'David Lordbefore adoption4f3dbb3

lines 53–54why, one step back
53html_static_path = ["_static"]
54html_favicon = "_static/flask-icon.png"

Merge branch '1.0.x'David Lordbefore adoption1351d0a

line 55why, one step back
55html_logo = "_static/flask-icon.png"

Merge pull request #3554 from pallets/drop-python2David Lordbefore adoptioncd8a374

line 56why, one step back
56html_title = f"Flask Documentation ({version})"

Merge branch '1.0-maintenance'David Lordbefore adoption4f3dbb3

lines 57–60why, one step back
57html_show_sourcelink = False
5859# LaTeX ----------------------------------------------------------------60

Merge pull request #3554 from pallets/drop-python2David Lordbefore adoptioncd8a374

line 61why, one step back
61latex_documents = [(master_doc, f"Flask-{version}.tex", html_title, author, "manual")]

Merge branch '1.0-maintenance'David Lordbefore adoption4f3dbb3

lines 62–76why, one step back
62
63# Local Extensions -----------------------------------------------------646566def github_link(name, rawtext, text, lineno, inliner, options=None, content=None):67 app = inliner.document.settings.env.app68 release = app.config.release69 base_url = "https://github.com/pallets/flask/tree/"7071 if text.endswith(">"):72 words, text = text[:-1].rsplit("<", 1)73 words = words.strip()74 else:75 words = None76

Merge branch '1.1.x'David Lordbefore adoption0adbaf2

line 77why, one step back
77 if packaging.version.parse(release).is_devrelease:

Merge pull request #3554 from pallets/drop-python2David Lordbefore adoptioncd8a374

line 78why, one step back
78 url = f"{base_url}master/{text}"

Merge branch '1.0-maintenance'David Lordbefore adoption4f3dbb3

line 79why, one step back
79 else:

Merge pull request #3554 from pallets/drop-python2David Lordbefore adoptioncd8a374

line 80why, one step back
80 url = f"{base_url}{release}/{text}"

Merge branch '1.0-maintenance'David Lordbefore adoption4f3dbb3

lines 81–95why, one step back
81
82 if words is None:83 words = url8485 from docutils.nodes import reference86 from docutils.parsers.rst.roles import set_classes8788 options = options or {}89 set_classes(options)90 node = reference(rawtext, words, refuri=url, **options)91 return [node], []929394def setup(app):95 app.add_role("gh", github_link)