mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Use the correct style name.
This commit is contained in:
parent
4480cadccc
commit
9673be44f3
@ -136,6 +136,11 @@ class StandaloneHTMLBuilder(Builder):
|
||||
if self.config.html_use_modindex and self.env.modules:
|
||||
rellinks.append(('modindex', _('Global Module Index'), 'M', _('modules')))
|
||||
|
||||
if self.config.html_style is not None:
|
||||
stylename = self.config.html_style
|
||||
else:
|
||||
stylename = self.theme.get_confstr('theme', 'stylesheet')
|
||||
|
||||
self.globalcontext = dict(
|
||||
embedded = self.embedded,
|
||||
project = self.config.project,
|
||||
@ -144,7 +149,6 @@ class StandaloneHTMLBuilder(Builder):
|
||||
last_updated = self.last_updated,
|
||||
copyright = self.config.copyright,
|
||||
master_doc = self.config.master_doc,
|
||||
style = self.config.html_style,
|
||||
use_opensearch = self.config.html_use_opensearch,
|
||||
docstitle = self.config.html_title,
|
||||
shorttitle = self.config.html_short_title,
|
||||
@ -154,6 +158,7 @@ class StandaloneHTMLBuilder(Builder):
|
||||
file_suffix = self.out_suffix,
|
||||
script_files = self.script_files,
|
||||
sphinx_version = __version__,
|
||||
style = stylename,
|
||||
rellinks = rellinks,
|
||||
builder = self.name,
|
||||
parents = [],
|
||||
|
@ -59,7 +59,7 @@ class Config(object):
|
||||
(self.project, self.release),
|
||||
False),
|
||||
html_short_title = (lambda self: self.html_title, False),
|
||||
html_style = ('default.css', False), # XXX
|
||||
html_style = (None, False),
|
||||
html_logo = (None, False),
|
||||
html_favicon = (None, False),
|
||||
html_static_path = ([], False),
|
||||
|
@ -46,14 +46,18 @@ class Theme(object):
|
||||
|
||||
def __init__(self, name):
|
||||
if name not in self.themes:
|
||||
raise ThemeError('no theme named %r found' % name)
|
||||
raise ThemeError('no theme named %r found '
|
||||
'(missing theme.conf?)' % name)
|
||||
self.name = name
|
||||
self.themedir = self.themes[name]
|
||||
|
||||
self.themeconf = ConfigParser.RawConfigParser()
|
||||
self.themeconf.read(path.join(self.themedir, THEMECONF))
|
||||
|
||||
inherit = self.themeconf.get('theme', 'inherit')
|
||||
try:
|
||||
inherit = self.themeconf.get('theme', 'inherit')
|
||||
except ConfigParser.NoOptionError:
|
||||
raise ThemeError('theme %r doesn\'t have "inherit" setting' % name)
|
||||
if inherit == 'none':
|
||||
self.base = None
|
||||
elif inherit not in self.themes:
|
||||
@ -62,6 +66,14 @@ class Theme(object):
|
||||
else:
|
||||
self.base = Theme(inherit)
|
||||
|
||||
def get_confstr(self, section, name):
|
||||
try:
|
||||
return self.themeconf.get(section, name)
|
||||
except ConfigParser.NoOptionError:
|
||||
if self.base is not None:
|
||||
return self.base.get_confstr(section, name)
|
||||
raise
|
||||
|
||||
def get_dirchain(self):
|
||||
"""
|
||||
Return a list of theme directories, beginning with this theme's,
|
||||
|
Loading…
Reference in New Issue
Block a user