To render code blocks in admonitions, you need to add the pymdownx.superfences extensions to the list of Markdown extensions in mkdocs.yml. For example:
For code blocks in docstrings, make sure to escape newlines (\n -> \\n), or prefix the entire docstring with 'r' to make it a raw-docstring: r""". Indeed, docstrings are still strings and therefore subject to how Python parses strings.
Before version 0.14, footnotes could be duplicated over a page. Please upgrade to version 0.14 or higher.
See also:
A warning like this one:
WARNING - Documentation file 'reference/parsers/docstrings.md' contains a link to 'reference/parsers/pytkdocs.parsers.docstrings.Section' which is not found in the documentation files.
...generally means you used parentheses () instead of brackets [] for a cross-reference. Notice the dots in reference/parsers/pytkdocs.parsers.docstrings.Section? It shows that it's probably a cross-reference, not a direct link. It's probably written like [Section](pytkdocs.parsers.docstrings.Section) in the docs, when it should be [Section][pytkdocs.parsers.docstrings.Section].
Before version 0.14, multiple tab blocks injected on the same page would result in broken links: clicking on a tab would bring the user to the wrong one. Please upgrade to version 0.14 or higher.
See also:
If you are stuck on a version before 0.14, and want to use multiple tab blocks in one page, use this workaround.
JavaScript workaroundPut the following code in a .js file, and list it in MkDocs' extra_javascript:
This code will correctly reset the IDs for tabs on a same page.
Please open an ticket on the bugtracker with a detailed explanation and screenshots of the bad-looking parts. Note that you can always customize the look of mkdocstrings blocks -- through both HTML and CSS.
New in version 0.15
Cross-linking used to include any Markdown heading, but now it's only for mkdocstrings identifiers by default. See Cross-references to any Markdown heading to opt back in.
Make sure the referenced object is properly rendered: verify your configuration options.
For false-positives, you can wrap the text in backticks (`) to prevent mkdocstrings from trying to process it.
Is your package available in the Python path?
See Python handler: Finding modules.
If you are using a Markdown extension like Arithmatex Mathjax or markdown-katex to render LaTeX, add r in front of your docstring to make sure nothing is escaped. You'll still maybe have to play with escaping to get things right.
Example:
We only support docstrings in comments through the griffe-sphinx extension.
Alternatively, instead of:
You can use:
Or:
Use functools.wraps():
The library that parses docstrings, Griffe, splits docstrings in several "sections" (example: Google-style sections syntax). If a footnote is used in a section, while referenced in another, mkdocstrings won't be able to render it correctly. The footnote and its reference must appear in the same section.
Here only the fourth footnote will work, because it is the only one that appear in the same section as its reference. To fix this, make sure all footnotes appear in the same section as their references:
In previous versions of mkdocstrings-python, submodules were rendered by default. This was changed and you now need to set the following option: