https://github.com/arguablykomodo/deno_rusty_markdown
Deno bindings for pulldown-cmark, a CommonMark-compliant Markdown parser made in Rust, compiled to WebAssembly.
https://github.com/arguablykomodo/deno_rusty_markdown
deno markdown rust webassembly
Last synced: 10 months ago
JSON representation
Deno bindings for pulldown-cmark, a CommonMark-compliant Markdown parser made in Rust, compiled to WebAssembly.
- Host: GitHub
- URL: https://github.com/arguablykomodo/deno_rusty_markdown
- Owner: arguablykomodo
- License: mit
- Created: 2020-08-27T01:27:23.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-01-23T20:12:37.000Z (over 4 years ago)
- Last Synced: 2025-08-09T20:45:37.552Z (11 months ago)
- Topics: deno, markdown, rust, webassembly
- Language: Rust
- Homepage: https://deno.land/x/rusty_markdown
- Size: 1020 KB
- Stars: 12
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `rusty_markdown`
Deno bindings for [`pulldown-cmark`][1], a CommonMark-compliant Markdown parser
made in Rust, compiled to WebAssembly.
## Example
```ts
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);
//
Goodbye Hello World!
```
## 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`.
[1]:https://github.com/raphlinus/pulldown-cmark