diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2017-05-17 14:55:21 -0700 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2017-05-17 16:55:21 -0500 |
commit | 99ebc227db0de7258309f3e236ebd3d0846f163e (patch) | |
tree | 3e047796b3887188683277f0ec1465689d66aa02 | |
parent | c1f916918103d4a5436dda8972fc4a21bf05fb12 (diff) | |
download | cryptography-99ebc227db0de7258309f3e236ebd3d0846f163e.tar.gz cryptography-99ebc227db0de7258309f3e236ebd3d0846f163e.tar.bz2 cryptography-99ebc227db0de7258309f3e236ebd3d0846f163e.zip |
Make the code compatible with the latest sphinx release (#3543)
-rw-r--r-- | docs/cryptography-docs.py | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/docs/cryptography-docs.py b/docs/cryptography-docs.py index 6aa7847d..56baf127 100644 --- a/docs/cryptography-docs.py +++ b/docs/cryptography-docs.py @@ -6,7 +6,7 @@ from __future__ import absolute_import, division, print_function from docutils import nodes -from sphinx.util.compat import Directive, make_admonition +from sphinx.util.compat import Directive DANGER_MESSAGE = """ @@ -29,20 +29,11 @@ class HazmatDirective(Directive): if self.content: message += DANGER_ALTERNATE.format(alternate=self.content[0]) - ad = make_admonition( - Hazmat, - self.name, - [], - self.options, - nodes.paragraph("", message), - self.lineno, - self.content_offset, - self.block_text, - self.state, - self.state_machine - ) - ad[0].line = self.lineno - return ad + content = nodes.paragraph("", message) + admonition_node = Hazmat("\n".join(content)) + self.state.nested_parse(content, self.content_offset, admonition_node) + admonition_node.line = self.lineno + return [admonition_node] class Hazmat(nodes.Admonition, nodes.Element): |