|
From: <md...@us...> - 2009-09-08 14:30:23
|
Revision: 7710
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7710&view=rev
Author: mdboom
Date: 2009-09-08 14:30:16 +0000 (Tue, 08 Sep 2009)
Log Message:
-----------
Update math_symbol_table directive to new Sphinx extension API
Modified Paths:
--------------
trunk/matplotlib/doc/sphinxext/math_symbol_table.py
Modified: trunk/matplotlib/doc/sphinxext/math_symbol_table.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/math_symbol_table.py 2009-09-08 12:13:44 UTC (rev 7709)
+++ trunk/matplotlib/doc/sphinxext/math_symbol_table.py 2009-09-08 14:30:16 UTC (rev 7710)
@@ -1,4 +1,4 @@
-symbols = [
+nsymbols = [
["Lower-case Greek",
5,
r"""\alpha \beta \gamma \chi \delta \epsilon \eta \iota \kappa
@@ -128,27 +128,17 @@
state_machine.insert_input(lines, "Symbol table")
return []
-try:
- from docutils.parsers.rst import Directive
-except ImportError:
- from docutils.parsers.rst.directives import _directives
+def setup(app):
def math_symbol_table_directive(name, arguments, options, content, lineno,
content_offset, block_text, state, state_machine):
return run(state_machine)
math_symbol_table_directive.arguments = None
math_symbol_table_directive.options = {}
math_symbol_table_directive.content = False
- _directives['math_symbol_table'] = math_symbol_table_directive
-else:
- class math_symbol_table_directive(Directive):
- has_content = False
- def run(self):
- return run(self.state_machine)
- from docutils.parsers.rst import directives
- directives.register_directive('math_symbol_table',
- math_symbol_table_directive)
+ app.add_directive('math_symbol_table',
+ math_symbol_table_directive)
-if __name__ == "__main__":
+if __name__ == '__main__':
# Do some verification of the tables
from matplotlib import _mathtext_data
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|