-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmd.html
66 lines (57 loc) · 1.48 KB
/
md.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1" />
<title>ahuigo的自留地</title>
<meta name="author" content="ahuigo">
<link rel="stylesheet" href="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/KaTeX/0.15.2/katex.min.css">
<link rel="stylesheet" href="/assets/main.css">
<script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/KaTeX/0.15.2/katex.min.js"></script>
<script src="/assets/marked.js"></script>
</head>
<script>
marked.setOptions({
gfm: true,
breaks: true,
latexRender: katex.renderToString.bind(katex),
});
$ = document.querySelector.bind(document)
function mdRender(){
var text = $('#input').value
$('#preview').innerHTML = marked (text);
}
window.onload=mdRender
</script>
</head>
<body>
<textarea id="input" oninput="mdRender()" "autofocus">
# Example By [AHUIGO](/)
## Latex
$\displaystyle \sum_i^j$
$f(x)=sin^2x+cos^2x\\
\qquad = 1$
$\binom{n}{k}=\mathrm{C}_n^k$
## Table
First Header | Second Header
------------ | -------------
Content Cell | Content Cell
Content Cell | Content Cell
</textarea>
<div id="preview"> </div>
<style>
em{ color:red}
body{display:flex}
textarea{width:50%;min-height:600px}
#preview{
padding: 0 1em; margin: 0em 1em; overflow:auto;
}
pre{
padding: 2em 1em; margin: 0 2em 2em 0; border-radius: 1em;
line-height: 2em;
width:90%;
background: #f5f2f0;
}
</style>
</body>
</html>