summaryrefslogtreecommitdiff
path: root/sphinx/directives/other.py
diff options
context:
space:
mode:
authorRobert Lehmann <mail@robertlehmann.de>2012-12-16 21:08:19 +0100
committerRobert Lehmann <mail@robertlehmann.de>2012-12-16 21:08:19 +0100
commit3813b1e3f351d36c30bc285c37859215b7cf58e7 (patch)
tree1cbe187aad773e3994cc557b1ffceb980fef408b /sphinx/directives/other.py
parentc4e8dfd718af805a9cff0e68cd6ef5d1cee965d2 (diff)
downloadsphinx-3813b1e3f351d36c30bc285c37859215b7cf58e7.tar.gz
Closes #960: Convert seealso directive to ordinary admonition.
Diffstat (limited to 'sphinx/directives/other.py')
-rw-r--r--sphinx/directives/other.py23
1 files changed, 3 insertions, 20 deletions
diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py
index 506d4be9..833ed12c 100644
--- a/sphinx/directives/other.py
+++ b/sphinx/directives/other.py
@@ -11,6 +11,7 @@ import os
from docutils import nodes
from docutils.parsers.rst import Directive, directives
+from docutils.parsers.rst.directives.admonitions import BaseAdmonition
from docutils.parsers.rst.directives.misc import Class
from docutils.parsers.rst.directives.misc import Include as BaseInclude
@@ -204,29 +205,11 @@ class VersionChange(Directive):
return ret
-class SeeAlso(Directive):
+class SeeAlso(BaseAdmonition):
"""
An admonition mentioning things to look at as reference.
"""
- has_content = True
- required_arguments = 0
- optional_arguments = 1
- final_argument_whitespace = True
- option_spec = {}
-
- def run(self):
- ret = make_admonition(
- addnodes.seealso, self.name, [_('See also')], self.options,
- self.content, self.lineno, self.content_offset, self.block_text,
- self.state, self.state_machine)
- if self.arguments:
- argnodes, msgs = self.state.inline_text(self.arguments[0],
- self.lineno)
- para = nodes.paragraph()
- para += argnodes
- para += msgs
- ret[0].insert(1, para)
- return ret
+ node_class = addnodes.seealso
class TabularColumns(Directive):