Skip to content

Commit 9ac68ed

Browse files
authored
Merge pull request #4178 from tk0miya/deprecate_string_for_html_sidebars
a single string value for ``html_sidebars`` will be deprecated in 2.0
2 parents 215be8e + 83c266a commit 9ac68ed

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ Incompatible changes
1515
Deprecated
1616
----------
1717

18+
* using a string value for :confval:`html_sidebars` is deprecated and only list
19+
values will be accepted at 2.0.
20+
1821
Features added
1922
--------------
2023

doc/config.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,10 @@ that use Sphinx's HTMLWriter class.
829829
between the ``'sourcelink.html'`` and ``'searchbox.html'`` entries. This
830830
is for compatibility with Sphinx versions before 1.0.
831831

832+
.. deprecated:: 1.7
833+
834+
a single string value for ``html_sidebars`` will be removed in 2.0
835+
832836
Builtin sidebar templates that can be rendered are:
833837

834838
* **localtoc.html** -- a fine-grained table of contents of the current

sphinx/builders/html.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,11 @@ def has_wildcard(pattern):
901901
# 0.x compatible mode: insert custom sidebar before searchbox
902902
customsidebar = sidebars
903903
sidebars = None
904+
warnings.warn('Now html_sidebars only allows list of sidebar '
905+
'templates as a value. Support for a string value '
906+
'will be removed at Sphinx-2.0.',
907+
RemovedInSphinx20Warning)
908+
904909
ctx['sidebars'] = sidebars
905910
ctx['customsidebar'] = customsidebar
906911

0 commit comments

Comments
 (0)