-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
56 lines (40 loc) · 1.81 KB
/
index.html
File metadata and controls
56 lines (40 loc) · 1.81 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
48
49
50
51
52
53
54
55
56
<!doctype html>
<html lang=en >
<head>
<meta charset=utf-8 >
<title>Index Markdown Reader R1</title>
<meta name=viewport content='width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui' >
<meta name=description content='Markdown reader template file' >
<meta name=keywords content='JavaScript,GitHub,FOSS,3D,STEM' >
<meta name=date content='2016-03-12' >
</head>
<body>
<script src=https://cdnjs.cloudflare.com/ajax/libs/showdown/1.3.0/showdown.min.js ></script>
<script>
init();
function init() {
var css = document.head.appendChild( document.createElement( 'style' ) );
css.innerHTML =
'body { font: 12pt monospace; left: 0; margin: 0 auto; max-width: 800px; right: 0; }' +
'h2 { margin: 0; }' +
'h2 a { text-decoration: none; }' +
'button, input[type=button] { background-color: #eee; border: 2px #eee solid; color: #888; }' +
'input[type=range] { -webkit-appearance: none; -moz-appearance: none; background-color: silver; width: 160px; }' +
'input[type=range]::-moz-range-thumb { background-color: #888; border-radius: 0; width: 10px; }' +
'input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; background-color: #888; height: 20px; width: 10px; }' +
'';
contents = document.body.appendChild( document.createElement( 'div' ) );
contents.id = 'contents';
var converter = new showdown.Converter( { strikethrough: true, literalMidWordUnderscores: true, simplifiedAutoLink: true, tables: true });
var fileName = location.hash ? location.hash.substr( 1 ) : 'readme.md';
var xhr = new XMLHttpRequest();
xhr.open( 'get', fileName, true );
xhr.onreadystatechange = function() {
if ( xhr.readyState !== 4 ) { return; }
contents.innerHTML = converter.makeHtml( xhr.responseText );
};
xhr.send( null );
}
</script>
</body>
</html>