wooorm / markdown-rs

CommonMark compliant markdown parser in Rust with ASTs and extensions
https://docs.rs/markdown/1.0.0-alpha.18/markdown/
MIT License
836 stars 41 forks source link

make `MDX` to a extra feature? #66

Closed mrxiaozhuox closed 1 year ago

mrxiaozhuox commented 1 year ago

I think change mdx to a feature is better? because sometime we don't need this part.

ChristianMurphy commented 1 year ago

It is already optional and configurable based off extensions https://github.com/wooorm/markdown-rs#extensions Is there a particular reason you think it should be a cargo feature as well?

wooorm commented 1 year ago

Hmm. The same could be said for frontmatter, gfm, math, etc. They're pretty important to this project. What is the cost, what is the benefit?

mrxiaozhuox commented 1 year ago

I don't think mdx is a necessary extension for a markdown parser library, the default-features just need include very basic function, and other variants can use features to import, that can help developer open according to demand. for example I just need a very basic CommonMark parser, but my binary file will include other useless functions.

wooorm commented 1 year ago

MDX is an important reason for this project to exist.

This project doesn’t pull in extra dependencies for MDX, which is the case for serde, which is a feature.

the default-features just need include very basic function

What “very basic” is, is subjective. I think default features should give useful, reasonable defaults.

I just need a very basic CommonMark parser, but my binary file will include other useless functions.

Can you then please show proof of your request, what the costs and benefits are?

There are always going to be some functions not getting called.

Why do you not care about frontmatter and math?

mrxiaozhuox commented 1 year ago

OK, it's just a little suggestion. up to you :laughing: