-
Notifications
You must be signed in to change notification settings - Fork 47
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
Support Admonitions #309
Support Admonitions #309
Comments
Hey thanks for the issue! Yeah this should be a plugin, and the plugin template you linked should be helpful. The first step, however, is a parser extension for mdformat's Markdown parser (markdown-it-py which is a Python port of the JavaScript markdown-it). You'll find the existing parser extensions in this collection repository: https://github.com/executablebooks/mdit-py-plugins. I suggest making a PR there (although it's entirely possible that you keep in a separate repo too). Luckily you don't have to start from scratch: there seems to be a JavaScript version of the parser extension which you can port to Python https://github.com/commenthol/markdown-it-admon (I dont know whether the JS implementation is any good though). |
Great! I've got a busy next few weeks, but I'll start on this once I have time! |
@KyleKing had any chance to work on this? |
Thanks for reminder. I had completed forgotten about this ticket. This is still an issue for me, but haven't had time to work on it |
@KyleKing I guess there is still no advance, isn't it? |
…s locally If you're with the VPN connected, turn it off. feat(aleph#PDB behaves weird): PDB behaves weird Sometimes you have two traces at the same time, so each time you run a PDB command it jumps from pdb trace. Quite confusing. Try to `c` the one you don't want so that you're left with the one you want. Or put the `pdb` trace in a conditional that only matches one of both threads. fix(gitpython): Deprecate tmpdir in favour of tmp_path feat(pytest#The tmp_path fixture): The tmp_path fixture You can use the `tmp_path` fixture which will provide a temporary directory unique to the test invocation, created in the base temporary directory. `tmp_path` is a `pathlib.Path` object. Here is an example test usage: ```python def test_create_file(tmp_path): d = tmp_path / "sub" d.mkdir() p = d / "hello.txt" p.write_text(CONTENT) assert p.read_text() == CONTENT assert len(list(tmp_path.iterdir())) == 1 assert 0 ``` fix(pytest#The tmpdir fixture): Deprecate the tmpdir fixture Warning: Don't use `tmpdir` use `tmp_path` instead because `tmpdir` uses `py` which is unmaintained and has unpatched vulnerabilities. feat(python_snippets#Pad integer with zeros): Pad integer with zeros ```python >>> length = 1 >>> print(f'length = {length:03}') length = 001 ``` feat(elasticsearch#Get documents that match a string): Get documents that match a string ```bash curl \ -H 'Content-Type: application/json' \ -XPOST "https://localhost:9200/_search" \ -d' { "query": { "query_string": {"query": "test company"} }}' ``` feat(linux_snippets#df and du showing different results): df and du showing different results Sometimes on a linux machine you will notice that both `df` command (display free disk space) and `du` command (display disk usage statistics) report different output. Usually, `df` will output a bigger disk usage than `du`. The `du` command estimates file space usage, and the `df` command shows file system disk space usage. There are many reasons why this could be happening: * [Disk mounted over data](linux_snippets.md#disk-mounted-over-data) * [Used deleted files](linux_snippets.md#used-deleted-files) feat(linux_snippets#Clean up docker data): Clean up docker data To remove unused `docker` data you can run `docker system prune -a`. This will remove: - All stopped containers - All networks not used by at least one container - All images without at least one container associated to them - All build cache Sometimes that's not enough, and your `/var/lib/docker` directory still weights more than it should. In those cases: - Stop the `docker` service. - Remove or move the data to another directory - Start the `docker` service. In order not to loose your persisted data, you need to configure your dockers to mount the data from a directory that's not within `/var/lib/docker`. feat(mdformat#issues): Issues - It doesn't yet [support admonitions](hukkin/mdformat#309) - You can't [ignore some files](hukkin/mdformat#359), nor [some part of the file](hukkin/mdformat#53)
Yeah, no progress yet I actually had these tickets open to try to get to it this week, but haven't had time yet with school and holidays here |
Submitted a PR! It is a Draft, but I'll finish up and mark it ready for review sometime tomorrow |
And I started the plugin for |
This ticket keeps accidentally closing...but I had some time to make progress today! If anyone is more familiar with https://github.com/KyleKing/mdformat-admon/blob/main/mdformat_admon/plugin.py |
After a long, busy year, I finally have a v0.0.1 release of the admonition plugin! I will test it in a real world project and will revisit if formats other than |
Describe the problem/need and solution
Problem
Right now,
mdformat
breaks indentation for admonitions. Below is a repeatable example based on the first snippet from the admonition documentationSolution
admonitions are not part of the CommonMark specification and would be best handled by a plugin (i.e.
mdformat-admonition
)I would be happy to try writing one, but I wanted to open an issue first so that I'm not duplicating effort. I saw that there was at least one other issue with admonition problems, but there didn't seem to be any updates since: #53 (#53 (comment))
Benefit
Would be nice to have support for admonitions (particular for mkdocs which uses the markdown extension)
Guide for implementation
No response
Tasks and updates
No response
The text was updated successfully, but these errors were encountered: