DOC use sphinx-rtd-theme even if built locally
This commit is contained in:
parent
1a2b8f1df2
commit
086b407b62
14
doc/conf.py
14
doc/conf.py
|
@ -14,6 +14,7 @@
|
|||
|
||||
import sys
|
||||
import os
|
||||
on_rtd = os.getenv('READTHEDOCS') == 'True'
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
|
@ -56,7 +57,7 @@ master_doc = 'index'
|
|||
|
||||
# General information about the project.
|
||||
project = u'python-escpos'
|
||||
copyright = u'2015, Manuel F Martinez and others'
|
||||
copyright = u'2016, Manuel F Martinez and others'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
|
@ -110,7 +111,16 @@ pygments_style = 'sphinx'
|
|||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
html_theme = 'default'
|
||||
if on_rtd:
|
||||
html_theme = 'default'
|
||||
else:
|
||||
try:
|
||||
import sphinx_rtd_theme
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
except ImportError:
|
||||
print("no sphinx_rtd_theme found, switching to nature")
|
||||
html_theme = 'default'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
|
|
|
@ -2,3 +2,4 @@ pyusb
|
|||
Pillow>=2.0
|
||||
qrcode>=4.0
|
||||
pyserial
|
||||
sphinx-rtd-theme
|
Loading…
Reference in New Issue