Griffe Sphinx
Parse Sphinx-comments about attributes as docstrings.
Installation
pip install griffe-sphinx
Usage
Griffe Sphinx allows reading Sphinx doc comments related to attributes as docstrings.
# your_module.py
#: Summary of your attribute.
#:
#: This is a longer description of your attribute.
#: You can use any markup in here (Markdown, AsciiDoc, rST, etc.).
#:
#: Be careful with indented blocks: they need 4 spaces plus the initial 1-space indent, so 5.
#:
#: print("hello!")
your_attribute = "Hello Sphinx!"
This works for module attributes as well as class and instance attributes.
class Hello:
#: Summary of attribute.
attr1 = "hello"
def __init__(self):
#: Summary of attribute.
self.attr2 = "sphinx"
self.attr3: str #: Summary of attribute.
Trailing comments (appearing at the end of a line) are not supported for assignments spanning multiple lines.
You can now enable the extension when loading data with Griffe on the command-line, in Python code or with MkDocs.
On the command-line:
griffe dump your_package -e griffe_sphinx
In Python code:
import griffe
data = griffe.load("your_package", extensions=griffe.load_extensions("griffe_sphinx"))
With MkDocs:
plugins:
- mkdocstrings:
handlers:
python:
options:
extensions:
- griffe_sphinx
Sponsors
And 7 more private sponsor(s).
Metadata
Release files for griffe-sphinx 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| griffe_sphinx-0.3.0.tar.gz | 31.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| griffe_sphinx-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.6 kB
Release files / griffe_sphinx-0.3.0.tar.gz
| Download URL | griffe_sphinx-0.3.0.tar.gz |
|---|---|
| Size | 31.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8fec469cd17aa970bb8df8af1bd405be12423c03578932b22eb636fce23927c3
|
|
BLAKE2b-256 checksum How to use checksums |
c90e9503ddc07889905273223d9a1f1227459b0a62dc7c886443a265e3bf0f26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / griffe_sphinx-0.3.0-py3-none-any.whl
| Download URL | griffe_sphinx-0.3.0-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9a56d17e28b4affd9f1993d5411d3d5b143d5125a90e8bd0ffd51cb57f12057a
|
|
BLAKE2b-256 checksum How to use checksums |
628d8d92bf303bfeb76c0ddb0db6613bf9bf2e647f77935a46e0f2eb6c1b7e77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|