npm.io
0.4.0 • Published 6 years ago

markdown-it-theme

Licence
Unlicense
Version
0.4.0
Deps
0
Size
7 kB
Vulns
0
Weekly
0
Stars
1

markdown-it-theme

A markdown-it plugin for theme customization.

Usage

index.md

# header
markdown-it-theme `plugin`

index.js

var fs = require('fs')
var plugin = require('markdown-it-theme')
var options = { theme: 'custom-md-theme' }
var md = require('markdown-it')().use(plugin, options)
var input = fs.readFileSync('index.md', 'utf-8')
var result = md.render(input)
console.log(result)

Result

<h1 class="custom-md-theme">header</h1>
<p class="custom-md-theme">markdown-it-theme <code class="custom-md-theme">plugin</code> </p>

options

Name Type Description Default
theme string The class of html tag. undefined
alias function Alias class of html tag. undefined

Keywords