-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
69 lines (67 loc) · 2.66 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
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Docker laboratory</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.6/marked.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.22/js/uikit.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.22/css/uikit.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/highlight.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/styles/solarized-light.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/languages/bash.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/styles/default.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/languages/dockerfile.min.js"></script>
<style>
.uk-accordion-title {
background-color: rgba(0, 0, 0, 0.20);
}
.uk-accordion-content {
outline-color: rgba(0, 0, 0, 0.3);
outline-width: 1px;
outline-style: solid;
}
</style>
</head>
<body>
<div id="content" class="uk-padding"></div>
<script>
marked.setOptions({
highlight: function (code, lang) {
if(lang == undefined)
return hljs.highlightAuto(code).value;
console.log(lang)
return hljs.highlight(lang, code).value;
}
});
var renderer = new marked.Renderer();
var escaped = true;
renderer.code = function(code, lang) {
if (this.options.highlight) {
var out = this.options.highlight(code, lang);
if (out != null && out !== code) {
escaped = true;
code = out;
}
}
prefix = '<ul uk-accordion><li><div class="uk-accordion-title uk-small uk-background-muted">Code</div>';
postfix = '</li></ul>'
if (!lang) {
return prefix + '<pre class="uk-accordion-content"><code>'
+ (escaped ? code : escape(code, true))
+ '\n</code></pre>' + postfix;
}
return prefix + '<pre class="uk-accordion-content"><code class="'
+ this.options.langPrefix
+ escape(lang, true)
+ '">'
+ (escaped ? code : escape(code, true))
+ '\n</code></pre>\n' + postfix;
};
$.get( "feladatok.md", function( data ) {
document.getElementById('content').innerHTML =
marked(data, {renderer: renderer});
});
</script>
</body>
</html>