Skip to content
Myr

conf.py

This file

Path

docs/conf.py

107 lines · 3.5 KiB · Python

Last changed by

Merge pull request #3174 from icreatedanaccount/masterDavid Lordbefore adoption8ef56c8

History of this file

Take it

1from __future__ import print_function23from pallets_sphinx_themes import get_version4from pallets_sphinx_themes import ProjectLink56# Project --------------------------------------------------------------78project = "Flask"9copyright = "2010 Pallets Team"10author = "Pallets Team"11release, version = get_version("Flask")1213# General --------------------------------------------------------------1415master_doc = "index"16extensions = [17    "sphinx.ext.autodoc",18    "sphinx.ext.intersphinx",19    "sphinxcontrib.log_cabinet",20    "pallets_sphinx_themes",21    "sphinx_issues",22]23intersphinx_mapping = {24    "python": ("https://docs.python.org/3/", None),25    "werkzeug": ("http://werkzeug.pocoo.org/docs/", None),26    "click": ("https://click.palletsprojects.com/", None),27    "jinja": ("http://jinja.pocoo.org/docs/", None),28    "itsdangerous": ("https://itsdangerous.palletsprojects.com/", None),29    "sqlalchemy": ("https://docs.sqlalchemy.org/", None),30    "wtforms": ("https://wtforms.readthedocs.io/en/stable/", None),31    "blinker": ("https://pythonhosted.org/blinker/", None),32}33issues_github_path = "pallets/flask"3435# 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 = {49    "index": ["project.html", "localtoc.html", "versions.html", "searchbox.html"],50    "**": ["localtoc.html", "relations.html", "versions.html", "searchbox.html"],51}52singlehtml_sidebars = {"index": ["project.html", "versions.html", "localtoc.html"]}53html_static_path = ["_static"]54html_favicon = "_static/flask-icon.png"55html_logo = "_static/flask-logo-sidebar.png"56html_title = "Flask Documentation ({})".format(version)57html_show_sourcelink = False58html_domain_indices = False5960# LaTeX ----------------------------------------------------------------6162latex_documents = [63    (master_doc, "Flask-{}.tex".format(version), html_title, author, "manual")64]65latex_use_modindex = False66latex_elements = {67    "papersize": "a4paper",68    "pointsize": "12pt",69    "fontpkg": r"\usepackage{mathpazo}",70    "preamble": r"\usepackage{flaskstyle}",71}72latex_use_parts = True73latex_additional_files = ["flaskstyle.sty", "logo.pdf"]7475# Local Extensions -----------------------------------------------------767778def github_link(name, rawtext, text, lineno, inliner, options=None, content=None):79    app = inliner.document.settings.env.app80    release = app.config.release81    base_url = "https://github.com/pallets/flask/tree/"8283    if text.endswith(">"):84        words, text = text[:-1].rsplit("<", 1)85        words = words.strip()86    else:87        words = None8889    if release.endswith("dev"):90        url = "{0}master/{1}".format(base_url, text)91    else:92        url = "{0}{1}/{2}".format(base_url, release, text)9394    if words is None:95        words = url9697    from docutils.nodes import reference98    from docutils.parsers.rst.roles import set_classes99100    options = options or {}101    set_classes(options)102    node = reference(rawtext, words, refuri=url, **options)103    return [node], []104105106def setup(app):107    app.add_role("gh", github_link)