Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 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 (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-23T20:12:37.000Z (about 3 years ago)
- Last Synced: 2024-10-30T15:03:30.641Z (3 months ago)
- Topics: deno, markdown, rust, webassembly
- Language: Rust
- Homepage: https://deno.land/x/rusty_markdown
- Size: 1020 KB
- Stars: 11
- 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);
//
GoodbyeHello 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