本文整理汇总了Python中sphinx_rtd_theme.get_html_theme_path函数的典型用法代码示例。如果您正苦于以下问题:Python get_html_theme_path函数的具体用法?Python get_html_theme_path怎么用?Python get_html_theme_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_html_theme_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_extra_theme
def load_extra_theme(cls, name):
themes = ['alabaster']
try:
import sphinx_rtd_theme
themes.append('sphinx_rtd_theme')
except ImportError:
pass
if name in themes:
if name == 'alabaster':
import alabaster
themedir = alabaster.get_path()
# alabaster theme also requires 'alabaster' extension, it will be loaded
# at sphinx.application module.
elif name == 'sphinx_rtd_theme':
themedir = sphinx_rtd_theme.get_html_theme_path()
else:
raise NotImplementedError('Programming Error')
else:
for themedir in load_theme_plugins():
if path.isfile(path.join(themedir, name, THEMECONF)):
break
else:
# specified theme is not found
return
cls.themepath.append(themedir)
cls.themes[name] = (path.join(themedir, name), None)
return
示例2: load_sphinx_rtd_theme
def load_sphinx_rtd_theme(self):
# type: () -> None
"""Load sphinx_rtd_theme theme (if exists)."""
try:
import sphinx_rtd_theme
theme_path = sphinx_rtd_theme.get_html_theme_path()
self.themes['sphinx_rtd_theme'] = path.join(theme_path, 'sphinx_rtd_theme')
except ImportError:
pass
示例3: set_sphinx_html_path
def set_sphinx_html_path(project):
import sphinx_rtd_theme
sphinx_conf = project.get_property("sphinx_project_conf")
sphinx_conf["html_theme"] = "sphinx_rtd_theme"
sphinx_conf["html_theme_path"] = [sphinx_rtd_theme.get_html_theme_path()]
# Napoleon settings
sphinx_conf["extensions"].append("sphinx.ext.napoleon")
sphinx_conf["napoleon_google_docstring"] = True
sphinx_conf["napoleon_numpy_docstring"] = False
sphinx_conf["napoleon_include_init_with_doc"] = False
sphinx_conf["napoleon_include_private_with_doc"] = False
sphinx_conf["napoleon_include_special_with_doc"] = False
sphinx_conf["napoleon_use_admonition_for_examples"] = False
sphinx_conf["napoleon_use_admonition_for_notes"] = False
sphinx_conf["napoleon_use_admonition_for_references"] = False
sphinx_conf["napoleon_use_ivar"] = False
sphinx_conf["napoleon_use_param"] = True
sphinx_conf["napoleon_use_rtype"] = True
sphinx_conf["napoleon_use_keyword"] = True
示例4: load_extra_theme
def load_extra_theme(cls, name):
if name == 'alabaster':
cls.themes[name] = (os.path.join(alabaster.get_path(), name), None)
# alabaster theme also requires 'alabaster' extension, it will be loaded at
# sphinx.******* module.
return
if name == 'sphinx_rtd_theme':
cls.themes[name] = (
os.path.join(sphinx_rtd_theme.get_html_theme_path(), name), None)
return
for themedir in load_theme_plugins():
if not path.isdir(themedir):
continue
for theme in os.listdir(themedir):
if theme != name:
continue
if not path.isfile(path.join(themedir, theme, THEMECONF)):
continue
cls.themes[theme] = (path.join(themedir, theme), None)
return
示例5: set_theme
def set_theme(name):
global html_theme
global html_theme_path
if name == 'nature':
html_theme = 'nature'
elif name == 'rtd':
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
elif name == 'pyramid':
# TODO: broken?
import pylons_sphinx_themes
html_theme = 'pyramid'
html_theme_path = [pylons_sphinx_themes.get_html_themes_path()]
elif name == 'adc':
import sphinx_adc_theme
html_theme = 'sphinx_adc_theme'
html_theme_path = [sphinx_adc_theme.get_html_theme_path()]
# elif name == 'jupyter':
# # TODO: should be on top of file?
# from jupyter_sphinx_theme import *
# init_theme()
elif name == 'celery':
import sphinx_celery
html_theme = 'sphinx_celery'
html_theme_path = [sphinx_celery.get_html_theme_path()]
elif name == 'material':
import sphinx_theme_pd
html_theme = 'sphinx_theme_pd'
html_theme_path = [sphinx_theme_pd.get_html_theme_path()]
elif name == 'plone':
extensions.append('sphinxjp.themecore')
html_theme = 'plonetheme'
elif name == 'mdn':
import mdn_theme
html_theme_path = [mdn_theme.get_theme_dir()]
html_theme = 'mdn'
else:
raise Exception('Unknown theme {}'.format(name))
示例6: load_extra_theme
def load_extra_theme(cls, name):
if name in ("alabaster", "sphinx_rtd_theme"):
if name == "alabaster":
themedir = alabaster.get_path()
# alabaster theme also requires 'alabaster' extension, it will be loaded
# at sphinx.application module.
elif name == "sphinx_rtd_theme":
themedir = sphinx_rtd_theme.get_html_theme_path()
else:
raise NotImplementedError("Programming Error")
else:
for themedir in load_theme_plugins():
if path.isfile(path.join(themedir, name, THEMECONF)):
break
else:
# specified theme is not found
return
cls.themepath.append(themedir)
cls.themes[name] = (path.join(themedir, name), None)
return
示例7: execfile
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
try:
import sphinx_rtd_theme
HTML_THEME = "sphinx_rtd_theme"
HTML_THEME_PATH = [sphinx_rtd_theme.get_html_theme_path()]
except ImportError:
HTML_THEME = 'default'
HTML_THEME_PATH = []
# 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
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
示例8: file
modindex_common_prefix = []
# -- Options for HTML output ----------------------------------------------
# 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 else 'sphinx_rtd_theme'
# 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
# documentation.
html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [] if on_rtd else [sphinx_rtd_theme.get_html_theme_path()]
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
html_title = 'rebase-helper {0} documentation'.format(VERSION)
# A shorter title for the navigation bar. Default is the same as html_title.
html_short_title = html_title
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
示例9: open
"""
Options for sphinx
Add project specific options to conf.py in the root folder
"""
import sphinx_rtd_theme
import os
this_dir = os.path.abspath(os.path.dirname(__file__))
support_dir = os.path.join(this_dir, "..", "support")
extensions = ['sphinx.ext.autodoc']
html_theme = 'the_theme'
html_theme_path = [os.path.join(support_dir, 'templates'), sphinx_rtd_theme.get_html_theme_path()]
html_static_path = [os.path.join(support_dir, "static"), os.path.join(sphinx_rtd_theme.get_html_theme_path(), "sphinx_rtd_theme", "static")]
exclude_patterns = []
master_doc = 'index'
source_suffix = '.rst'
pygments_style = 'pastie'
# Add options specific to this project
location = os.path.join(this_dir, '../conf.py')
with open(location) as f:
code = compile(f.read(), location, 'exec')
exec(code, globals(), locals())
示例10:
extensions = ['sphinxcontrib.phpdomain']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'php-opencloud'
copyright = u'2015, Jamie Hannaford, Shaunak Kashyap'
version = '1.12'
release = '1.12.1'
exclude_patterns = ['_build']
pygments_style = 'sphinx'
html_theme = 'default'
if not on_rtd:
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "_templates"]
html_static_path = ['_static']
html_use_index = True
# Output file base name for HTML help builder.
htmlhelp_basename = 'php-openclouddoc'
latex_documents = [
('index', 'php-opencloud.tex', u'php-opencloud Documentation',
u'Jamie Hannaford, Shaunak Kashyap', 'manual'),
]
man_pages = [
('index', 'php-opencloud', u'php-opencloud Documentation',
[u'Jamie Hannaford, Shaunak Kashyap'], 1)
示例11: file
highlight_language = "julia"
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "julia"
# 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
# documentation.
# html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [juliadoc.get_theme_dir(), sphinx_rtd_theme.get_html_theme_path()]
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
# html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
# html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
# html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
示例12:
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
# html_theme = 'default'
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = ["_themes", sphinx_rtd_theme.get_html_theme_path()]
# 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
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
示例13: navbar
napoleon_use_admonition_for_references = False
napoleon_use_ivar = False
napoleon_use_param = True
napoleon_use_rtype = True
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom themes here, relative to this
# directory.
html_theme_path = ['_themes'] + [sphinx_rtd_theme.get_html_theme_path()]
# (Optional) Logo. Should be small enough to fit the navbar (ideally 24x24).
# Path should be relative to the ``_static`` files directory.
html_logo = "phi.png"
# 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
# documentation.
# html_theme_options = {}
html_sidebars = {'**': ['localtoc.html']}
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
html_title = version + " documentation"
示例14: files
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
html_theme_path = ['_themes']
# 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
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
import sphinx_rtd_theme
html_static_path = [join(sphinx_rtd_theme.get_html_theme_path(), 'sphinx_rtd_theme', 'static')]
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
示例15: file
# The Theme MUST BE AN OPEN SOURCE SPHINX THEME. Contributors outside of
# Adfinis SyGroup AG must be able to build the documentation.
# Developers of Adfinis SyGroup AG can build the documentation using
# make html_adsy
# .. or ..
# make SPHINXOPTS="-D html_theme='adsy'" html
html_theme = 'adsy'
# 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
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [ 'adsy-sphinx-template.src/html', sphinx_rtd_theme.get_html_theme_path()]
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (relative to this directory) to use as a favicon of
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None