Put it all together and see if anything works.
This commit is contained in:
parent
8f2a322b37
commit
9775973311
|
@ -3,8 +3,13 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>This page is powered by Markdown.js</title>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.8.6/showdown.min.js">
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello World! (for now ...)</h1>
|
||||
<div id="markdown-content">TODO</div>
|
||||
<!-- That is all we need, now load the script and get going! -->
|
||||
<script type="text/javascript" src="use-markdown.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
"use strict";
|
||||
|
||||
function loadMdFromUrl(url) {
|
||||
$.get(url, function(date) {
|
||||
var converter = new showdown.Converter();
|
||||
var html = converter.makeHtml(text);
|
||||
$("#markdown-content").html(html);
|
||||
});
|
||||
|
||||
// TODO: Add more, add menu, add ...
|
||||
loadMdFromUrl("content/hello.md");
|
Loading…
Reference in New Issue