0.1.0 • Published 4 years ago

dessert-marked v0.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

npm.io

Dessert Marked

npm-badge license-badge

marked, but implemented with Rust and WebAssembly

Table of contents

Usage

const marked = require('dessert-marked');
console.log(marked("hello world"));

Output

<p>hello world</p>

Advance usage

// Create reference instance
const marked = require('marked');

// Set options
// `highlight` example uses `highlight.js`
marked.setOptions({
  gfm: true,
  breaks: false,
  headerPrefix: 'Hello'
});

// Compile
console.log(marked(markdownString));

API

marked(src, opt, callback)

Converts Markdown to HTML

marked.parse(src, opt, callback)

Same as the marked function

getDefaults()

Returns the defaults options

setOptions({obj})

MembertypeDefaultNotes
breaksbooleanfalsegf true, add <br> on a single line break (copies GitHub behavior on comments, but not on rendered markdown files). Requires gfm be true.
gfmbooleantrueIf true, use approved GitHub Flavored Markdown (GFM) specification.
headerIdsbooleantrueIf true, include an id attribute when emitting headings (h1, h2, h3, etc).
headerPrefixstring''A string to prefix the id attribute when emitting headings (h1, h2, h3, etc).
silentbooleanfalseIf true, the parser does not throw any exception.

Installation

With npm:

npm install dessert-marked

License

This software is licensed under the MIT license (see LICENSE).

Contributing

See CONTRIBUTING.md