"Fossies" - the Fresh Open Source Software Archive

Member "flask-1.1.2/docs/conf.py" (3 Apr 2020, 3203 Bytes) of package /linux/www/flask-1.1.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "conf.py" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.1.1_vs_1.1.2.

    1 import packaging.version
    2 from pallets_sphinx_themes import get_version
    3 from pallets_sphinx_themes import ProjectLink
    4 
    5 # Project --------------------------------------------------------------
    6 
    7 project = "Flask"
    8 copyright = "2010 Pallets"
    9 author = "Pallets"
   10 release, version = get_version("Flask")
   11 
   12 # General --------------------------------------------------------------
   13 
   14 master_doc = "index"
   15 extensions = [
   16     "sphinx.ext.autodoc",
   17     "sphinx.ext.intersphinx",
   18     "sphinxcontrib.log_cabinet",
   19     "pallets_sphinx_themes",
   20     "sphinx_issues",
   21 ]
   22 intersphinx_mapping = {
   23     "python": ("https://docs.python.org/3/", None),
   24     "werkzeug": ("https://werkzeug.palletsprojects.com/", None),
   25     "click": ("https://click.palletsprojects.com/", None),
   26     "jinja": ("http://jinja.pocoo.org/docs/", None),
   27     "itsdangerous": ("https://itsdangerous.palletsprojects.com/", None),
   28     "sqlalchemy": ("https://docs.sqlalchemy.org/", None),
   29     "wtforms": ("https://wtforms.readthedocs.io/en/stable/", None),
   30     "blinker": ("https://pythonhosted.org/blinker/", None),
   31 }
   32 issues_github_path = "pallets/flask"
   33 
   34 # HTML -----------------------------------------------------------------
   35 
   36 html_theme = "flask"
   37 html_theme_options = {"index_sidebar_logo": False}
   38 html_context = {
   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     ]
   46 }
   47 html_sidebars = {
   48     "index": ["project.html", "localtoc.html", "searchbox.html"],
   49     "**": ["localtoc.html", "relations.html", "searchbox.html"],
   50 }
   51 singlehtml_sidebars = {"index": ["project.html", "localtoc.html"]}
   52 html_static_path = ["_static"]
   53 html_favicon = "_static/flask-icon.png"
   54 html_logo = "_static/flask-icon.png"
   55 html_title = "Flask Documentation ({})".format(version)
   56 html_show_sourcelink = False
   57 
   58 # LaTeX ----------------------------------------------------------------
   59 
   60 latex_documents = [
   61     (master_doc, "Flask-{}.tex".format(version), html_title, author, "manual")
   62 ]
   63 
   64 # Local Extensions -----------------------------------------------------
   65 
   66 
   67 def github_link(name, rawtext, text, lineno, inliner, options=None, content=None):
   68     app = inliner.document.settings.env.app
   69     release = app.config.release
   70     base_url = "https://github.com/pallets/flask/tree/"
   71 
   72     if text.endswith(">"):
   73         words, text = text[:-1].rsplit("<", 1)
   74         words = words.strip()
   75     else:
   76         words = None
   77 
   78     if packaging.version.parse(release).is_devrelease:
   79         url = "{0}master/{1}".format(base_url, text)
   80     else:
   81         url = "{0}{1}/{2}".format(base_url, release, text)
   82 
   83     if words is None:
   84         words = url
   85 
   86     from docutils.nodes import reference
   87     from docutils.parsers.rst.roles import set_classes
   88 
   89     options = options or {}
   90     set_classes(options)
   91     node = reference(rawtext, words, refuri=url, **options)
   92     return [node], []
   93 
   94 
   95 def setup(app):
   96     app.add_role("gh", github_link)