dioxus-prism

Crates.iodioxus-prism
lib.rsdioxus-prism
version0.2.0
sourcesrc
created_at2022-03-08 15:41:29.889668
updated_at2022-03-12 07:02:00.033234
descriptionRender with prismjs in dioxus!
homepage
repositoryhttps://github.com/oovm/prism-wasm
max_upload_size
id546408
size4,951
SasakiSaki (oovm)

documentation

README

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);
Commit count: 8

cargo fmt