New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

showdown-prettify

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

showdown-prettify

Add markdown prettify flavor to showdown

1.3.0
latest
Source
npm
Version published
Weekly downloads
107
Maintainers
1
Weekly downloads
 
Created
Source

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

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:

<p>Here's a simple hello world in javascript:</p>

<pre class="prettyprint linenums" tabIndex="0"><code data-inner="1">alert('Hello World!');
</code></pre>

<p>The <code class="prettyprint">alert</code> function is a build-in global from <code class="prettyprint">window</code>.</p>

License

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

Keywords

markdown

FAQs

Package last updated on 06 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts