prism-js

Crates.ioprism-js
lib.rsprism-js
version0.1.2
sourcesrc
created_at2023-06-02 23:21:43.893129
updated_at2023-06-05 14:13:17.363611
descriptionrust bindings for prism.js syntax highlighting library
homepage
repositoryhttps://github.com/FraserLee/prism-rs
max_upload_size
id881266
(FraserLee)

documentation

README

# prism-rs Rust bindings for [Prism](https://prismjs.com/) syntax highlighting. ## Usage ```toml [dependencies] prism-js = "0.1" ``` ```rust use prism_js::{init, highlight} let mut context = init(); let lang = "haskell"; let code = r#" fibs = 0 : 1 : zipWith (+) fibs (tail fibs) main = print $ take 100 fibs "#; let html = highlight(&mut context, code, lang); println!("{}", html.unwrap()); ``` which outputs: ```html fibs = 0 : 1 : zipWith (+) fibs (tail fibs) main = print $ take 100 fibs ```
Commit count: 11

cargo fmt