mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fixes #1884: plug-in html themes cannot inherit another plug-in theme
Closes #1885: A part of code for this fix is from pull requeest #1885. refs #1794
This commit is contained in:
parent
f0c390493b
commit
9d0ce7a6c1
2
CHANGES
2
CHANGES
@ -65,6 +65,8 @@ Bugs fixed
|
||||
using `any` role and `sphinx.ext.intersphinx` in same time.
|
||||
* #2121: multiple words search doesn't find pages when words across on the page title and
|
||||
the page content.
|
||||
* #1884, #1885: plug-in html themes cannot inherit another plug-in theme. Thanks to
|
||||
Suzumizaki.
|
||||
|
||||
Release 1.3.1 (released Mar 17, 2015)
|
||||
=====================================
|
||||
|
@ -136,9 +136,8 @@ class Theme(object):
|
||||
except configparser.NoOptionError:
|
||||
raise ThemeError('theme %r doesn\'t have "inherit" setting' % name)
|
||||
|
||||
if inherit in ['alabaster', 'sphinx_rtd_theme']:
|
||||
# include 'alabaster' or 'sphinx_themes' automatically #1794
|
||||
self.load_extra_theme(inherit)
|
||||
# load inherited theme automatically #1794, #1884, #1885
|
||||
self.load_extra_theme(inherit)
|
||||
|
||||
if inherit == 'none':
|
||||
self.base = None
|
||||
|
@ -0,0 +1,2 @@
|
||||
[theme]
|
||||
inherit = basic
|
@ -0,0 +1,2 @@
|
||||
[theme]
|
||||
inherit = base_theme1
|
7
tests/roots/test-double-inheriting-theme/conf.py
Normal file
7
tests/roots/test-double-inheriting-theme/conf.py
Normal file
@ -0,0 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys, os
|
||||
|
||||
templates_path = ['_templates']
|
||||
master_doc = 'index'
|
||||
html_theme = 'base_theme2'
|
3
tests/roots/test-double-inheriting-theme/index.rst
Normal file
3
tests/roots/test-double-inheriting-theme/index.rst
Normal file
@ -0,0 +1,3 @@
|
||||
============================
|
||||
Test double inheriting theme
|
||||
============================
|
@ -14,7 +14,7 @@ import zipfile
|
||||
|
||||
from sphinx.theming import Theme, ThemeError
|
||||
|
||||
from util import with_app, raises, TestApp
|
||||
from util import with_app, raises, mock, path
|
||||
|
||||
|
||||
@with_app(confoverrides={'html_theme': 'ziptheme',
|
||||
@ -79,3 +79,19 @@ def test_js_source(app, status, warning):
|
||||
assert 'Underscore.js {v}'.format(v=v) in underscore_min, msg
|
||||
underscore_src = (app.outdir / '_static' / 'underscore-{v}.js'.format(v=v)).text()
|
||||
assert 'Underscore.js {v}'.format(v=v) in underscore_src, msg
|
||||
|
||||
|
||||
def test_double_inheriting_theme():
|
||||
from sphinx.theming import load_theme_plugins # load original before patching
|
||||
|
||||
def load_themes():
|
||||
roots = path(__file__).abspath().parent / 'roots'
|
||||
yield roots / 'test-double-inheriting-theme' / 'base_themes_dir'
|
||||
for t in load_theme_plugins():
|
||||
yield t
|
||||
|
||||
@mock.patch('sphinx.theming.load_theme_plugins', side_effect=load_themes)
|
||||
@with_app(testroot='double-inheriting-theme')
|
||||
def test_double_inheriting_theme_(app, status, warning, m_):
|
||||
pass
|
||||
yield test_double_inheriting_theme_
|
||||
|
Loading…
Reference in New Issue
Block a user