3 unstable releases

0.2.0 Mar 12, 2022
0.1.1 Mar 8, 2022
0.1.0 Mar 8, 2022

#4 in #prism

Download history 3/week @ 2024-02-15 8/week @ 2024-02-22 27/week @ 2024-03-28 29/week @ 2024-04-04

56 downloads per month

MPL-2.0 license

57KB
153 lines

PrismJS for Dioxus

Render math with PrismJS in Dioxus!

How to use

  • First you need to import css cdn:
<link rel="stylesheet" href="https://raw.githubusercontent.com/oovm/prism-wasm/dev/projects/prism-wasm/src/prism.min.css">

or use PRISM_CSS to inline css without cdn.

  • Call use_prism_rust hook to prepare context.
  • Call render to get code highlight node.
use dioxus_prism::use_prism_rust;

let rust = use_prism_rust(&cx);
let code = rust.render(text);

Dependencies

~5.5–8MB
~155K SLoC