Skip to content

Instantly share code, notes, and snippets.

@ritch
Last active December 14, 2015 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ritch/5163418 to your computer and use it in GitHub Desktop.
Save ritch/5163418 to your computer and use it in GitHub Desktop.
/**
* First `sn install node-markdown shelljs`
* Then `sn markdown-example.js`
*/
var md = require('node-markdown').Markdown
require('shelljs/global');
/**
* Output the sample file as html
*/
md(cat('./sample.md')).to('output.html');
<h1>Hello World</h1>
<p>This is some <strong>sample</strong> markdown.</p>
<p>Here is a list</p>
<ul>
<li>foo</li>
<li>bar</li>
<li>baz</li>
</ul>
<p>Here is some code</p>
<pre><code>// must be tabbed in 4 spaces
foo(bar(baz()));
</code></pre>
<h2>A smaller header</h2>
<p>Some <em>italic text</em>.</p>
<h3>Even smaller header</h3>
<p>Some <strong>bold text</strong> with a <a href="http://google.com">link to google</a>.</p>

Hello World

This is some sample markdown.

Here is a list

  • foo
  • bar
  • baz

Here is some code

// must be tabbed in 4 spaces
foo(bar(baz()));

A smaller header

Some italic text.

Even smaller header

Some bold text with a link to google.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment