wooorm / markdown-rs

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

to_html_with_options isn't found #98

Closed paulfrische closed 9 months ago

paulfrische commented 9 months ago

Hi there, when adding this crate to a fresh cargo project with cargo add markdown markdown::to_html_with_options is't found. All in all I think the documentation around this is very confusing.

fn main() {
    let text = include_str!("./index.md");
    markdown::to_html_with_options();
}

Error:

error[E0425]: cannot find function `to_html_with_options` in crate `markdown`
 --> src/main.rs:3:15
  |
3 |     markdown::to_html_with_options();
  |               ^^^^^^^^^^^^^^^^^^^^ not found in `markdown`

For more information about this error, try `rustc --explain E0425`.
error: could not compile `my-markdown` (bin "my-markdown") due to 1 previous error

Have a great day!

ChristianMurphy commented 9 months ago

@paulfrische most likely you installed the old crate, please follow the instructions in the readme https://github.com/wooorm/markdown-rs#install

cargo add markdown@1.0.0-alpha.16

👉 Note: this is a new crate that reuses an old name. The old crate (0.3.0 and lower) has a bunch of problems. Make sure to use the new crate, currently in alpha at 1.0.0-alpha.16.

paulfrische commented 9 months ago

Thank you! May I open a PR with a more visible "warning" in the readme?

ChristianMurphy commented 9 months ago

No thanks. There already are multiple highly visible warnings, at the top of the readme and in the install section.