aboutsummaryrefslogtreecommitdiffstats
path: root/docs/source/mgext/youcanhelp.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-07-31 20:53:29 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-07-31 20:53:29 -0500
commitbfb280d3b3cdb801adda381cdf47f96e5b936526 (patch)
treece3782dd40e5502eeaaf8a2e056cced30cd3e9f2 /docs/source/mgext/youcanhelp.py
parent5d9006479088ecadcc4dcef14a9d8ccb0e4227f3 (diff)
parentfd857e219fbf3cd1671ce4971e67d57207af18bc (diff)
downloadmediagoblin-bfb280d3b3cdb801adda381cdf47f96e5b936526.tar.lz
mediagoblin-bfb280d3b3cdb801adda381cdf47f96e5b936526.tar.xz
mediagoblin-bfb280d3b3cdb801adda381cdf47f96e5b936526.zip
Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin
Diffstat (limited to 'docs/source/mgext/youcanhelp.py')
-rw-r--r--docs/source/mgext/youcanhelp.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/docs/source/mgext/youcanhelp.py b/docs/source/mgext/youcanhelp.py
new file mode 100644
index 00000000..a99d0e4d
--- /dev/null
+++ b/docs/source/mgext/youcanhelp.py
@@ -0,0 +1,44 @@
+from docutils import nodes
+
+from sphinx.util.compat import Directive, make_admonition
+
+class youcanhelp_node(nodes.Admonition, nodes.Element):
+ pass
+
+class YouCanHelp(Directive):
+ has_content = True
+ required_arguments = 0
+ optional_arguments = 0
+ final_argument_whitespace = False
+ option_spec = {}
+
+ def run(self):
+ ad = make_admonition(
+ youcanhelp_node,
+ self.name,
+ ["You Can Help!"],
+ self.options,
+ self.content,
+ self.lineno,
+ self.content_offset,
+ self.block_text,
+ self.state,
+ self.state_machine)
+ ad[0].line = self.lineno
+ return ad
+
+def visit_youcanhelp_node(self, node):
+ self.visit_admonition(node)
+
+def depart_youcanhelp_node(self, node):
+ self.depart_admonition(node)
+
+def setup(app):
+ app.add_node(
+ youcanhelp_node,
+ html=(visit_youcanhelp_node, depart_youcanhelp_node),
+ latex=(visit_youcanhelp_node, depart_youcanhelp_node),
+ text=(visit_youcanhelp_node, depart_youcanhelp_node)
+ )
+
+ app.add_directive('youcanhelp', YouCanHelp)