forked from nagaozen/markdown-it-toc-done-right
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tdd.helper.html
47 lines (38 loc) · 1.37 KB
/
tdd.helper.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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>markdown-it-toc-done-right</title>
<style>
body { scroll-behavior: smooth; }
/* More about scroll-behavior @ <https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior> */
ol { counter-reset: list-item; }
li { display: block; counter-increment: list-item; }
li:before { content: counters(list-item,'.') ' '; }
/* More about nested counters @ <https://www.w3.org/TR/css-lists-3/> */
</style>
</head>
<body>
<script src="https://unpkg.com/markdown-it/dist/markdown-it.min.js"></script>
<script src="lib/markdown-it-anchor.js"></script>
<script src="lib/uslug.js"></script>
<script src="dist/markdown-it-toc-made-right.min.js"></script>
<!-- text/markdown isn't a standard, but has an informational rfc @ <https://tools.ietf.org/html/rfc7763> -->
<script id="md" type="text/markdown">
${toc}
# header
## header
## header 2
</script>
<script>
/*var uslugify = function(s) {
return window.uslug(s);
}*/
var md = window.markdownit();
md.use(window.markdownItAnchor, { permalink: true, permalinkBefore: true, permalinkSymbol: '§'/*, slugify: uslugify, level: 2*/ })
.use(window.markdownitTocDoneRight, { /*slugify: uslugify, level: 2*/ });
document.body.innerHTML = md.render( document.getElementById("md").innerHTML );
</script>
</body>
</html>