sphinxnotes-any¶
Introduction¶
The extension provides a domain which allows user creates directive and roles
to descibe, reference and index arbitrary object in documentation.
It is a bit like sphinx.application.Sphinx.add_object_type(),
but more powerful.
Getting Started¶
Note
We assume you already have a Sphinx documentation, if not, see Getting Started with Sphinx.
First, downloading extension from PyPI:
$ pip install sphinxnotes-any
Then, add the extension name to extensions configuration item in your
conf.py:
extensions = [
# …
'sphinxnotes.any',
# …
]
Add the such a “cat” dict in your conf.py:
cat = {
'schema': {
'name': 'str, ref, uniq',
'attrs': {
'color': 'str, ref',
},
'content': 'str'
},
'templates': {
'obj':"Hi there, human! I've got **{{ color }}** fur.",
'header': '🐈 {{ name }}',
'ref': '``🐈 {{ name }}``',
}
}
And add it to the any_object_types confval:
any_object_types = {
'cat': cat,
}
Then you can document a cat using the any:cat directive:
.. any:cat:: mimi
:color: black
- 🐈 mimi¶
Hi there, human! I’ve got black fur.
And reference a the cat with any:cat:
Hi :any:cat:`mimi`! I am here!
Hi 🐈 mimi! I am here!
Please refer to Usage for more details.
Contents¶
Contents
The Sphinx Notes Project¶
The project is developed by Shengyu Zhang, as part of The Sphinx Notes Project.