Skip to content
Myr

conf.py

This file

Path

docs/conf.py

293 lines · 9.3 KiB · Python

Last changed by

fix some warnings while building docsDavid Lordbefore adoption317d603

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 sys, os1516# If extensions (or modules to document with autodoc) are in another directory,17# add these directories to sys.path here. If the directory is relative to the18# documentation root, use os.path.abspath to make it absolute, like shown here.19sys.path.append(os.path.abspath('_themes'))20sys.path.append(os.path.abspath('.'))2122# -- General configuration -----------------------------------------------------2324# If your documentation needs a minimal Sphinx version, state it here.25#needs_sphinx = '1.0'2627# Add any Sphinx extension module names here, as strings. They can be extensions28# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.29extensions = [30    'sphinx.ext.autodoc',31    'sphinx.ext.intersphinx',32    'flaskdocext'33]3435# Add any paths that contain templates here, relative to this directory.36templates_path = ['_templates']3738# The suffix of source filenames.39source_suffix = '.rst'4041# The encoding of source files.42#source_encoding = 'utf-8-sig'4344# The master toctree document.45master_doc = 'index'4647# General information about the project.48project = u'Flask'49copyright = u'2015, Armin Ronacher'5051# The version info for the project you're documenting, acts as replacement for52# |version| and |release|, also used in various other places throughout the53# built documents.54import pkg_resources55try:56    release = pkg_resources.get_distribution('Flask').version57except pkg_resources.DistributionNotFound:58    print('Flask must be installed to build the documentation.')59    print('Install from source using `pip install -e .` in a virtualenv.')60    sys.exit(1)61del pkg_resources6263if 'dev' in release:64    release = release.split('dev')[0] + 'dev'65version = '.'.join(release.split('.')[:2])6667# The language for content autogenerated by Sphinx. Refer to documentation68# for a list of supported languages.69#language = None7071# There are two options for replacing |today|: either, you set today to some72# non-false value, then it is used:73#today = ''74# Else, today_fmt is used as the format for a strftime call.75#today_fmt = '%B %d, %Y'7677# List of patterns, relative to source directory, that match files and78# directories to ignore when looking for source files.79exclude_patterns = ['_build']8081# The reST default role (used for this markup: `text`) to use for all documents.82#default_role = None8384# If true, '()' will be appended to :func: etc. cross-reference text.85#add_function_parentheses = True8687# If true, the current module name will be prepended to all description88# unit titles (such as .. function::).89#add_module_names = True9091# If true, sectionauthor and moduleauthor directives will be shown in the92# output. They are ignored by default.93#show_authors = False9495# A list of ignored prefixes for module index sorting.96#modindex_common_prefix = []979899# -- Options for HTML output ---------------------------------------------------100101# The theme to use for HTML and HTML Help pages.  Major themes that come with102# Sphinx are currently 'default' and 'sphinxdoc'.103html_theme = 'flask'104105# Theme options are theme-specific and customize the look and feel of a theme106# further.  For a list of options available for each theme, see the107# documentation.108html_theme_options = {109    'touch_icon':   'touch-icon.png'110}111112# Add any paths that contain custom themes here, relative to this directory.113html_theme_path = ['_themes']114115# The name for this set of Sphinx documents.  If None, it defaults to116# "<project> v<release> documentation".117#html_title = None118119# A shorter title for the navigation bar.  Default is the same as html_title.120#html_short_title = None121122# The name of an image file (relative to this directory) to place at the top123# of the sidebar.  Do not set, template magic!124#html_logo = None125126# The name of an image file (within the static path) to use as favicon of the127# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32128# pixels large.129html_favicon = "flask-favicon.ico"130131# Add any paths that contain custom static files (such as style sheets) here,132# relative to this directory. They are copied after the builtin static files,133# so a file named "default.css" will overwrite the builtin "default.css".134html_static_path = ['_static']135136# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,137# using the given strftime format.138#html_last_updated_fmt = '%b %d, %Y'139140# If true, SmartyPants will be used to convert quotes and dashes to141# typographically correct entities.142#html_use_smartypants = True143144# Custom sidebar templates, maps document names to template names.145html_sidebars = {146    'index':    ['sidebarintro.html', 'sourcelink.html', 'searchbox.html'],147    '**':       ['sidebarlogo.html', 'localtoc.html', 'relations.html',148                 'sourcelink.html', 'searchbox.html']149}150151# Additional templates that should be rendered to pages, maps page names to152# template names.153#html_additional_pages = {}154155# If false, no module index is generated.156html_use_modindex = False157158# If false, no index is generated.159#html_use_index = True160161# If true, the index is split into individual pages for each letter.162#html_split_index = False163164# If true, links to the reST sources are added to the pages.165#html_show_sourcelink = True166167# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.168html_show_sphinx = False169170# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.171#html_show_copyright = True172173# If true, an OpenSearch description file will be output, and all pages will174# contain a <link> tag referring to it.  The value of this option must be the175# base URL from which the finished HTML is served.176#html_use_opensearch = ''177178# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").179#html_file_suffix = ''180181# Output file base name for HTML help builder.182htmlhelp_basename = 'Flaskdoc'183184185# -- Options for LaTeX output --------------------------------------------------186187# Grouping the document tree into LaTeX files. List of tuples188# (source start file, target name, title, author, documentclass [howto/manual]).189latex_documents = [190  ('latexindex', 'Flask.tex', u'Flask Documentation',191   u'Armin Ronacher', 'manual'),192]193194# Documents to append as an appendix to all manuals.195#latex_appendices = []196197# If false, no module index is generated.198latex_use_modindex = False199200latex_elements = {201    'fontpkg':      r'\usepackage{mathpazo}',202    'papersize':    'a4paper',203    'pointsize':    '12pt',204    'preamble':     r'\usepackage{flaskstyle}'205}206latex_use_parts = True207208latex_additional_files = ['flaskstyle.sty', 'logo.pdf']209210211# -- Options for Epub output ---------------------------------------------------212213# Bibliographic Dublin Core info.214#epub_title = ''215#epub_author = ''216#epub_publisher = ''217#epub_copyright = ''218219# The language of the text. It defaults to the language option220# or en if the language is not set.221#epub_language = ''222223# The scheme of the identifier. Typical schemes are ISBN or URL.224#epub_scheme = ''225226# The unique identifier of the text. This can be a ISBN number227# or the project homepage.228#epub_identifier = ''229230# A unique identification for the text.231#epub_uid = ''232233# HTML files that should be inserted before the pages created by sphinx.234# The format is a list of tuples containing the path and title.235#epub_pre_files = []236237# HTML files shat should be inserted after the pages created by sphinx.238# The format is a list of tuples containing the path and title.239#epub_post_files = []240241# A list of files that should not be packed into the epub file.242#epub_exclude_files = []243244# The depth of the table of contents in toc.ncx.245#epub_tocdepth = 3246247intersphinx_mapping = {248    'https://docs.python.org/dev': None,249    'http://werkzeug.pocoo.org/docs/': None,250    'http://click.pocoo.org/': None,251    'http://jinja.pocoo.org/docs/': None,252    'http://www.sqlalchemy.org/docs/': None,253    'https://wtforms.readthedocs.org/en/latest/': None,254    'https://pythonhosted.org/blinker/': None255}256257pygments_style = 'flask_theme_support.FlaskyStyle'258259# fall back if theme is not there260try:261    __import__('flask_theme_support')262except ImportError as e:263    print('-' * 74)264    print('Warning: Flask themes unavailable.  Building with default theme')265    print('If you want the Flask themes, run this command and build again:')266    print()267    print('  git submodule update --init')268    print('-' * 74)269270    pygments_style = 'tango'271    html_theme = 'default'272    html_theme_options = {}273274275# unwrap decorators276def unwrap_decorators():277    import sphinx.util.inspect as inspect278    import functools279280    old_getargspec = inspect.getargspec281    def getargspec(x):282        return old_getargspec(getattr(x, '_original_function', x))283    inspect.getargspec = getargspec284285    old_update_wrapper = functools.update_wrapper286    def update_wrapper(wrapper, wrapped, *a, **kw):287        rv = old_update_wrapper(wrapper, wrapped, *a, **kw)288        rv._original_function = wrapped289        return rv290    functools.update_wrapper = update_wrapper291292unwrap_decorators()293del unwrap_decorators