forked from orbit-oss/flask
fix some warnings while building docs
This commit is contained in:
parent
be2abd2926
commit
317d60307d
3 changed files with 21 additions and 18 deletions
29
docs/conf.py
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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue