-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
67 lines (59 loc) · 1.68 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.14.2/styles/solarized-dark.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.14.2/highlight.min.js"></script>
<script src="./highlightjs-highlight-filename.js"></script>
<script>
hljs.initHighlightingOnLoad();
hljs.initHighlightFilenameOnLoad([
{filename: 'main.c'},
{filename: 'program.py', backgroundColor: 'white', color: '#000'},
null,
{filename: 'main.cpp', backgroundColor: '#111'},
]);
</script>
</head>
<body>
<h1>highlightjs-highlight-filename.js Examples</h1>
<h2>Example 1</h2>
<pre>
<code>#include <stdio.h>
void print_text(char[] text) {
printf("%s\n", text);
}
int main() {
printf("hoge\n");
print_text("foobar");
return 0;
}</code>
</pre>
<h2>Example 2</h2>
<pre>
<code># coding: utf-8
def main():
print('hoge')
if __name__ == '__main__':
main()</code>
</pre>
<h2>Example 3 (not make filename)</h2>
<pre>
<code>$ echo hoge
hoge</code>
</pre>
<h2>Example 4 (scroll)</h2>
<div style="width: 100px;">
<pre>
<code>#include <iostream>
auto main() -> int {
using namespace std;
cout << "this is too long sentence......" << endl;
return 0;
}
</code>
</pre>
</div>
</body>
</html>