-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with mkdocs-material admonition extension #6
Comments
It's not a third-party extension is it? Seems to be an official one. |
I investigated this. The issue is that admonition syntax is very sensitive to indentation level being correct. Regular inline content like paragraph text can start from the nested indent level, and go up to 3 more spaces of padding until being converted into an indented code block. As the admonition syntax doesn't seem to support this by removing any additional white-space padding from the nested indent level, it fails to render. If you need to have that resolved, perhaps file a bug for it upstream on the python markdown parser (as it's not specifically mkdocs or the material theme nor this extension causing the issue afaik. To resolve the main issue and have the admonition render correctly, use an indentation of 2 spaces which this extension sets as a default. Otherwise, for 4 spaces, you need to change the default nesting level in your markdown_extensions:
- mdx_truly_sane_lists:
nested_indent: 4 Your example will render correctly then. |
I have given this extension a try a bit and not seeing any notable improvement with With that said, this is an extension for markdown parsing iirc, not specifically mkdocs? (so if upstreams I mention resolved it, it may still affect others if it wasn't fixed in Python Markdown parser). The only notable difference is that it can avoid merging separate lists, but usually your lists are likely to be kept separate via content in-between them. If you have lists with multi-line nested content, this can result in a single list being split into multiple lists accidentally as a result which may be more likely to happen. Beyond that, you can benefit from 2 space indentation instead of 4 space indentation, but as this doesn't adjust indentation for other syntax such as admonition, there is not much point, so you would configure the indentation back to 4 like above. It does remove the The extension does not resolve rendering issues such as: - a
x
- b
- c
- d Which at least with This doesn't require the |
Instead of the indentation-sensitive admonition syntax, consider this other extension that produces the same markup that also works with Material theme: |
When used in combination with mkdocs-material's admonition extension it seems to become impossible to use admonitions within lists:
The fenced code blocks however work fine
The text was updated successfully, but these errors were encountered: