Skip to content
Myr

conf.py

This file

Path

docs/conf.py

96 lines · 3.1 KiB · Python

Last changed by

Merge branch '1.0.x' into 1.1.xDavid Lordbefore adoption7fdd0df

History of this file

Take it

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

Merge branch '1.0.x' into 1.1.xDavid Lordbefore adoption7fdd0df

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

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

lines 2–3why, one step back
2from pallets_sphinx_themes import get_version
3from pallets_sphinx_themes import ProjectLink

add changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

lines 4–6why, one step back
4
5# Project --------------------------------------------------------------6

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

line 7why, one step back
7project = "Flask"

Merge branch '1.0.x'David Lordbefore adoption1351d0a

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

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

line 10why, one step back
10release, version = get_version("Flask")

add changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

lines 11–13why, one step back
11
12# General --------------------------------------------------------------13

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

line 14why, one step back
14master_doc = "index"

add changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

line 15why, one step back
15extensions = [

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

lines 16–19why, one step back
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 changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

lines 21–22why, one step back
21]
22intersphinx_mapping = {

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

line 23why, one step back
23 "python": ("https://docs.python.org/3/", None),

Merge branch '1.0.x'David Lordbefore adoption1351d0a

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

Merge branch '1.0-maintenance'David Lordbefore adoptionf7d50d4

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

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

line 26why, one step back
26 "jinja": ("http://jinja.pocoo.org/docs/", None),

Merge branch '1.0-maintenance'David Lordbefore adoptionf7d50d4

lines 27–29why, one step back
27 "itsdangerous": ("https://itsdangerous.palletsprojects.com/", None),
28 "sqlalchemy": ("https://docs.sqlalchemy.org/", None),29 "wtforms": ("https://wtforms.readthedocs.io/en/stable/", None),

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

line 30why, one step back
30 "blinker": ("https://pythonhosted.org/blinker/", None),

add changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

line 31why, one step back
31}

Merge pull request #3174 from icreatedanaccount/masterDavid Lordbefore adoption8ef56c8

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

add changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

lines 33–35why, one step back
33
34# HTML -----------------------------------------------------------------35

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

lines 36–37why, one step back
36html_theme = "flask"
37html_theme_options = {"index_sidebar_logo": False}

add changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

line 38why, one step back
38html_context = {

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

lines 39–45why, one step back
39 "project_links": [
40 ProjectLink("Donate to Pallets", "https://palletsprojects.com/donate"),41 ProjectLink("Flask Website", "https://palletsprojects.com/p/flask/"),42 ProjectLink("PyPI releases", "https://pypi.org/project/Flask/"),43 ProjectLink("Source Code", "https://github.com/pallets/flask/"),44 ProjectLink("Issue Tracker", "https://github.com/pallets/flask/issues/"),45 ]

add changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

lines 46–47why, one step back
46}
47html_sidebars = {

Merge branch '1.0.x'David Lordbefore adoption1351d0a

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

add changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

line 50why, one step back
50}

Merge branch '1.0.x'David Lordbefore adoption1351d0a

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

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

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

Merge branch '1.0.x'David Lordbefore adoption1351d0a

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

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

line 55why, one step back
55html_title = "Flask Documentation ({})".format(version)

add changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

lines 56–60why, one step back
56html_show_sourcelink = False
5758# LaTeX ----------------------------------------------------------------5960latex_documents = [

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

line 61why, one step back
61 (master_doc, "Flask-{}.tex".format(version), html_title, author, "manual")

add changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

lines 62–66why, one step back
62]
6364# Local Extensions -----------------------------------------------------6566

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

line 67why, one step back
67def github_link(name, rawtext, text, lineno, inliner, options=None, content=None):

add changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

lines 68–69why, one step back
68 app = inliner.document.settings.env.app
69 release = app.config.release

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

line 70why, one step back
70 base_url = "https://github.com/pallets/flask/tree/"

add changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

line 71why, one step back
71

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

lines 72–73why, one step back
72 if text.endswith(">"):
73 words, text = text[:-1].rsplit("<", 1)

add changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

lines 74–77why, one step back
74 words = words.strip()
75 else:76 words = None77

Merge branch '1.0.x' into 1.1.xDavid Lordbefore adoption02cfee8

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

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

line 79why, one step back
79 url = "{0}master/{1}".format(base_url, text)

add changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

line 80why, one step back
80 else:

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

line 81why, one step back
81 url = "{0}{1}/{2}".format(base_url, release, text)

add changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

lines 82–87why, one step back
82
83 if words is None:84 words = url8586 from docutils.nodes import reference87 from docutils.parsers.rst.roles import set_classes

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

line 88why, one step back
88

add changelog for docs theme and tutorialDavid Lordbefore adoptionbe46acb

lines 89–95why, one step back
89 options = options or {}
90 set_classes(options)91 node = reference(rawtext, words, refuri=url, **options)92 return [node], []939495def setup(app):

Merge pull request #2912 from pallets/docs-themeDavid Lordbefore adoption19a0a7d

line 96why, one step back
96 app.add_role("gh", github_link)