Skip to content

Deno bindings for pulldown-cmark, a CommonMark-compliant Markdown parser made in Rust, compiled to WebAssembly.

License

Notifications You must be signed in to change notification settings

arguablykomodo/deno_rusty_markdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rusty_markdown

Deno bindings for pulldown-cmark, a CommonMark-compliant Markdown parser made in Rust, compiled to WebAssembly.

Example

import { html, tokens } from "https://deno.land/x/rusty_markdown/mod.ts";

const tokenized = tokens("~~Goodbye~~ Hello **World**!", { strikethrough: true }));
console.log(tokenized);
// [
//   { type: "start", tag: "paragraph" },
//   { type: "start", tag: "strikethrough" },
//   { type: "text", content: "Goodbye" },
//   { type: "end", tag: "strikethrough" },
//   { type: "text", content: " Hello " },
//   { type: "start", tag: "strong" },
//   { type: "text", content: "World" },
//   { type: "end", tag: "strong" },
//   { type: "text", content: "!" },
//   { type: "end", tag: "paragraph" }
// ]

const rendered = html(tokenized);
console.log(html);
// <p><del>Goodbye</del> Hello <strong>World</strong>!</p>

Repo Structure

The files in the wasm directory are generated by build.ts, and contain the webassembly code, compressed and encoded into base64, alongside boilerplate js generated by wasm-bindgen for interacting with it. If you want to build it yourself, you will need to make sure you have wasm-bindgen-cli installed, and you are using the same version as the one in Cargo.toml.

About

Deno bindings for pulldown-cmark, a CommonMark-compliant Markdown parser made in Rust, compiled to WebAssembly.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published