from docutils import nodes from docutils.parsers.rst import Directive class D2langDirective(Directive): def run(self): paragraph_node = nodes.paragraph(text="""BobBobAliceAlicehello""") return [paragraph_node]