mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Some miscellaneous fixes.
This commit is contained in:
@@ -44,7 +44,7 @@ class ExtensionError(Exception):
|
||||
return self.message
|
||||
|
||||
|
||||
# List of all known events. Maps name to arguments description.
|
||||
# List of all known core events. Maps name to arguments description.
|
||||
events = {
|
||||
'builder-inited': '',
|
||||
'doctree-read' : 'the doctree before being pickled',
|
||||
@@ -68,6 +68,8 @@ class Sphinx(object):
|
||||
self._warning = warning
|
||||
self._warncount = 0
|
||||
|
||||
self._events = events.copy()
|
||||
|
||||
# read config
|
||||
self.config = Config(srcdir, 'conf.py')
|
||||
if confoverrides:
|
||||
@@ -137,7 +139,7 @@ class Sphinx(object):
|
||||
|
||||
def _validate_event(self, event):
|
||||
event = intern(event)
|
||||
if event not in events:
|
||||
if event not in self._events:
|
||||
raise ExtensionError('Unknown event name: %s' % event)
|
||||
|
||||
def connect(self, event, callback):
|
||||
@@ -173,17 +175,22 @@ class Sphinx(object):
|
||||
|
||||
def add_config_value(self, name, default, rebuild_env):
|
||||
if name in self.config.values:
|
||||
raise ExtensionError('Config value %r already present')
|
||||
raise ExtensionError('Config value %r already present' % name)
|
||||
self.config.values[name] = (default, rebuild_env)
|
||||
|
||||
def add_event(self, name):
|
||||
if name in self._events:
|
||||
raise ExtensionError('Event %r already present' % name)
|
||||
self._events[name] = ''
|
||||
|
||||
def add_node(self, node):
|
||||
nodes._add_node_class_names([node.__name__])
|
||||
|
||||
def add_directive(self, name, cls, content, arguments, **options):
|
||||
cls.content = content
|
||||
cls.arguments = arguments
|
||||
cls.options = options
|
||||
directives.register_directive(name, cls)
|
||||
def add_directive(self, name, func, content, arguments, **options):
|
||||
func.content = content
|
||||
func.arguments = arguments
|
||||
func.options = options
|
||||
directives.register_directive(name, func)
|
||||
|
||||
def add_role(self, name, role):
|
||||
roles.register_canonical_role(name, role)
|
||||
|
||||
@@ -138,7 +138,7 @@ htmlhelp_basename = '%(project)sdoc'
|
||||
#latex_documents = []
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#latex_preamble = '
|
||||
#latex_preamble = ''
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
|
||||
@@ -264,13 +264,10 @@ div.sidebar h4, div.sidebar h3 {
|
||||
|
||||
div.sidebar ul {
|
||||
padding-left: 1.5em;
|
||||
margin-top: 7px;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
line-height: 110%;
|
||||
}
|
||||
|
||||
div.sidebar ul li {
|
||||
margin-bottom: 7px;
|
||||
line-height: 130%;
|
||||
}
|
||||
|
||||
div.sidebar ul ul {
|
||||
@@ -448,7 +445,7 @@ a.headerlink {
|
||||
font-size: 1em;
|
||||
margin-left: 6px;
|
||||
padding: 0 4px 0 4px;
|
||||
text-decoration: none;
|
||||
text-decoration: none!important;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,10 +73,13 @@
|
||||
<li class="right"><a href="{{ pathto('settings') }}"
|
||||
title="Customize your viewing settings" accesskey="S">settings</a> |</li>
|
||||
{%- endif %}
|
||||
<li><a href="{{ pathto('index') }}">{{ project }} v{{ release }} Documentation</a> »</li>
|
||||
{%- block rootrellink %}
|
||||
<li><a href="{{ pathto('index') }}">{{ project }} v{{ release }} documentation</a> »</li>
|
||||
{%- endblock %}
|
||||
{%- for parent in parents %}
|
||||
<li><a href="{{ parent.link|e }}" accesskey="U">{{ parent.title }}</a> »</li>
|
||||
{%- endfor %}
|
||||
{%- block relbaritems %}{% endblock %}
|
||||
</ul>
|
||||
</div>
|
||||
{%- endblock %}
|
||||
|
||||
Reference in New Issue
Block a user