Skip to content

Instantly share code, notes, and snippets.

@mde
Created May 11, 2011 23:20
Show Gist options
  • Save mde/967610 to your computer and use it in GitHub Desktop.
Save mde/967610 to your computer and use it in GitHub Desktop.
HTML markdown viewer
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="./showdown.js"></script>
<title>
Markdown Viewer
</title>
<style type="text/css">
#markdown-contents {
width: 600px;
padding: 0 10px;
}
</style>
</head>
<body>
<div id="markdown-contents"></div>
<script type="text/javascript">
var directory = "./xdr-proxy";
var filename = "README.markdown";
var path = directory + "/" + filename;
var md2html = function (path) {
// Load contents and convert to HTML
$("#markdown-contents").load(path, function(text, status){
var sdconv = new Showdown.converter();
this.innerHTML = sdconv.makeHtml(text);
});
}
md2html(path);
</script>
</body>
</html>
@Onaiplee
Copy link

Onaiplee commented Nov 8, 2011

@asimkaya
Copy link

thanks bud

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