diff options
| author | Georg Brandl <georg@python.org> | 2014-01-13 00:14:00 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2014-01-13 00:14:00 +0100 |
| commit | 8aec27617e3ba2bf13ba9f96bb6fa57602f13b91 (patch) | |
| tree | b5a8bfe70f7ecd52ba3d64a19c375a5b8ac6288d /sphinx/ext | |
| parent | 0ce3e1b81e8105ccf99e497b6c82c1ef8d9201ba (diff) | |
| parent | dd1c23518d9f91edeb5a19e796a5be2700c93f34 (diff) | |
| download | sphinx-8aec27617e3ba2bf13ba9f96bb6fa57602f13b91.tar.gz | |
merge with stable
Diffstat (limited to 'sphinx/ext')
| -rw-r--r-- | sphinx/ext/autosummary/generate.py | 17 | ||||
| -rw-r--r-- | sphinx/ext/mathbase.py | 4 |
2 files changed, 20 insertions, 1 deletions
diff --git a/sphinx/ext/autosummary/generate.py b/sphinx/ext/autosummary/generate.py index 0640a332..f45aa085 100644 --- a/sphinx/ext/autosummary/generate.py +++ b/sphinx/ext/autosummary/generate.py @@ -33,6 +33,21 @@ from sphinx.jinja2glue import BuiltinTemplateLoader from sphinx.util.osutil import ensuredir from sphinx.util.inspect import safe_getattr +# Add documenters to AutoDirective registry +from sphinx.ext.autodoc import add_documenter, \ + ModuleDocumenter, ClassDocumenter, ExceptionDocumenter, DataDocumenter, \ + FunctionDocumenter, MethodDocumenter, AttributeDocumenter, \ + InstanceAttributeDocumenter +add_documenter(ModuleDocumenter) +add_documenter(ClassDocumenter) +add_documenter(ExceptionDocumenter) +add_documenter(DataDocumenter) +add_documenter(FunctionDocumenter) +add_documenter(MethodDocumenter) +add_documenter(AttributeDocumenter) +add_documenter(InstanceAttributeDocumenter) + + def main(argv=sys.argv): usage = """%prog [OPTIONS] SOURCEFILE ...""" p = optparse.OptionParser(usage.strip()) @@ -101,7 +116,7 @@ def generate_autosummary_docs(sources, output_dir=None, suffix='.rst', new_files = [] # write - for name, path, template_name in sorted(items): + for name, path, template_name in sorted(items, key=str): if path is None: # The corresponding autosummary:: directive did not have # a :toctree: option diff --git a/sphinx/ext/mathbase.py b/sphinx/ext/mathbase.py index b7d0d997..0c5eaf8b 100644 --- a/sphinx/ext/mathbase.py +++ b/sphinx/ext/mathbase.py @@ -30,11 +30,15 @@ def wrap_displaymath(math, label): parts = math.split('\n\n') ret = [] for i, part in enumerate(parts): + if not part.strip(): + continue if label is not None and i == 0: ret.append('\\begin{split}%s\\end{split}' % part + (label and '\\label{'+label+'}' or '')) else: ret.append('\\begin{split}%s\\end{split}\\notag' % part) + if not ret: + return '' return '\\begin{gather}\n' + '\\\\'.join(ret) + '\n\\end{gather}' |
