@pr4j3sh/hash-tag
v0.1.16
Published
Markdown to HTML parser.
Downloads
3
Readme
hash-tag
<#>
Markdown to HTML Parser written in rust, built with wasm, for direct usage in javascript.
Features
- Parses headings, blockquotes, inline code, codeblock, paragraphs, links, bold, italics, unordered lists and ordered list.
- Visualize outputs using frames ui.
Usage
Using cargo
cargo install hash-tag- Use
run
hash-tag path/to/file.mdGenerates a
index.htmlfile
- Specify output file using
-oflag
hash-tag path/to/file.md -o path/to/file.html- Visualize output file using
-vflag
hash-tag path/to/file.md -v path/to/view.htmlThis uses frames ui.
Using npm
- Create a node environment
mkdir test
cd test
npm init -yAdd
"type": "module",topackage.jsonfile.Install @pr4j3sh/hash-tag npm package
npm install @pr4j3sh/hash-tag- Create a new file
index.jsand write the code as:
import * as wasm from "@pr4j3sh/hash-tag";
const html = wasm.parse("## heading 2\n");
console.log(html);- Run using
node index.js- Outputs
<h2>heading 2</h2>