Skip to content

Instantly share code, notes, and snippets.

@jwpage
Created July 17, 2010 00:47
Show Gist options
  • Save jwpage/479125 to your computer and use it in GitHub Desktop.
Save jwpage/479125 to your computer and use it in GitHub Desktop.
<!DOCTYPE>
<html>
<head>
<title></title>
<!-- from http://attacklab.net/showdown/ -->
<script src="showdown.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
$(function() {
var refreshRate = 3;
var file = document.location.href.match(/file=(.*)/);
if(file && file.length > 1) {
file = file[1];
$("#explain").hide();
}
window.setInterval(function() {
$.get(file, null, function(data) {
var converter = new Showdown.converter();
var html = converter.makeHtml(data);
$('#output').html(html);
});
}, 1000*refreshRate);
});
</script>
</head>
<body>
<div id="explain">
Note: you will need to download shoutdown.js separately to this gist.
To use: go to path/to/dir/markdown_reader.html?file=path/to/file.mdown
</div>
<div id="output"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment