-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·93 lines (91 loc) · 4.52 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui">
<title>{{title}}</title>
<link rel="stylesheet" type="text/css" href="asset/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="asset/mermaid.css">
<link type="text/css" rel="stylesheet" href="asset/style.css">
<script type="text/javascript" src="asset/jquery_plantuml/jquery.js"></script>
<script type="text/javascript" src="asset/jquery_plantuml/rawdeflate.js"></script>
<script type="text/javascript" src="asset/jquery_plantuml/encode64.js"></script>
<script src="asset/echarts.common.min.js"></script>
<script src="asset/mermaid.min.js"></script>
<script src="asset/viz.js"></script>
<!-- <script src="bower_components/viz.js/viz.js"></script>-->
<script type="text/javascript">
$(function(){
var mwebii=0;
var mwebChartEleId = 'mweb-chart-ele-';
$('pre>code').each(function(){
mwebii++;
var eleiid = mwebChartEleId+mwebii;
if($(this).hasClass('language-mermaid')){
var ele = $(this).addClass('nohighlight').parent();
ele.hide();
$('<div id="'+eleiid+'"></div>').addClass('mermaid').html($(this).text()).insertAfter(ele);
}else if($(this).hasClass('language-plantuml')){
var ele = $(this).addClass('nohighlight').parent();
ele.hide();
var str = unescape(encodeURIComponent($(this).text()));
var imgURL = "http://www.plantuml.com/plantuml/svg/"+encode64(deflate(str,9));
var newEle = $('<div id="'+eleiid+'"><img src="'+imgURL+'" /></div>').insertAfter(ele);
}else if($(this).hasClass('language-echarts')){
var ele = $(this).addClass('nohighlight').parent();
ele.hide();
$('<div style="width: 100%;" id="'+eleiid+'"></div>').insertAfter(ele);
var myChart = echarts.init(document.getElementById(eleiid));
try {
eval($(this).text());
myChart.setOption(option);
}catch(exception) {}
} else if($(this).hasClass('language-viz') || $(this).hasClass('language-viz-dot') ){
var ele = $(this).addClass('nohighlight').parent();
ele.hide();
var str = unescape(encodeURIComponent($(this).text()));
var graph = Viz(str);
$('<div style="width: 100%;" id="'+eleiid+'"></div>').html(graph).insertAfter(ele);
} else if ($(this).hasClass('language-viz-circo')) {
var ele = $(this).addClass('nohighlight').parent();
ele.hide();
var str = unescape(encodeURIComponent($(this).text()));
var graph = Viz(str, { engine: "circo" });
$('<div style="width: 100%;" id="'+eleiid+'"></div>').html(graph).insertAfter(ele);
} else if ($(this).hasClass('language-viz-fdp')) {
var ele = $(this).addClass('nohighlight').parent();
ele.hide();
var str = unescape(encodeURIComponent($(this).text()));
var graph = Viz(str, { engine: "fdp" });
$('<div style="width: 100%;" id="'+eleiid+'"></div>').html(graph).insertAfter(ele);
} else if ($(this).hasClass('language-viz-neato')) {
var ele = $(this).addClass('nohighlight').parent();
ele.hide();
var str = unescape(encodeURIComponent($(this).text()));
var graph = Viz(str, { engine: "neato" });
$('<div style="width: 100%;" id="'+eleiid+'"></div>').html(graph).insertAfter(ele);
} else if ($(this).hasClass('language-viz-osage')) {
var ele = $(this).addClass('nohighlight').parent();
ele.hide();
var str = unescape(encodeURIComponent($(this).text()));
var graph = Viz(str, { engine: "osage" });
$('<div style="width: 100%;" id="'+eleiid+'"></div>').html(graph).insertAfter(ele);
} else if ($(this).hasClass('language-viz-twopi')) {
var ele = $(this).addClass('nohighlight').parent();
ele.hide();
var str = unescape(encodeURIComponent($(this).text()));
var graph = Viz(str, { engine: "twopi" });
$('<div style="width: 100%;" id="'+eleiid+'"></div>').html(graph).insertAfter(ele);
}
});
mermaid.init({noteMargin: 10}, ".mermaid");
});
</script>
{{head}}
</head>
<body>
<div class="markdown-body">
{{content}}
</div>
</body>
</html>