-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
118 lines (89 loc) · 4.22 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="fetch" content="true">
<meta name="description" content="Write Markdown as task-descriptions for your students, this markdown interpreter additionally allows to integrate formulas, ASCII-art and videos. For more information, see <br><a href='https://github.com/Cross-Lab-Project/edrys_module-markdown-it' target='_blank'>https://github.com/Cross-Lab-Project/edrys_module-markdown-it</a>" />
<meta name="show-in" content="*" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/default.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/markdown-it-texmath/css/texmath.min.css" />
<script src="https://cdn.jsdelivr.net/npm/markdown-it-texmath/texmath.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.css">
<script src="https://cdn.jsdelivr.net/npm/katex/dist/katex.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/9.2.2/mermaid.min.js"></script>
<script src="dist/index.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/13.0.1/markdown-it.min.js"></script>
<script src="https://cross-lab-project.github.io/edrys-Lite/module/edrys.js"></script>
<script defer src="https://cross-lab-project.github.io/edrys-Lite/module/vendor/alpine.min.js"></script>
<link rel="stylesheet" href="https://cross-lab-project.github.io/edrys-Lite/module/vendor/water.min.css" />
<link rel="stylesheet" href="https://cross-lab-project.github.io/edrys-Lite/module/vendor/open-iconic/css/open-iconic.min.css" />
<script>
function init() {
if (window.md) return
if (!window.markdownItTextualUml) {
setTimeout(init, 100)
return
}
window.md = markdownit()
// enable everything
window.md.options.html = true
window.md.options.linkify = true
window.md.options.typographer = true
window.md.options.highlight = function (str, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return '<pre class="hljs"><code style="border-radius: 0px">' +
hljs.highlight(str, {
language: lang,
ignoreIllegals: true
}).value +
'</code></pre>';
} catch (__) {}
}
return '<pre class="hljs"><code style="border-radius: 0px">' + md.utils.escapeHtml(str) +
'</code></pre>';
}
window.md.use(
texmath, {
engine: katex,
delimiters: 'dollars',
katexOptions: {
macros: {
"\\RR": "\\mathbb{R}"
}
}
})
.use(window.markdownItTextualUml)
}
function render(content) {
if (window.md) {
document.body.innerHTML = md.render(content)
setTimeout(() => {
console.warn("loading mermaid")
mermaid.initialize({
startOnLoad: true
})
}, 1000)
} else {
setTimeout(() => {
render(content)
}, 100)
}
}
window.onload = init
Edrys.onReady(() => {
console.log("Markdown-IT loaded")
init()
let content = Edrys.module.config || ""
content += "\n\n" + (Edrys.module[Edrys.role.toLowerCase() + 'Config'] || "")
render(content)
});
</script>
<title>Markdown-IT</title>
</head>
<body>
</body>
</html>