kyleking / mdformat-admon Goto Github PK
View Code? Open in Web Editor NEWmdformat plugin for admonitions
License: MIT License
mdformat plugin for admonitions
License: MIT License
Trying to install the last 2 versions of these plugins does not work because of a conflict on mdit-py-plugins
requirements:
$ pip install --dry-run mdformat-gfm==0.3.5 mdformat-admon==1.0.2
Collecting mdformat-gfm==0.3.5
Using cached mdformat_gfm-0.3.5-py3-none-any.whl (4.9 kB)
Collecting mdformat-admon==1.0.2
Using cached mdformat_admon-1.0.2-py3-none-any.whl (4.7 kB)
Collecting markdown-it-py[linkify] (from mdformat-gfm==0.3.5)
Using cached markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
Collecting mdformat<0.8.0,>=0.7.5 (from mdformat-gfm==0.3.5)
Using cached mdformat-0.7.16-py3-none-any.whl (29 kB)
Collecting mdformat-tables>=0.4.0 (from mdformat-gfm==0.3.5)
Using cached mdformat_tables-0.4.1-py3-none-any.whl (4.6 kB)
Collecting mdit-py-plugins<0.4.0,>=0.2.0 (from mdformat-gfm==0.3.5)
Using cached mdit_py_plugins-0.3.5-py3-none-any.whl (52 kB)
INFO: pip is looking at multiple versions of mdformat-admon to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install mdformat-admon==1.0.2 and mdformat-gfm==0.3.5 because these package versions have conflicting dependencies.
The conflict is caused by:
mdformat-gfm 0.3.5 depends on mdit-py-plugins<0.4.0 and >=0.2.0
mdformat-admon 1.0.2 depends on mdit-py-plugins>=0.4.0
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
Mirrors: hukkin/mdformat-gfm#27
Other plugins can be used with the api (see the example below), but if I try to use mdformat-admon I get error:
plugin = mdformat.plugins.PARSER_EXTENSIONS[name]
KeyError: 'admon'
import mdformat
mdformat.text(
content,
options={"wrap": 80, "end-of-line": "keep"},
extensions={
"gfm",
"tables",
"footnote",
"frontmatter",
"configblack",
"mkdocs",
},
codeformatters={
"python",
"bash",
"sh",
"json",
"toml",
"yaml",
"javascript",
"js",
"css",
"html",
"xml",
},
)
versions:
mdformat==0.7.16
mdformat-admon==1.0.0
Thanks
@KyleKing I'm trying to use this plugin with our docs at https://docs.ultralytics.com, and it creates incorrect output on adminitions that contain code blocks:
Ultralytics commands use the following syntax:
!!! Example
=== "CLI"
```bash
yolo TASK MODE ARGS
```
=== "Python"
```python
from ultralytics import YOLO
# Load a YOLOv8 model from a pre-trained weights file
model = YOLO('yolov8n.pt')
# Run MODE mode using the custom arguments ARGS (guess TASK)
model.MODE(ARGS)
```
Ultralytics commands use the following syntax:
!!! Example
=== "CLI"
````
```bash
yolo TASK MODE ARGS
```
````
=== "Python"
````
```python
from ultralytics import YOLO
# Load a YOLOv8 model from a pre-trained weights file
model = YOLO('yolov8n.pt')
# Run MODE mode using the custom arguments ARGS (guess TASK)
model.MODE(ARGS)
```
````
The file that has this to reproduce the issue is at https://github.com/ultralytics/ultralytics/blob/main/docs/en/usage/cfg.md with mdformat cfg.md --wrap no
Could you take a look please and see if there is a fix that's possible? Thank you!
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.
First off, thanks for this project. Was just about to give up on mdformat
for a project of mine until I found your plugin work here in executablebooks/mdformat#309.
Looking at the release page for 1.0.2, it mentions that 1.0.2 fixes #9.
However, looking at the commits to main
since that tag, we see 282ca53, which corresponds to #13, i.e. precisely the PR that resolves #9.
So it sounds like the fix for #9 is in fact not in 1.0.2, and could use a follow-up release? ๐
Please install our new product, Sonatype Lift with advanced features
See: #4 (comment)
And example file: ./tests/pre-commit-test.md
Hi @KyleKing, first thank you so much for developing the plugin. Could you please add to the README.md
the steps to install and make the plugin work?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.