Browse Source

fix some warnings while building docs

pull/1781/head
David Lord 9 years ago
parent
commit
317d60307d
  1. 29
      docs/conf.py
  2. 2
      docs/extensions.rst
  3. 8
      docs/upgrading.rst

29
docs/conf.py

@ -10,7 +10,7 @@
#
# All configuration values have a default; values that are commented out
# serve to show the default.
from __future__ import print_function
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
@ -26,8 +26,11 @@ sys.path.append(os.path.abspath('.'))
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx',
'flaskdocext']
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'flaskdocext'
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@ -52,10 +55,8 @@ import pkg_resources
try:
release = pkg_resources.get_distribution('Flask').version
except pkg_resources.DistributionNotFound:
print 'To build the documentation, The distribution information of Flask'
print 'Has to be available. Either install the package into your'
print 'development environment or run "setup.py develop" to setup the'
print 'metadata. A virtualenv is recommended!'
print('Flask must be installed to build the documentation.')
print('Install from source using `pip install -e .` in a virtualenv.')
sys.exit(1)
del pkg_resources
@ -258,13 +259,13 @@ pygments_style = 'flask_theme_support.FlaskyStyle'
# fall back if theme is not there
try:
__import__('flask_theme_support')
except ImportError, e:
print '-' * 74
print 'Warning: Flask themes unavailable. Building with default theme'
print 'If you want the Flask themes, run this command and build again:'
print
print ' git submodule update --init'
print '-' * 74
except ImportError as e:
print('-' * 74)
print('Warning: Flask themes unavailable. Building with default theme')
print('If you want the Flask themes, run this command and build again:')
print()
print(' git submodule update --init')
print('-' * 74)
pygments_style = 'tango'
html_theme = 'default'

2
docs/extensions.rst

@ -1,3 +1,5 @@
.. _extensions:
Flask Extensions
================

8
docs/upgrading.rst

@ -25,7 +25,7 @@ Version 1.0
-----------
Debugging
+++++++++
`````````
Flask 1.0 removed the ``debug_log_format`` attribute from Flask
applications. Instead the new ``LOGGER_HANDLER_POLICY`` configuration can
@ -33,7 +33,7 @@ be used to disable the default log handlers and custom log handlers can be
set up.
Error handling
++++++++++++++
``````````````
The behavior of error handlers was changed.
The precedence of handlers used to be based on the decoration/call order of
@ -53,14 +53,14 @@ Trying to register a handler on an instance now raises :exc:`ValueError`.
handlers only using exception classes and HTTP error codes.
Templating
++++++++++
``````````
The :func:`~flask.templating.render_template_string` function has changed to
autoescape template variables by default. This better matches the behavior
of :func:`~flask.templating.render_template`.
Extension imports
+++++++++++++++++
`````````````````
Extension imports of the form ``flask.ext.foo`` are deprecated, you should use
``flask_foo``.

Loading…
Cancel
Save