Leser filer fra samme mappe i .md-format.
Deps må linkes skikkelig.
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Endringslogg</title> | |
<style type="text/css"> | |
body { | |
background: #efefef; | |
} | |
div.content { | |
margin: auto; | |
background: white; | |
width: 940px; | |
padding: 1em 1.5em; | |
font-family: Segoe UI; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="header" class="content"> | |
[Endringer](changelog) | [Api](api) | [Patterns & practices](patterns) | |
</div> | |
<div id="content" class="content"></div> | |
<script src="strapdown/jquery-2.1.3.min.js"></script> | |
<script src="strapdown/marked.min.js"></script> | |
<script src="strapdown/mermaid.full.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
loadpage('changelog'); | |
$("#header").html(marked($("#header").html())); | |
}); | |
var attachEventHandler = function() { | |
$("a").click(function(event, pa) { | |
event.preventDefault(); | |
url = event.target.attributes.getNamedItem('href').value; | |
loadpage(url); | |
}); | |
} | |
var loadpage = function(name) { | |
$.get(name + '.md', function(response) { | |
$("#content").html(marked(response)); | |
mermaid.init(); | |
attachEventHandler(); | |
}); | |
} | |
</script> | |
</body> | |
</html> |