Yew Prism
Yew Prism is a highlighter code component based in Prism for yew
How it works
-
Install the
prismjs
node modulenpm install prismjs
-
Import the prismjs module and styles, and all the languages component which you want to use for highlighting, in your javascript/typescript main file yew project
import 'prismjs/themes/prism.css';
import 'prismjs';
import 'prismjs/components/prism-markup';
import 'prismjs/components/prism-rust';
import module from '../crate/Cargo.toml';
module.run();
Note: You can use yew-parcel-template or another template described here to create a yew project
- Add yew_prism in your cargo.toml
[]
= { = "0.17", = ["web_sys"]}
="0.4"
- Now you are ready to use the component 🚀
Example
use *;
use Prism;
;