0.10.1 • Published 11 months ago

tomarkup v0.10.1

Weekly downloads
5
License
MIT
Repository
github
Last release
11 months ago

Tomarkup

This library makes it easy to convert markdown to html.

Features:

  • Github flavored Markdown to HTML, raw text and files
  • Converts youtube and vimeo video links to iframes
  • Mustache support for template data
  • Automatic highlight code syntax
  • Emoji support
  • "Front matter" support

Based on marked.js, mustache, node-emoji and prismjs.

Install

npm i tomarkup

Usage

const tomarkup = require('tomarkup')

// marked.js options
const formatter = tomarkup({ highlight: false })

// Convert file
const formatter = tomarkup({ file: true })
const { html } = formatter('file.md')

// Convert file with params
const formatter = tomarkup({ file: true })
const { html } = formatter('file.md', { hello: 'waveorb' })

// Convert markdown content with params
const { html } = formatter('# Hello', { hello: 'waveorb' })

// Convert html with params
const { html } = formatter('file.html', { hello: 'waveorb' })

// Extract HTML, data and markdown
const { html, data, md } = formatter('file.md')

MIT Licensed. Enjoy!

0.10.0

11 months ago

0.10.1

11 months ago

0.9.0

2 years ago

0.9.1

2 years ago

0.8.0

3 years ago

0.7.0

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.5.0

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago