-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdoc.html
More file actions
47 lines (31 loc) · 1.15 KB
/
doc.html
File metadata and controls
47 lines (31 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/showdown/dist/showdown.min.js" type="text/javascript" > </script>
<script
src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.js"></script>
</head>
<body>
<script type="text/javascript">
$( document ).ready(function() {
var path = qs('path')
console.log(location)
base = 'https://raw.githubusercontent.com/Microshak/MicroNotes/master/'
if(location.host == 'localhost')
base = 'http://localhost/'
// $('#thinggy').html(html)
var filepath= base+path+'.md?ran=' + Math.random()
$.get( filepath, function( data ) {
var converter = new showdown.Converter(),
html = converter.makeHtml(data);
$('#thinggy').html(html)
});
});
function qs(key) {
key = key.replace(/[*+?^$.\[\]{}()|\\\/]/g, "\\$&"); // escape RegEx control chars
var match = location.search.match(new RegExp("[?&]" + key + "=([^&]+)(&|$)"));
return match && decodeURIComponent(match[1].replace(/\+/g, " "));
}
</script>
<div id="thinggy"></div>
</body>