0
0
mirror of https://github.com/JPT580/jpt580.github.io.git synced 2024-11-27 21:57:46 +01:00

Flatten everything up a bit.

This commit is contained in:
Jan Philipp Timme 2018-03-13 12:09:27 +01:00
parent 6e076a1285
commit c174c3a5f2
2 changed files with 14 additions and 15 deletions

View File

@ -7,9 +7,20 @@
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.8.6/showdown.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.8.6/showdown.min.js"></script>
</head> </head>
<body> <body>
<h1>Hello World! (for now ...)</h1> <!-- This is the main container for the rendered content. -->
<div id="markdown-content">TODO</div> <div id="markdown-content">Please wait while javascript takes care of rendering the page from markdown ...</div>
<!-- That is all we need, now load the script and get going! --> <!-- That is all we need, now load the script and get going! -->
<script type="text/javascript" src="use-markdown.js"></script> <script type="text/javascript">
// Load and render markdown from given URL
function loadMdFromUrl(url) {
$.get(url, function(data) {
var converter = new showdown.Converter();
var html = converter.makeHtml(data);
$("#markdown-content").html(html);
});
}
// Load initial page to display.
loadMdFromUrl("content/hello.md");
</script>
</body> </body>
</html> </html>

View File

@ -1,12 +0,0 @@
"use strict";
function loadMdFromUrl(url) {
$.get(url, function(data) {
var converter = new showdown.Converter();
var html = converter.makeHtml(data);
$("#markdown-content").html(html);
});
}
// TODO: Add more, add menu, add ...
loadMdFromUrl("content/hello.md");