Skip to content

Commit d55ac37

Browse files
committed
GitHub code syntax highlighting, refs simonw#20
1 parent eedff83 commit d55ac37

File tree

3 files changed

+132
-0
lines changed

3 files changed

+132
-0
lines changed

.github/workflows/build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
--branch main \
6262
--project simon-til \
6363
--metadata metadata.yaml \
64+
--static static:static \
6465
--install datasette-template-sql \
6566
--install datasette-atom~=0.6 \
6667
--install datasette-json-html \

static/github-light.css

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
/*!
2+
* GitHub Light v0.5.0
3+
* Copyright (c) 2012 - 2017 GitHub, Inc.
4+
* Licensed under MIT (https://github.com/primer/github-syntax-theme-generator/blob/master/LICENSE)
5+
*/
6+
7+
.pl-c /* comment, punctuation.definition.comment, string.comment */ {
8+
color: #6a737d;
9+
}
10+
11+
.pl-c1 /* constant, entity.name.constant, variable.other.constant, variable.language, support, meta.property-name, support.constant, support.variable, meta.module-reference, markup.raw, meta.diff.header, meta.output */,
12+
.pl-s .pl-v /* string variable */ {
13+
color: #005cc5;
14+
}
15+
16+
.pl-e /* entity */,
17+
.pl-en /* entity.name */ {
18+
color: #6f42c1;
19+
}
20+
21+
.pl-smi /* variable.parameter.function, storage.modifier.package, storage.modifier.import, storage.type.java, variable.other */,
22+
.pl-s .pl-s1 /* string source */ {
23+
color: #24292e;
24+
}
25+
26+
.pl-ent /* entity.name.tag, markup.quote */ {
27+
color: #22863a;
28+
}
29+
30+
.pl-k /* keyword, storage, storage.type */ {
31+
color: #d73a49;
32+
}
33+
34+
.pl-s /* string */,
35+
.pl-pds /* punctuation.definition.string, source.regexp, string.regexp.character-class */,
36+
.pl-s .pl-pse .pl-s1 /* string punctuation.section.embedded source */,
37+
.pl-sr /* string.regexp */,
38+
.pl-sr .pl-cce /* string.regexp constant.character.escape */,
39+
.pl-sr .pl-sre /* string.regexp source.ruby.embedded */,
40+
.pl-sr .pl-sra /* string.regexp string.regexp.arbitrary-repitition */ {
41+
color: #032f62;
42+
}
43+
44+
.pl-v /* variable */,
45+
.pl-smw /* sublimelinter.mark.warning */ {
46+
color: #e36209;
47+
}
48+
49+
.pl-bu /* invalid.broken, invalid.deprecated, invalid.unimplemented, message.error, brackethighlighter.unmatched, sublimelinter.mark.error */ {
50+
color: #b31d28;
51+
}
52+
53+
.pl-ii /* invalid.illegal */ {
54+
color: #fafbfc;
55+
background-color: #b31d28;
56+
}
57+
58+
.pl-c2 /* carriage-return */ {
59+
color: #fafbfc;
60+
background-color: #d73a49;
61+
}
62+
63+
.pl-c2::before /* carriage-return */ {
64+
content: "^M";
65+
}
66+
67+
.pl-sr .pl-cce /* string.regexp constant.character.escape */ {
68+
font-weight: bold;
69+
color: #22863a;
70+
}
71+
72+
.pl-ml /* markup.list */ {
73+
color: #735c0f;
74+
}
75+
76+
.pl-mh /* markup.heading */,
77+
.pl-mh .pl-en /* markup.heading entity.name */,
78+
.pl-ms /* meta.separator */ {
79+
font-weight: bold;
80+
color: #005cc5;
81+
}
82+
83+
.pl-mi /* markup.italic */ {
84+
font-style: italic;
85+
color: #24292e;
86+
}
87+
88+
.pl-mb /* markup.bold */ {
89+
font-weight: bold;
90+
color: #24292e;
91+
}
92+
93+
.pl-md /* markup.deleted, meta.diff.header.from-file, punctuation.definition.deleted */ {
94+
color: #b31d28;
95+
background-color: #ffeef0;
96+
}
97+
98+
.pl-mi1 /* markup.inserted, meta.diff.header.to-file, punctuation.definition.inserted */ {
99+
color: #22863a;
100+
background-color: #f0fff4;
101+
}
102+
103+
.pl-mc /* markup.changed, punctuation.definition.changed */ {
104+
color: #e36209;
105+
background-color: #ffebda;
106+
}
107+
108+
.pl-mi2 /* markup.ignored, markup.untracked */ {
109+
color: #f6f8fa;
110+
background-color: #005cc5;
111+
}
112+
113+
.pl-mdr /* meta.diff.range */ {
114+
font-weight: bold;
115+
color: #6f42c1;
116+
}
117+
118+
.pl-ba /* brackethighlighter.tag, brackethighlighter.curly, brackethighlighter.round, brackethighlighter.square, brackethighlighter.angle, brackethighlighter.quote */ {
119+
color: #586069;
120+
}
121+
122+
.pl-sg /* sublimelinter.gutter-mark */ {
123+
color: #959da5;
124+
}
125+
126+
.pl-corl /* constant.other.reference.link, string.other.link */ {
127+
text-decoration: underline;
128+
color: #032f62;
129+
}
130+

templates/row.html

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{% set til = display_rows[0] %}
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<title>{{ til.title }} | Simon Willison’s TILs</title>
8+
<link rel="stylesheet" href="/static/github-light.css">
89
<style>
910
body {
1011
font-family: helvetica;

0 commit comments

Comments
 (0)