added static folder
switch to fancy css
This commit is contained in:
13
md2html/static/custom.css
Normal file
13
md2html/static/custom.css
Normal 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;
|
||||
}
|
||||
}
|
19
md2html/static/hot-reload.js
Normal file
19
md2html/static/hot-reload.js
Normal 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);
|
13
md2html/static/template.html
Normal file
13
md2html/static/template.html
Normal 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>
|
Reference in New Issue
Block a user