Skip to content

Instantly share code, notes, and snippets.

@chrisparnin
Created October 6, 2013 05:02
Show Gist options
  • Save chrisparnin/6849751 to your computer and use it in GitHub Desktop.
Save chrisparnin/6849751 to your computer and use it in GitHub Desktop.
Syntax highlighting for Markdown Pad.
<link href="https://cdnjs.cloudflare.com/ajax/libs/prettify/r224/prettify.css" type="text/css" rel="stylesheet" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/prettify/r224/prettify.js">
</script>
<script>
$(document).ready(function()
{
$("pre").addClass("prettyprint");
prettyPrint();
});
</script>
@Eccenux
Copy link

Eccenux commented Jul 27, 2015

Sorry to bug you, but this comes up first in Goggle...

In MarkdownPad 2.5 it is supported natively (only in Pro version, though)

  1. Open Options.
  2. Select Markdown -> GitHub Falvored Markdown (must use on-line version).
  3. Save options.

Then you can just use fenced block with language name as you usually use on Github. E.g.

```python
from helper import Helper
# init helper
helper = Helper()
```

Is rendered as

from helper import Helper
# init helper
helper = Helper()

Seem to work both in preview window and after exporting to HTML. Although preview is on-line, exported HTML is off-line (i.e. CSS is included in-line in the HTML).

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