summaryrefslogtreecommitdiff
path: root/doc/development/tutorials/examples/helloworld.py
diff options
context:
space:
mode:
authorStephen Finucane <stephen@that.guru>2019-02-08 17:03:09 +0000
committerStephen Finucane <stephen@that.guru>2019-02-09 17:58:30 +0000
commit93081e2fce3a7795ddbc23fb4f1df9224f17d3fc (patch)
tree8f871af32ab165a1f56ecb08e4f2e8914eacbffa /doc/development/tutorials/examples/helloworld.py
parent513d99c316055f63d77aa3c2c1b9ec73b277d426 (diff)
downloadsphinx-git-93081e2fce3a7795ddbc23fb4f1df9224f17d3fc.tar.gz
doc: Use 'literalinclude' directive for examples
This avoid duplication and could conceivably let us test this stuff in code later on. Signed-off-by: Stephen Finucane <stephen@that.guru>
Diffstat (limited to 'doc/development/tutorials/examples/helloworld.py')
-rw-r--r--doc/development/tutorials/examples/helloworld.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/development/tutorials/examples/helloworld.py b/doc/development/tutorials/examples/helloworld.py
new file mode 100644
index 000000000..66ab3295d
--- /dev/null
+++ b/doc/development/tutorials/examples/helloworld.py
@@ -0,0 +1,13 @@
+from docutils import nodes
+from docutils.parsers.rst import Directive
+
+
+class HelloWorld(Directive):
+
+ def run(self):
+ paragraph_node = nodes.paragraph(text='Hello World!')
+ return [paragraph_node]
+
+
+def setup(app):
+ app.add_directive("helloworld", HelloWorld)