mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #5246: Add :confval:singlehtml_sidebars
to configure sidebars for singlehtml
This commit is contained in:
parent
b135e7ce4a
commit
f670a33f5b
2
CHANGES
2
CHANGES
@ -194,6 +194,8 @@ Features added
|
|||||||
* #4614: sphinx-build: Add ``--keep-going`` option to show all warnings
|
* #4614: sphinx-build: Add ``--keep-going`` option to show all warnings
|
||||||
* Add :rst:role:`math:numref` role to refer equations (Same as :rst:role:`eq`)
|
* Add :rst:role:`math:numref` role to refer equations (Same as :rst:role:`eq`)
|
||||||
* quickstart: epub builder is enabled by default
|
* quickstart: epub builder is enabled by default
|
||||||
|
* #5246: Add :confval:`singlehtml_sidebars` to configure sidebars for singlehtml
|
||||||
|
builder
|
||||||
|
|
||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
@ -1333,6 +1333,16 @@ that use Sphinx's HTMLWriter class.
|
|||||||
|
|
||||||
.. versionadded:: 1.6
|
.. versionadded:: 1.6
|
||||||
|
|
||||||
|
Options for Single HTML output
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
.. confval:: singlehtml_sidebars
|
||||||
|
|
||||||
|
Custom sidebar templates, must be a dictionary that maps document names to
|
||||||
|
template names. And it only allows a key named `'index'`. All other keys
|
||||||
|
are ignored. For more information, refer to :confval:`html_sidebars`. By
|
||||||
|
default, it is same as :confval:`html_sidebars`.
|
||||||
|
|
||||||
|
|
||||||
.. _htmlhelp-options:
|
.. _htmlhelp-options:
|
||||||
|
|
||||||
|
@ -1066,7 +1066,8 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
sidebars = [name.strip() for name in theme_default_sidebars.split(',')]
|
sidebars = [name.strip() for name in theme_default_sidebars.split(',')]
|
||||||
|
|
||||||
# user sidebar settings
|
# user sidebar settings
|
||||||
for pattern, patsidebars in iteritems(self.config.html_sidebars):
|
html_sidebars = self.get_builder_config('sidebars', 'html')
|
||||||
|
for pattern, patsidebars in iteritems(html_sidebars):
|
||||||
if patmatch(pagename, pattern):
|
if patmatch(pagename, pattern):
|
||||||
if matched:
|
if matched:
|
||||||
if has_wildcard(pattern):
|
if has_wildcard(pattern):
|
||||||
@ -1714,6 +1715,8 @@ def setup(app):
|
|||||||
app.add_config_value('html_baseurl', '', 'html')
|
app.add_config_value('html_baseurl', '', 'html')
|
||||||
app.add_config_value('html_math_renderer', None, 'env')
|
app.add_config_value('html_math_renderer', None, 'env')
|
||||||
|
|
||||||
|
app.add_config_value('singlehtml_sidebars', lambda self: self.html_sidebars, 'html')
|
||||||
|
|
||||||
# event handlers
|
# event handlers
|
||||||
app.connect('config-inited', convert_html_css_files)
|
app.connect('config-inited', convert_html_css_files)
|
||||||
app.connect('config-inited', convert_html_js_files)
|
app.connect('config-inited', convert_html_js_files)
|
||||||
|
Loading…
Reference in New Issue
Block a user