-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
85 lines (81 loc) · 2.85 KB
/
example.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Syntax Highligthing Test Templae</title>
<style>
.highlight {
font-family: 'Consolas', monospace;
line-height: 1.2rem;
}
.highlight pre { padding: 0px; margin: 0px; }
.highlight b { font-weight: normal; }
.highlight div:nth-child(1) {
display: inline-block;
text-align: right;
width: 2rem;
float: left;
margin-right: 1rem;
}
.highlight div:nth-child(2) { display: inline-block; }
.highlight .ln {
display: inline-block;
font-style: italic;
width: 100%;
color: #8c8c8c;
height: 1rem;
font-size: 0.75rem;
padding: 0px;
margin: 0px;
}
.highlight .kw {
font-weight: bold;
color: #660066;
}
.highlight .comment {
font-style: italic;
color: #808080;
}
.highlight .op {
color: #4d4d4d;
}
.highlight .cst {
color: #006600;
}
.highlight .str {
color: #b36b00;
}
.highlight .ty {
font-weight: bold;
color: #000099;
}
@media(prefers-color-scheme: dark) {
/* Only for testing, should be removed in proper use. */
html { background-color: #333; }
.highlight {
background-color: inherit;
color: white;
}
.highlight .kw { color: #ff00ff; }
.highlight .ty { color: #4d4dff; }
.highlight .op { color: #cccccc; }
.highlight .cst { color: #4dff4d; }
.highlight .str { color: #ffc266; }
}
</style>
</head>
<body>
<div class="highlight"><div><b class="ln">1</b><b class="ln">2</b><b class="ln">3</b><b class="ln">4</b><b class="ln">5</b><b class="ln">6</b><b class="ln">7</b><b class="ln">8</b><b class="ln">9</b><b class="ln">10</b></div>
<div><pre>
<b class="comment">// A simple example!</b>
<b class="ty">float</b> <b class="id">foo</b><b class="op">(</b><b class="ty">size_t</b> <b class="cst">N</b>, <b class="ty">float</b> <b class="kw">const</b> <b class="op">*</b><b class="cst">A</b><b class="op">)</b> <b class="op">{</b>
<b class="ty">float</b> <b class="id">sum</b> <b class="op">=</b> <b class="cst">0.f</b><b class="op">;</b>
<b class="kw">for</b> <b class="op">(</b><b class="ty">size_t</b> <b class="id">i</b> <b class="op">=</b> <b class="cst">0</b><b class="op">;</b> <b class="id">i</b> <b class="op"><</b> <b class="cst">N</b><b class="op">;</b> <b class="id">i</b><b class="op">++)</b>
<b class="id">sum</b> <b class="op">+=</b> <b class="cst">A</b><b class="op">[</b><b class="id">i</b><b class="op">];</b>
<b class="comment">// Yet another comment.</b>
<b class="id">printf</b><b class="op">(</b><b class="str">"sum: %f\\n"</b>, <b class="id">sum</b><b class="op">);</b>
<b class="kw">return</b> <b class="id">sum</b><b class="op">;</b>
<b class="op">}</b>
</pre></div></div>
</body>
</html>