Skip to content
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

Fix Mkdocs Material Admonitions #22

Closed
wants to merge 1 commit into from
Closed

Conversation

rmorshea
Copy link

According to the docs admonitions should look like this:

!!! note

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
    nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
    massa, nec semper lorem quam in massa.

However, this plugin formats them without the new line between the title and content:

!!! note
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
    nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
    massa, nec semper lorem quam in massa.

Which is not correct.

rmorshea added a commit to rmorshea/pybooster that referenced this pull request Nov 21, 2024
rmorshea added a commit to rmorshea/pybooster that referenced this pull request Nov 21, 2024
* Revert "remove mdformat because of (#13)"

This reverts commit a6d309e.

* use admon patch until KyleKing/mdformat-admon#22
@KyleKing
Copy link
Owner

KyleKing commented Nov 21, 2024

Hi @rmorshea, thanks for checking out this package and submitting a PR. For mkdocs support, you'll want to use my other package mdformat-mkdocs: https://github.com/KyleKing/mdformat-admon/blob/12931e439c9b1c209788dfe05cc194b11a90c502/README.md#extensibility

I think the extra newline is a stylistic choice by squidfunk because they're only wrapping the admonition extension rather than implementing a separate parser in mkdocs-material. In any case, I'll update mdformat-mkdocs to reflect the expected format (KyleKing/mdformat-mkdocs#44)

@rmorshea
Copy link
Author

rmorshea commented Nov 21, 2024

Should I only be using mdformat-mkdocs? I'm currently using it with this plugin.

@KyleKing
Copy link
Owner

KyleKing commented Nov 22, 2024

Yeah, for formatting admonitions you should only add mdformat-mkdocs (then any additional plugins, such as the “recommended” extras). I can understand the confusion, so I'm preparing some changes to make it more clear

The current problem is that the mkdocs plugin doesn’t have the extra new line. You can still start using mdformat-mkdocs today and, once I finish and publish a fix, the newline will be inserted where missing (KyleKing/mdformat-mkdocs#44)

@KyleKing
Copy link
Owner

I've released mdformat-mkdocs 4.0.0, which should properly insert the newline if not present or preserve it if there. Let me know if you encounter any additional issues!

@dhruvmanila
Copy link

Hi @KyleKing, we're facing an issue while updating mdformat-mkdocs to 4.0.0 (astral-sh/ruff#15011) which is that it throws a warning that there are multiple dependencies that are registered to admonition and admonition_title for mdformat.

Does this change mean that we should remove mdformat-admon if using mdformat-mkdocs>=4.0.0 ?

@KyleKing
Copy link
Owner

KyleKing commented Dec 16, 2024

Sorry about the issue! Always feel free to open issues if you run into any problems or warnings in the future

@dhruvmanila
Copy link

Sorry about the issue! Always feel free to open issues if you run into any problems or warnings in the future

No problem! Thank you for reviewing the PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants