Skip to content
Myr

conf.py

This file

Path

docs/conf.py

100 lines · 3.2 KiB · Python

Last changed by

add gettext config for docsDavid Lordbefore adoption18ffe1e

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–64why, one step back
62html_title = f"Flask Documentation ({version})"
63html_show_sourcelink = False64

add gettext config for docsDavid Lordbefore adoption18ffe1e

lines 65–67why, one step back
65gettext_uuid = True
66gettext_compact = False67

Merge branch '2.1.x'David Lordbefore adoption48fe965

lines 68–100why, one step back
68# Local Extensions -----------------------------------------------------
697071def github_link(name, rawtext, text, lineno, inliner, options=None, content=None):72 app = inliner.document.settings.env.app73 release = app.config.release74 base_url = "https://github.com/pallets/flask/tree/"7576 if text.endswith(">"):77 words, text = text[:-1].rsplit("<", 1)78 words = words.strip()79 else:80 words = None8182 if packaging.version.parse(release).is_devrelease:83 url = f"{base_url}main/{text}"84 else:85 url = f"{base_url}{release}/{text}"8687 if words is None:88 words = url8990 from docutils.nodes import reference91 from docutils.parsers.rst.roles import set_classes9293 options = options or {}94 set_classes(options)95 node = reference(rawtext, words, refuri=url, **options)96 return [node], []979899def setup(app):100 app.add_role("gh", github_link)