diff options
author | Pauli Virtanen <pav@iki.fi> | 2009-04-01 20:38:50 +0000 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2009-04-01 20:38:50 +0000 |
commit | 9a63ebd48281c994c39c374b5cdc960acb82963c (patch) | |
tree | 56b5d77ed9ff806e0ef422e261135d86830d09e4 | |
parent | 745ebc091aa6e761f9180964ae2c60e1caa92f9a (diff) | |
download | numpy-9a63ebd48281c994c39c374b5cdc960acb82963c.tar.gz |
sphinxext: Sphinx 0.6 compatibility and deprecation warnings
-rwxr-xr-x | doc/postprocess.py | 1 | ||||
-rw-r--r-- | doc/sphinxext/autosummary.py | 9 | ||||
-rw-r--r-- | doc/sphinxext/only_directives.py | 11 | ||||
-rw-r--r-- | doc/sphinxext/plot_directive.py | 6 |
4 files changed, 25 insertions, 2 deletions
diff --git a/doc/postprocess.py b/doc/postprocess.py index 1c6ef1b2e..b7f912efe 100755 --- a/doc/postprocess.py +++ b/doc/postprocess.py @@ -44,6 +44,7 @@ def process_tex(lines): """ new_lines = [] for line in lines: + line = unicode(line, 'utf-8').replace(u"\00a0", u"~").encode('utf-8') if (line.startswith(r'\section{numpy.') or line.startswith(r'\subsection{numpy.') or line.startswith(r'\subsubsection{numpy.') diff --git a/doc/sphinxext/autosummary.py b/doc/sphinxext/autosummary.py index c32953ff5..f7e9a1291 100644 --- a/doc/sphinxext/autosummary.py +++ b/doc/sphinxext/autosummary.py @@ -56,11 +56,17 @@ from docutils.parsers.rst import directives from docutils.statemachine import ViewList from docutils import nodes -import sphinx.addnodes, sphinx.roles, sphinx.builder +import sphinx.addnodes, sphinx.roles from sphinx.util import patfilter from docscrape_sphinx import get_doc_object +import warnings +warnings.warn("This autosummary extension will be eventually moved to " + "sphinx.ext.autosummary. One version is already available in " + "Sphinx >= 0.6; expect this module to be deprecated after all " + "remaining features have been integrated there.", + FutureWarning, stacklevel=2) def setup(app): app.add_directive('autosummary', autosummary_directive, True, (0, 0, False), @@ -161,6 +167,7 @@ def autosummary_directive(dirname, arguments, options, content, lineno, tocnode['includefiles'] = docnames tocnode['maxdepth'] = -1 tocnode['glob'] = None + tocnode['entries'] = [(None, docname) for docname in docnames] tocnode = autosummary_toc('', '', tocnode) return warnings + [node] + [tocnode] diff --git a/doc/sphinxext/only_directives.py b/doc/sphinxext/only_directives.py index e4dfd5cc7..c25760ad0 100644 --- a/doc/sphinxext/only_directives.py +++ b/doc/sphinxext/only_directives.py @@ -5,7 +5,16 @@ from docutils.nodes import Body, Element from docutils.writers.html4css1 import HTMLTranslator -from sphinx.latexwriter import LaTeXTranslator +try: + from sphinx.latexwriter import LaTeXTranslator +except ImportError: + from sphinx.writers.latex import LaTeXTranslator + + import warnings + warnings.warn("The only_directives module is deprecated; please use " + "the only:: directive available in Sphinx >= 0.6", + DeprecationWarning, stacklevel=2) + from docutils.parsers.rst import directives class html_only(Body, Element): diff --git a/doc/sphinxext/plot_directive.py b/doc/sphinxext/plot_directive.py index 6b5ff6eaf..74bd7a24b 100644 --- a/doc/sphinxext/plot_directive.py +++ b/doc/sphinxext/plot_directive.py @@ -74,6 +74,12 @@ TODO import sys, os, glob, shutil, imp, warnings, cStringIO, re, textwrap +import warnings +warnings.warn("A plot_directive module is also available under " + "matplotlib.sphinxext; expect this module to be deprecated " + "after relevant features have been integrated there.", + FutureWarning, stacklevel=2) + def setup(app): setup.app = app setup.config = app.config |