From 93081e2fce3a7795ddbc23fb4f1df9224f17d3fc Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 8 Feb 2019 17:03:09 +0000 Subject: 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 --- doc/development/tutorials/examples/helloworld.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/development/tutorials/examples/helloworld.py (limited to 'doc/development/tutorials/examples/helloworld.py') 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) -- cgit v1.2.1