sphinx/doc/development/tutorials/examples/helloworld.py
Stephen Finucane 93081e2fce 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>
2019-02-09 17:58:30 +00:00

14 lines
281 B
Python

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)