mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
This type alias has now been fully documented for public consumption. This will be beneficial to the sphinx ecosystem, to aide/encourage extension developers to provide the correct metadata. Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
22 lines
516 B
Python
22 lines
516 B
Python
from docutils import nodes
|
|
from docutils.parsers.rst import Directive
|
|
|
|
from sphinx.application import Sphinx
|
|
from sphinx.util.typing import ExtensionMetadata
|
|
|
|
|
|
class HelloWorld(Directive):
|
|
def run(self):
|
|
paragraph_node = nodes.paragraph(text='Hello World!')
|
|
return [paragraph_node]
|
|
|
|
|
|
def setup(app: Sphinx) -> ExtensionMetadata:
|
|
app.add_directive('helloworld', HelloWorld)
|
|
|
|
return {
|
|
'version': '0.1',
|
|
'parallel_read_safe': True,
|
|
'parallel_write_safe': True,
|
|
}
|