|
1 | | -symbols = [ |
| 1 | +nsymbols = [ |
2 | 2 | ["Lower-case Greek", |
3 | 3 | 5, |
4 | 4 | r"""\alpha \beta \gamma \chi \delta \epsilon \eta \iota \kappa |
@@ -128,27 +128,17 @@ def get_n(n, l): |
128 | 128 | state_machine.insert_input(lines, "Symbol table") |
129 | 129 | return [] |
130 | 130 |
|
131 | | -try: |
132 | | - from docutils.parsers.rst import Directive |
133 | | -except ImportError: |
134 | | - from docutils.parsers.rst.directives import _directives |
| 131 | +def setup(app): |
135 | 132 | def math_symbol_table_directive(name, arguments, options, content, lineno, |
136 | 133 | content_offset, block_text, state, state_machine): |
137 | 134 | return run(state_machine) |
138 | 135 | math_symbol_table_directive.arguments = None |
139 | 136 | math_symbol_table_directive.options = {} |
140 | 137 | math_symbol_table_directive.content = False |
141 | | - _directives['math_symbol_table'] = math_symbol_table_directive |
142 | | -else: |
143 | | - class math_symbol_table_directive(Directive): |
144 | | - has_content = False |
145 | | - def run(self): |
146 | | - return run(self.state_machine) |
147 | | - from docutils.parsers.rst import directives |
148 | | - directives.register_directive('math_symbol_table', |
149 | | - math_symbol_table_directive) |
| 138 | + app.add_directive('math_symbol_table', |
| 139 | + math_symbol_table_directive) |
150 | 140 |
|
151 | | -if __name__ == "__main__": |
| 141 | +if __name__ == '__main__': |
152 | 142 | # Do some verification of the tables |
153 | 143 | from matplotlib import _mathtext_data |
154 | 144 |
|
|
0 commit comments