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

Content tabs #14

Closed
leonardcser opened this issue Apr 27, 2023 · 5 comments · Fixed by #18
Closed

Content tabs #14

leonardcser opened this issue Apr 27, 2023 · 5 comments · Fixed by #18

Comments

@leonardcser
Copy link

Hi,

I've been using your plugin and it has been working great with Mkdocs and Material style admonitions. However, in my project I also use content tabs (https://squidfunk.github.io/mkdocs-material/reference/content-tabs) which are extremely similar to admonitions.

I've forked your repository and figured out that the only change would be to add === in the MARKERS tuple and corresponding tests. But, this made me realise that there would be so much code in common.

I am not sure how to approach this as you have already fully integrated this plugin and the name of does not really correspond to the content tabs. Do you have any suggestions or ideas? I would be more than happy to contribute.

@KyleKing
Copy link
Owner

That's a nice surprise that the admonition logic might just work!

So, I'm actually in the process of deleting that file now (#13) once my PR changes are released for the plugins package: executablebooks/mdit-py-plugins#58

You could certainly implement just the parser in the same way I've included it here, but over the long-run, I would probably recommend:

I think having a dedicated plugin in mdit-py-plugins that generates useful HTML would be the best approach, but that would be the hardest. In the interim, I would still probably recommend having a prototype version of the code in your package like I did before #13, so you can start to find edge cases before mdit-py-plugins is updated

Whichever approach you take, I would be happy to add your plugin to mdformat-mkdocs!

I'm about to leave for vacation for over a week, so you caught me at a bad time, but hopefully this information is helpful! I'd be happy to add my input on code reviews or discuss other approaches as well

@KyleKing
Copy link
Owner

Also, to add, I'm not against supporting content-blocks in this plugin, but I agree that the plugin naming is unfortunate because it would be confusing to do both here

@leonardcser
Copy link
Author

Hi Kyle,
Thanks a lot for the information. This is super helpful.

@KyleKing
Copy link
Owner

Turns out this was straightforward to implement!

There is now support for content-tabs in the latest version of mdformat-admon>=1.1.0 🎉

@KyleKing
Copy link
Owner

I've moved the Content Tab logic to https://github.com/KyleKing/mdformat-mkdocs#mdformat-mkdocs along with a number of other improvements that should make the feature more reliable

I can release v2.0.0 as soon as mdformat-gfm is released (hukkin/mdformat-gfm#31), but in the meantime you can try out the improvements with:

pip install mdformat-mkdocs@git+https://github.com/KyleKing/mdformat-mkdocs.git

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 a pull request may close this issue.

2 participants