0.3.0 • Published 8 years ago

mark-it-down v0.3.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

mark-it-down

The modern Markdown parser, painless and all in one, your good friend of write documentation. It works well in Browser and Node.

Demo

mark-it-down provides two themes: the light and dark, check here to review.

Install

$ npm i --save mark-it-down

Usage

import Markdown from 'mark-it-down'
const md = new Markdown({})

const html = md.toHTML(markdownSyntax)

Options

  • hasHeadHash: Boolean true or false, auto generation the hash link, the spaces will convert to - and transform to lower case
const md = new Markdown({
  hasHeadHash: true
})
md.toHTML('## Browser Supported')

// outputs
<h2 id="browser-supported"><a href="#browser-supported">Browser Supported</a><h2>
  • theme: String light or dark, the Markdown theme
  • codeTheme: String light or dark, the code snippet them

The other valid options

Default options

constructor(option = {}) {    
  const opts = {
    hasHeadHash: true,
    noHeaderId: true,
    strikethrough: true,
    tables: true,
    tasklists: true,
    theme: 'light', // or dark
    codeTheme: 'light', // or dark
    ...option
  }
}

API

.toHTML(String)

Convert markdown syntax to HTML.

.mountToTextArea(queryselector or textarea element)

This is browser only, it mounts to a textarea element, and convert value to markdown HTML.

0.3.0

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago