diff options
| author | Georg Brandl <georg@python.org> | 2010-01-07 17:56:09 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2010-01-07 17:56:09 +0100 |
| commit | cbfa4e8acfa7ec1b81dbac4afca8b498ef96569a (patch) | |
| tree | 1e9354e3f8e01164bddf751f2a02858e1c2d2c77 /tests | |
| parent | 6aaac900333341f58ca319ee0850e20af4214093 (diff) | |
| download | sphinx-cbfa4e8acfa7ec1b81dbac4afca8b498ef96569a.tar.gz | |
The ``html_sidebars`` config value can now contain patterns as keys, and the values can be lists that explicitly select which sidebar templates should be rendered.
That means that the builtin sidebar contents can be included only selectively.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/root/_templates/contentssb.html | 2 | ||||
| -rw-r--r-- | tests/root/_templates/customsb.html | 2 | ||||
| -rw-r--r-- | tests/root/conf.py | 2 | ||||
| -rw-r--r-- | tests/test_build_html.py | 4 |
4 files changed, 9 insertions, 1 deletions
diff --git a/tests/root/_templates/contentssb.html b/tests/root/_templates/contentssb.html new file mode 100644 index 00000000..9951d3c3 --- /dev/null +++ b/tests/root/_templates/contentssb.html @@ -0,0 +1,2 @@ +{# sidebar only for contents document #} +<h4>Contents sidebar</h4>
\ No newline at end of file diff --git a/tests/root/_templates/customsb.html b/tests/root/_templates/customsb.html new file mode 100644 index 00000000..cc88b8cf --- /dev/null +++ b/tests/root/_templates/customsb.html @@ -0,0 +1,2 @@ +{# custom sidebar template #} +<h4>Custom sidebar</h4> diff --git a/tests/root/conf.py b/tests/root/conf.py index 88091877..a3783511 100644 --- a/tests/root/conf.py +++ b/tests/root/conf.py @@ -31,7 +31,7 @@ rst_epilog = '.. |subst| replace:: global substitution' html_theme = 'testtheme' html_theme_path = ['.'] html_theme_options = {'testopt': 'testoverride'} - +html_sidebars = {'**': 'customsb.html', 'contents': 'contentssb.html'} html_style = 'default.css' html_static_path = ['_static', 'templated.css_t'] html_last_updated_fmt = '%b %d, %Y' diff --git a/tests/test_build_html.py b/tests/test_build_html.py index 37d57dd5..e8189e67 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -86,6 +86,8 @@ HTML_XPATH = { ".//dl[@class='userdesc']": '', ".//dt[@id='userdescrole-myobj']": '', ".//a[@href='#userdescrole-myobj']": '', + # custom sidebar + ".//h4": 'Custom sidebar', }, 'contents.html': { ".//meta[@name='hc'][@content='hcval']": '', @@ -98,6 +100,8 @@ HTML_XPATH = { ".//title": 'Sphinx <Tests>', ".//div[@class='footer']": 'Georg Brandl & Team', ".//a[@href='http://python.org/']": '', + # custom sidebar only for contents + ".//h4": 'Contents sidebar', }, 'bom.html': { ".//title": " File with UTF-8 BOM", |
