-
Is there a way to inject the contents of an external file from inside a docstring? Using pdoc I can do the following: def foo():
"""
Example usage:
```py
.. include:: ../code_examples/foo.py
```
Resulting output:
```
.. include:: ../code_examples/output.txt
```
"""
return "foo" Is something like like possible using mkdocstrings? I tried something using mkdocs-include-markdown-plugin but couldn't get it to work. |
Beta Was this translation helpful? Give feedback.
Answered by
pawamoy
Oct 1, 2023
Replies: 2 comments 2 replies
-
Can you show what you tried with mkdocs-include-markdown-plugin and why it didn't work? You could also try snippets. |
Beta Was this translation helpful? Give feedback.
2 replies
-
I'll look into snippets as well, thanks. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh, yeah, that's because docstrings do not pass through other MkDocs plugins, only Markdown extensions. Snippets will work better :)