Pitasi / leptos-mdx

Supercharge your markdown including Leptos components.
11 stars 3 forks source link

Custom codefence_syntax_highlighter #1

Open Phosphorus-M opened 1 year ago

Phosphorus-M commented 1 year ago

Hi I'm doing a blog about Rust using Leptos as SSG: https://rustlanges.github.io/blog/

Can the theme of codefence_syntax_highlighter be changed from InspiredGitHub to another? Do you have plans to publish this crate into crates.io?

Pitasi commented 1 year ago

Hey, the short answer is yes but you'll need to fork this library :)

You can use one of the default themes from syntect, there are a few of them: https://github.com/trishume/syntect/blob/e9819fbcaf0eb5ea73448079aac78d00b8b4d140/src/dumps.rs#L203-L206

And you should edit this line: https://github.com/Pitasi/leptos-mdx/blob/a0a56912726121b394bfa20038ffd084e3e2f054/src/markdown.rs#L42 since InspiredGithub is hardcoded.

Keep in mind that this repo was more an experiment than a full fledged library, that's why it's not configurable 😅

You should also know that I recently moved my development to my new library that replaces Leptos for SSR: https://github.com/Pitasi/rscx and also ported this repo to https://github.com/Pitasi/rscx-mdx. I opened an issue for it: https://github.com/Pitasi/rscx-mdx/issues/1

So I'm not publishing this repo as a crate, as I won't maintain it.