-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
48 lines (33 loc) · 1.36 KB
/
index.html
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
<!doctype html>
<html lang=en >
<head>
<title></title>
<meta charset=utf-8 />
<meta name=viewport content='width=device-width,user-scalable=no,minimum-scale=1.0,maximum-scale=1.0' />
</head>
<body>
<script>
var script = document.body.appendChild( document.createElement( 'script' ) );
script.onload = init;
script.src = 'http://cdnjs.cloudflare.com/ajax/libs/showdown/0.3.1/showdown.min.js';
function init() {
document.body.style.cssText = ' font: bold 12pt monospace; left: 0; margin: 0 auto; max-width: 900px; position: absolute; right: 0; ';
var info = document.body.appendChild( document.createElement( 'div' ) );
var fileName = location.hash ? location.hash.split( '#' )[1] : 'readme.md';
document.title = document.title ? document.title : fileName;
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( 'GET', fileName, true );
xmlHttp.onreadystatechange = function() {
info.innerHTML = xmlHttp.readyState === 4 ? new Showdown.converter().makeHtml( xmlHttp.responseText ) : '';
};
xmlHttp.send( null );
}
/*
Visible only on GitHub
<span style=display:none; >[View as web page]( http://xxxxx.github.io/xxxxx/ "View file as a web page." ) </span>
Visible only on the web page
<input type=button value='View file as source code on GitHub' onclick=window.location.href='http://github.com/xxxxx/xxxxx/tree/gh-pages/'; />
*/
</script>
</body>
</html>