-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
31 lines (27 loc) · 960 Bytes
/
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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="./css/thomasf-solarizedcssdark.css">
<script src="./js/showdown.js"></script>
<script type="text/javascript">
!(async function () {
// Make a request for a user with a given ID
const url = new URLSearchParams(window.location.search).get('src') || "./README.md";
try {
const response = await fetch(url);
if (!response.ok) throw response;
const text = await response.text();
const converter = new showdown.Converter({ tables: true, openLinksInNewWindow: true }); // 生成转换器对象
const html_info = converter.makeHtml(text); // 转换 content 内容
document.body.innerHTML = html_info;
}
catch (e) {
document.body.innerHTML = JSON.stringify(e);
}
})();
</script>
<title>home</title>
</head>
<body>
</body>
</html>