Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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