Created
July 17, 2010 00:47
-
-
Save jwpage/479125 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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