Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f0cc92b

Browse files
authored
Merge pull request #14763 from alexrudy/deprecate-math-symbol-table-func-directive
Deprecate math_symbol_table function directive
2 parents 39375de + 959e420 commit f0cc92b

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

doc/sphinxext/math_symbol_table.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
from docutils.parsers.rst import Directive
2+
13
from matplotlib import mathtext
4+
from matplotlib import cbook
25

36

47
symbols = [
@@ -137,16 +140,26 @@ def get_n(n, l):
137140
return []
138141

139142

143+
@cbook.deprecated("3.2", alternative="MathSymbolTableDirective")
140144
def math_symbol_table_directive(
141145
name, arguments, options, content, lineno,
142146
content_offset, block_text, state, state_machine):
143147
return run(state_machine)
144148

145149

150+
class MathSymbolTableDirective(Directive):
151+
has_content = False
152+
required_arguments = 0
153+
optional_arguments = 0
154+
final_argument_whitespace = False
155+
option_spec = {}
156+
157+
def run(self):
158+
return run(self.state_machine)
159+
160+
146161
def setup(app):
147-
app.add_directive(
148-
'math_symbol_table', math_symbol_table_directive,
149-
False, (0, 1, 0))
162+
app.add_directive("math_symbol_table", MathSymbolTableDirective)
150163

151164
metadata = {'parallel_read_safe': True, 'parallel_write_safe': True}
152165
return metadata

0 commit comments

Comments
 (0)