Skip to content

Commit 85296c9

Browse files
committed
Add syntax highlighting and code examples page
1 parent 1f486ad commit 85296c9

4 files changed

Lines changed: 529 additions & 0 deletions

File tree

www/_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ navigation:
9393
url: /implementations/
9494
- title: Playground
9595
url: /playground/
96+
- title: Code Examples
97+
url: /code-examples/
9698
- title: Developer Resources
9799
url: /resources/
98100
- title: Community

www/_layouts/default.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<!-- CSS -->
3434
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/variables.css">
3535
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/main.css">
36+
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/syntax.css">
3637
<!-- JavaScript -->
3738
<script defer src="{{ site.baseurl }}/assets/js/main.js"></script>
3839
{% if jekyll.environment == 'production' and site.google_analytics %}

www/assets/css/syntax.css

Lines changed: 319 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,319 @@
1+
/* Syntax highlighting styles for Rouge */
2+
.highlight table td {
3+
padding: 5px;
4+
}
5+
6+
.highlight table pre {
7+
margin: 0;
8+
}
9+
10+
.highlight .gh {
11+
color: #999999;
12+
}
13+
14+
.highlight .sr {
15+
color: #f6aa11;
16+
}
17+
18+
.highlight .go {
19+
color: #888888;
20+
}
21+
22+
.highlight .gp {
23+
color: #555555;
24+
}
25+
26+
.highlight .gs {}
27+
28+
.highlight .gu {
29+
color: #aaaaaa;
30+
}
31+
32+
.highlight .nb {
33+
color: #f6aa11;
34+
}
35+
36+
.highlight .cm {
37+
color: #75715e;
38+
}
39+
40+
.highlight .cp {
41+
color: #75715e;
42+
}
43+
44+
.highlight .c1 {
45+
color: #75715e;
46+
}
47+
48+
.highlight .cs {
49+
color: #75715e;
50+
}
51+
52+
.highlight .c,
53+
.highlight .ch,
54+
.highlight .cd,
55+
.highlight .cpf {
56+
color: #75715e;
57+
}
58+
59+
.highlight .err {
60+
color: #960050;
61+
}
62+
63+
.highlight .gr {
64+
color: #960050;
65+
}
66+
67+
.highlight .gt {
68+
color: #960050;
69+
}
70+
71+
.highlight .gd {
72+
color: #49483e;
73+
}
74+
75+
.highlight .gi {
76+
color: #49483e;
77+
}
78+
79+
.highlight .ge {
80+
color: #49483e;
81+
}
82+
83+
.highlight .kc {
84+
color: #66d9ef;
85+
}
86+
87+
.highlight .kd {
88+
color: #66d9ef;
89+
}
90+
91+
.highlight .kr {
92+
color: #66d9ef;
93+
}
94+
95+
.highlight .no {
96+
color: #66d9ef;
97+
}
98+
99+
.highlight .kt {
100+
color: #66d9ef;
101+
}
102+
103+
.highlight .mf {
104+
color: #ae81ff;
105+
}
106+
107+
.highlight .mh {
108+
color: #ae81ff;
109+
}
110+
111+
.highlight .il {
112+
color: #ae81ff;
113+
}
114+
115+
.highlight .mi {
116+
color: #ae81ff;
117+
}
118+
119+
.highlight .mo {
120+
color: #ae81ff;
121+
}
122+
123+
.highlight .m,
124+
.highlight .mb,
125+
.highlight .mx {
126+
color: #ae81ff;
127+
}
128+
129+
.highlight .sc {
130+
color: #ae81ff;
131+
}
132+
133+
.highlight .se {
134+
color: #ae81ff;
135+
}
136+
137+
.highlight .ss {
138+
color: #ae81ff;
139+
}
140+
141+
.highlight .sd {
142+
color: #e6db74;
143+
}
144+
145+
.highlight .s2 {
146+
color: #e6db74;
147+
}
148+
149+
.highlight .sb {
150+
color: #e6db74;
151+
}
152+
153+
.highlight .sh {
154+
color: #e6db74;
155+
}
156+
157+
.highlight .si {
158+
color: #e6db74;
159+
}
160+
161+
.highlight .sx {
162+
color: #e6db74;
163+
}
164+
165+
.highlight .s1 {
166+
color: #e6db74;
167+
}
168+
169+
.highlight .s,
170+
.highlight .sa,
171+
.highlight .dl {
172+
color: #e6db74;
173+
}
174+
175+
.highlight .na {
176+
color: #a6e22e;
177+
}
178+
179+
.highlight .nc {
180+
color: #a6e22e;
181+
}
182+
183+
.highlight .nd {
184+
color: #a6e22e;
185+
}
186+
187+
.highlight .ne {
188+
color: #a6e22e;
189+
}
190+
191+
.highlight .nf,
192+
.highlight .fm {
193+
color: #a6e22e;
194+
}
195+
196+
.highlight .vc {
197+
color: #ffffff;
198+
}
199+
200+
.highlight .nn {
201+
color: #ffffff;
202+
}
203+
204+
.highlight .ni {
205+
color: #ffffff;
206+
}
207+
208+
.highlight .bp {
209+
color: #ffffff;
210+
}
211+
212+
.highlight .vg {
213+
color: #ffffff;
214+
}
215+
216+
.highlight .vi {
217+
color: #ffffff;
218+
}
219+
220+
.highlight .nv,
221+
.highlight .vm {
222+
color: #ffffff;
223+
}
224+
225+
.highlight .w {
226+
color: #ffffff;
227+
}
228+
229+
.highlight {
230+
color: #ffffff;
231+
background-color: #1e1e1e;
232+
padding: 1em;
233+
border-radius: 0.5em;
234+
overflow-x: auto;
235+
}
236+
237+
.highlight .n,
238+
.highlight .py,
239+
.highlight .nx {
240+
color: #ffffff;
241+
}
242+
243+
.highlight .ow {
244+
color: #f92672;
245+
}
246+
247+
.highlight .nt {
248+
color: #f92672;
249+
}
250+
251+
.highlight .k,
252+
.highlight .kv {
253+
color: #f92672;
254+
}
255+
256+
.highlight .kn {
257+
color: #f92672;
258+
}
259+
260+
.highlight .kp {
261+
color: #f92672;
262+
}
263+
264+
.highlight .o {
265+
color: #f92672;
266+
}
267+
268+
/* Additional styling for code blocks */
269+
pre.highlight {
270+
padding: 1em;
271+
margin: 1em 0;
272+
overflow-x: auto;
273+
line-height: 1.5;
274+
font-family: 'Consolas', 'Monaco', 'Andale Mono', 'Ubuntu Mono', monospace;
275+
font-size: 0.9em;
276+
}
277+
278+
code {
279+
font-family: 'Consolas', 'Monaco', 'Andale Mono', 'Ubuntu Mono', monospace;
280+
background-color: #f0f0f0;
281+
padding: 0.2em 0.4em;
282+
border-radius: 3px;
283+
font-size: 0.9em;
284+
color: #e83e8c;
285+
}
286+
287+
pre code {
288+
background-color: transparent;
289+
padding: 0;
290+
color: inherit;
291+
}
292+
293+
/* Language-specific adjustments */
294+
.language-python .k {
295+
color: #ff79c6;
296+
}
297+
298+
.language-javascript .kd {
299+
color: #ff79c6;
300+
}
301+
302+
.language-c .kt {
303+
color: #8be9fd;
304+
}
305+
306+
.language-rust .k {
307+
color: #ff79c6;
308+
}
309+
310+
/* Line numbers */
311+
.highlight .lineno {
312+
color: #6272a4;
313+
display: inline-block;
314+
padding: 0 0.5em 0 0;
315+
border-right: 1px solid #44475a;
316+
text-align: right;
317+
width: 1.5em;
318+
user-select: none;
319+
}

0 commit comments

Comments
 (0)