showdown-prettify

Add markdown prettify flavor to showdown

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
showdown-prettify
2031.3.08 years ago9 years agoMinified + gzip package size for showdown-prettify in KB

Readme

Showdown's Prettify Extension ========================== Build Status npm version npm version ------ An extension to add Google Prettify hints to showdown's HTML output

Installation

With npm

npm install showdown-prettify

With bower

bower install showdown-prettify

Manual

You can also download the latest release zip or tarball
and include it in your webpage, after showdown:
<script src="showdown.min.js">
<script src="showdown-prettify.min.js">

Enabling the extension

After including the extension in your application, you just need to enable it in showdown.
var converter = new showdown.Converter({extensions: ['prettify']});

Example

```javascript var converter = new showdown.Converter({extensions: 'prettify'}),
input = "Here's a simple hello world in javascript:\n" +
"\n" +
"    alert('Hello World!');\n" +
"\n" +
"The `alert` function is a build-in global from `window`.";
html = converter.makeHtml(input);
console.log(html);
``` This should output the equivalent to: ```html

Here's a simple hello world in javascript:

alert('Hello World!');

The alert function is a build-in global from window.

```

License

These files are distributed under BSD license. For more information, please check the LICENSE file in the source code.