Giter Site home page Giter Site logo

arguablykomodo / deno_rusty_markdown Goto Github PK

View Code? Open in Web Editor NEW
11.0 1.0 3.0 1.02 MB

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

Home Page: https://deno.land/x/rusty_markdown

License: MIT License

TypeScript 37.94% Rust 62.06%
deno markdown webassembly rust

deno_rusty_markdown's Introduction

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.

deno_rusty_markdown's People

Contributors

arguablykomodo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

deno_rusty_markdown's Issues

Foot note and check mark not working

The testing markdown is like this:

#Asdf

asdsaf\`asdf\`asdf[^1]
[x] asdf
[ ] asdf
[^1]: This is a footnote content.

However, it gives out text tokens instead of footnoteReference or taskListMarker.
Does the underlying rust library really support foot note or task list mark ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.