Skip to content
Myr

conf.py

This file

Path

docs/conf.py

297 lines · 9.3 KiB · Python

Last changed by

use alabasterKenneth Reitzbefore adoption386ac92

History of this file

Take it

1# -*- coding: utf-8 -*-2#3# Flask documentation build configuration file, created by4# sphinx-quickstart on Tue Apr  6 15:24:58 2010.5#6# This file is execfile()d with the current directory set to its containing dir.7#8# Note that not all possible configuration values are present in this9# autogenerated file.10#11# All configuration values have a default; values that are commented out12# serve to show the default.13from __future__ import print_function14import os15import sys16import pkg_resources17import time18import datetime1920BUILD_DATE = datetime.datetime.utcfromtimestamp(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))2122# If extensions (or modules to document with autodoc) are in another directory,23# add these directories to sys.path here. If the directory is relative to the24# documentation root, use os.path.abspath to make it absolute, like shown here.25sys.path.append(os.path.dirname(__file__))2627# -- General configuration -----------------------------------------------------2829# If your documentation needs a minimal Sphinx version, state it here.30#needs_sphinx = '1.0'3132# Add any Sphinx extension module names here, as strings. They can be extensions33# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.34extensions = [35    'sphinx.ext.autodoc',36    'sphinx.ext.intersphinx',37    'flaskdocext'38]3940try:41    __import__('sphinxcontrib.log_cabinet')42except ImportError:43    print('sphinxcontrib-log-cabinet is not installed.')44    print('Changelog directives will not be re-organized.')45else:46    extensions.append('sphinxcontrib.log_cabinet')4748# Add any paths that contain templates here, relative to this directory.49templates_path = ['_templates']5051# The suffix of source filenames.52source_suffix = '.rst'5354# The encoding of source files.55#source_encoding = 'utf-8-sig'5657# The master toctree document.58master_doc = 'index'5960# General information about the project.61project = u'Flask'62copyright = u'2010 - {0}, Armin Ronacher'.format(BUILD_DATE.year)6364# The version info for the project you're documenting, acts as replacement for65# |version| and |release|, also used in various other places throughout the66# built documents.67try:68    release = pkg_resources.get_distribution('Flask').version69except pkg_resources.DistributionNotFound:70    print('Flask must be installed to build the documentation.')71    print('Install from source using `pip install -e .` in a virtualenv.')72    sys.exit(1)7374if 'dev' in release:75    release = ''.join(release.partition('dev')[:2])7677version = '.'.join(release.split('.')[:2])7879# The language for content autogenerated by Sphinx. Refer to documentation80# for a list of supported languages.81#language = None8283# There are two options for replacing |today|: either, you set today to some84# non-false value, then it is used:85#today = ''86# Else, today_fmt is used as the format for a strftime call.87#today_fmt = '%B %d, %Y'8889# List of patterns, relative to source directory, that match files and90# directories to ignore when looking for source files.91exclude_patterns = ['_build']9293# The reST default role (used for this markup: `text`) to use for all documents.94#default_role = None9596# If true, '()' will be appended to :func: etc. cross-reference text.97#add_function_parentheses = True9899# If true, the current module name will be prepended to all description100# unit titles (such as .. function::).101#add_module_names = True102103# If true, sectionauthor and moduleauthor directives will be shown in the104# output. They are ignored by default.105#show_authors = False106107# A list of ignored prefixes for module index sorting.108#modindex_common_prefix = []109110111# -- Options for HTML output ---------------------------------------------------112113# The theme to use for HTML and HTML Help pages.  Major themes that come with114# Sphinx are currently 'default' and 'sphinxdoc'.115# html_theme = 'default'116117# Theme options are theme-specific and customize the look and feel of a theme118# further.  For a list of options available for each theme, see the119# documentation.120# html_theme_options = {}121122# Add any paths that contain custom themes here, relative to this directory.123# html_theme_path = ['_themes']124125# The name for this set of Sphinx documents.  If None, it defaults to126# "<project> v<release> documentation".127#html_title = None128129# A shorter title for the navigation bar.  Default is the same as html_title.130#html_short_title = None131132# The name of an image file (relative to this directory) to place at the top133# of the sidebar.  Do not set, template magic!134#html_logo = None135136# The name of an image file (within the static path) to use as favicon of the137# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32138# pixels large.139html_favicon = '_static/flask-favicon.ico'140141# Add any paths that contain custom static files (such as style sheets) here,142# relative to this directory. They are copied after the builtin static files,143# so a file named "default.css" will overwrite the builtin "default.css".144html_static_path = ['_static']145146# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,147# using the given strftime format.148#html_last_updated_fmt = '%b %d, %Y'149150# If true, SmartyPants will be used to convert quotes and dashes to151# typographically correct entities.152#html_use_smartypants = True153154# Custom sidebar templates, maps document names to template names.155html_sidebars = {156    'index': [157        'sidebarintro.html',158        'sourcelink.html',159        'searchbox.html'160    ],161    '**': [162        'sidebarlogo.html',163        'localtoc.html',164        'relations.html',165        'sourcelink.html',166        'searchbox.html'167    ]168}169170# Additional templates that should be rendered to pages, maps page names to171# template names.172#html_additional_pages = {}173174# If false, no module index is generated.175html_use_modindex = False176177# If false, no index is generated.178#html_use_index = True179180# If true, the index is split into individual pages for each letter.181#html_split_index = False182183# If true, links to the reST sources are added to the pages.184#html_show_sourcelink = True185186# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.187html_show_sphinx = False188189# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.190#html_show_copyright = True191192# If true, an OpenSearch description file will be output, and all pages will193# contain a <link> tag referring to it.  The value of this option must be the194# base URL from which the finished HTML is served.195#html_use_opensearch = ''196197# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").198#html_file_suffix = ''199200# Output file base name for HTML help builder.201htmlhelp_basename = 'Flaskdoc'202203204# -- Options for LaTeX output --------------------------------------------------205206# Grouping the document tree into LaTeX files. List of tuples207# (source start file, target name, title, author, documentclass [howto/manual]).208latex_documents = [209  ('latexindex', 'Flask.tex', u'Flask Documentation', u'Armin Ronacher', 'manual'),210]211212# Documents to append as an appendix to all manuals.213#latex_appendices = []214215# If false, no module index is generated.216latex_use_modindex = False217218latex_elements = {219    'fontpkg': r'\usepackage{mathpazo}',220    'papersize': 'a4paper',221    'pointsize': '12pt',222    'preamble': r'\usepackage{flaskstyle}'223}224latex_use_parts = True225226latex_additional_files = ['flaskstyle.sty', 'logo.pdf']227228229# -- Options for Epub output ---------------------------------------------------230231# Bibliographic Dublin Core info.232#epub_title = ''233#epub_author = ''234#epub_publisher = ''235#epub_copyright = ''236237# The language of the text. It defaults to the language option238# or en if the language is not set.239#epub_language = ''240241# The scheme of the identifier. Typical schemes are ISBN or URL.242#epub_scheme = ''243244# The unique identifier of the text. This can be an ISBN number245# or the project homepage.246#epub_identifier = ''247248# A unique identification for the text.249#epub_uid = ''250251# HTML files that should be inserted before the pages created by sphinx.252# The format is a list of tuples containing the path and title.253#epub_pre_files = []254255# HTML files shat should be inserted after the pages created by sphinx.256# The format is a list of tuples containing the path and title.257#epub_post_files = []258259# A list of files that should not be packed into the epub file.260#epub_exclude_files = []261262# The depth of the table of contents in toc.ncx.263#epub_tocdepth = 3264265intersphinx_mapping = {266    'python': ('https://docs.python.org/3/', None),267    'werkzeug': ('http://werkzeug.pocoo.org/docs/', None),268    'click': ('http://click.pocoo.org/', None),269    'jinja': ('http://jinja.pocoo.org/docs/', None),270    'sqlalchemy': ('https://docs.sqlalchemy.org/en/latest/', None),271    'wtforms': ('https://wtforms.readthedocs.io/en/latest/', None),272    'blinker': ('https://pythonhosted.org/blinker/', None)273}274275html_theme_options = {276    'touch_icon': 'touch-icon.png'277}278279# unwrap decorators280def unwrap_decorators():281    import sphinx.util.inspect as inspect282    import functools283284    old_getargspec = inspect.getargspec285    def getargspec(x):286        return old_getargspec(getattr(x, '_original_function', x))287    inspect.getargspec = getargspec288289    old_update_wrapper = functools.update_wrapper290    def update_wrapper(wrapper, wrapped, *a, **kw):291        rv = old_update_wrapper(wrapper, wrapped, *a, **kw)292        rv._original_function = wrapped293        return rv294    functools.update_wrapper = update_wrapper295296unwrap_decorators()297del unwrap_decorators