File: extensions.md

package info (click to toggle)
mkdocstrings-python-handlers 1.16.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,228 kB
  • sloc: python: 3,496; javascript: 84; makefile: 37; sh: 17
file content (17 lines) | stat: -rw-r--r-- 648 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Extensions

## :warning: Work in Progress!

The Python handler supports extensions through
[*mkdocstrings*' handler extensions](https://mkdocstrings.github.io/usage/handlers/#handler-extensions).

Specifically, additional templates can be added to the handler,
and Griffe extensions can instruct the handler to use a particular template
for a particular object by setting a value in the Griffe object's `extra` dictionary:

```python title="griffe_extension.py"
obj = ...  # get a reference to a Griffe object
if "mkdocstrings" not in obj.extra:
    obj.extra["mkdocstrings"] = {}
obj.extra["mkdocstrings"]["template"] = "template_name.html"
```