added static folder

switch to fancy css
This commit is contained in:
2018-09-19 21:10:07 +01:00
parent 482fdc3da9
commit 9ccd80c91f
5 changed files with 71 additions and 66 deletions

13
md2html/static/custom.css Normal file
View File

@@ -0,0 +1,13 @@
.markdown-body {
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px;
}
@media (max-width: 767px) {
.markdown-body {
padding: 15px;
}
}

View File

@@ -0,0 +1,19 @@
function req(first) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onload = function() {
if (xmlhttp.status == 200) {
document.querySelector("article.markdown-body").innerHTML = xmlhttp.responseText;
} else if(xmlhttp.status == 304) {
} else {
console.log(xmlhttp.status, xmlhttp.statusText);
}
req(false);
};
xmlhttp.onerror = function() {
console.log(xmlhttp.status, xmlhttp.statusText);
setTimeout(req, 1000, false);
};
xmlhttp.open("GET", first ? "/markdown" : "/reload", true);
xmlhttp.send();
}
req(true);

View File

@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
{css}
</head>
<body>
{script}
<article class="markdown-body">
{content}
</article>
</body>
</html>