showdown-extra

My custom settings for Showdown.js, such as CSS support and Pug

Stars
0

showdown-extra

My custom Showdown.js settings, with CSS support.

For example, please see /example.md

Installation

yarn add https://github.com/patarapolw/showdown-extra.git
# or
# npm i https://github.com/patarapolw/showdown-extra.git

Or if you don't use Node.js or NPM

<script src="https://patarapolw.github.io/showdown-extra/showdown-extra.js"></script>

Now, ShowdownExtra will be available as a global variable. (It must be imported if used as Node.js module.)

After that,

var showdownExtra = new ShowdownExtra({
  frontmatter: true
})
document.getElementById('output').innerHTML = showdownExtra.parse('# Awesome string')

For more settings and default options, see https://github.com/patarapolw/showdown-extra/tree/master/index.js

Caution for Node.js users

HTML sanitization and custom tags is done through DOM. If you need to output HTML for Node.js, you will need global-jsdom or jsdom-global; otherwise, showdownExtra.parse will not run.

Contributions

Please either open an issue, or fork the project and make pull requests.

Suggestions welcome.