Skip to content
Discussion options

You must be logged in to vote

Hi @kattni!

  1. No, there isn't. mkdocstrings only ever extracts data from Python files or stubs, thanks to Griffe, and doesn't have any directive to render data manually.
  2. An extension in the sense of a Griffe extension, no. But I can think of a script executed by mkdocs-gen-files, or maybe a simple MkDocs hook, that would use Griffe to inject fake data into the Python handler collected modules, which you could then render naturally. I'll show an example below.
  3. Answered in 2.
# scripts/inject_mkdocstrings_data.py
import griffe
import mkdocs_gen_files

python_handler = mkdocs_gen_files.config.plugins["mkdocstrings"].get_handler("python")

with griffe.temporary_visited_package(
    "your_pack…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@kattni
Comment options

@pawamoy
Comment options

@kattni
Comment options

Answer selected by kattni
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants