marky icon indicating copy to clipboard operation
marky copied to clipboard

How to use as a library

Open sdasda7777 opened this issue 2 years ago • 1 comments

Hi, I'd love to use your project as a dependency for a tool I'm planning.

Could you please add an example of how to use it to convert Markdown String into HTML String?

sdasda7777 avatar Sep 08 '23 14:09 sdasda7777

Since there isn't any lib.rs file in the src directory it isn't possible to use this crate as a library. Also, you probably don't want to; most of the crate is handling of CLI, web-serving, watching for changes and user interaction.

The library used by marky for markdown parsing is https://crates.io/crates/markdown (note that marky uses version 1.0.0-alpha5, not the 0.0.3 version most visible on crates.io). That is probably the library you'd wish to use.

Finally: From what I can find markys markdown to html conversion logic is in this file: https://github.com/metafates/marky/blob/master/src/document.rs so you can probably take inspiration from it to create your own.

sidju avatar Sep 19 '23 09:09 sidju