Skip to content

Commit b8e7658

Browse files
committed
custom syntax highlighting
1 parent e2756d9 commit b8e7658

File tree

2 files changed

+212
-1
lines changed

2 files changed

+212
-1
lines changed

book/book.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ sansfontfallback = ["Noto Color Emoji:mode=harf"]
5151
monofontfallback = [
5252
"Noto Color Emoji:mode=harf",
5353
]
54-
monobackgroundcolor = "\\color[HTML]{e7e7e7}"
5554
linkcolor = "Links"
5655
urlcolor = "Links"
5756
linkstyle = "bold"
@@ -64,6 +63,7 @@ header-includes = [
6463
# Reduce font size of code blocks
6564
"\\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\\\\{\\},fontsize=\\small}",
6665
]
66+
highlight-style = "book/custom.theme"
6767

6868
[output.pandoc.profile.paperback]
6969
output-file = "100-exercises-to-learn-rust.pdf"

book/custom.theme

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
{
2+
"text-color": "#c9d1d9",
3+
"background-color": "#343942",
4+
"line-number-color": null,
5+
"line-number-background-color": null,
6+
"text-styles": {
7+
"Alert": {
8+
"text-color": "#ff0000",
9+
"background-color": null,
10+
"bold": true,
11+
"italic": false,
12+
"underline": false
13+
},
14+
"Annotation": {
15+
"text-color": "#8b949e",
16+
"background-color": null,
17+
"bold": true,
18+
"italic": true,
19+
"underline": false
20+
},
21+
"Attribute": {
22+
"text-color": "#03DAC5",
23+
"background-color": null,
24+
"bold": false,
25+
"italic": false,
26+
"underline": false
27+
},
28+
"BaseN": {
29+
"text-color": "#03DAC5",
30+
"background-color": null,
31+
"bold": false,
32+
"italic": false,
33+
"underline": false
34+
},
35+
"BuiltIn": {
36+
"text-color": "#03DAC5",
37+
"background-color": null,
38+
"bold": false,
39+
"italic": false,
40+
"underline": false
41+
},
42+
"Char": {
43+
"text-color": "#03DAC5",
44+
"background-color": null,
45+
"bold": false,
46+
"italic": false,
47+
"underline": false
48+
},
49+
"Comment": {
50+
"text-color": "#8b949e",
51+
"background-color": null,
52+
"bold": false,
53+
"italic": true,
54+
"underline": false
55+
},
56+
"CommentVar": {
57+
"text-color": "#8b949e",
58+
"background-color": null,
59+
"bold": true,
60+
"italic": true,
61+
"underline": false
62+
},
63+
"Constant": {
64+
"text-color": "#79c0ff",
65+
"background-color": null,
66+
"bold": false,
67+
"italic": false,
68+
"underline": false
69+
},
70+
"ControlFlow": {
71+
"text-color": "#03DAC5",
72+
"background-color": null,
73+
"bold": true,
74+
"italic": false,
75+
"underline": false
76+
},
77+
"DataType": {
78+
"text-color": "#8b949e",
79+
"background-color": null,
80+
"bold": false,
81+
"italic": false,
82+
"underline": false
83+
},
84+
"DecVal": {
85+
"text-color": "#79c0ff",
86+
"background-color": null,
87+
"bold": false,
88+
"italic": false,
89+
"underline": false
90+
},
91+
"Documentation": {
92+
"text-color": "#8b949e",
93+
"background-color": null,
94+
"bold": false,
95+
"italic": true,
96+
"underline": false
97+
},
98+
"Error": {
99+
"text-color": "#ff0000",
100+
"background-color": null,
101+
"bold": true,
102+
"italic": false,
103+
"underline": false
104+
},
105+
"Extension": {
106+
"text-color": null,
107+
"background-color": null,
108+
"bold": false,
109+
"italic": false,
110+
"underline": false
111+
},
112+
"Float": {
113+
"text-color": "#79c0ff",
114+
"background-color": null,
115+
"bold": false,
116+
"italic": false,
117+
"underline": false
118+
},
119+
"Function": {
120+
"text-color": "#d2a8ff",
121+
"background-color": null,
122+
"bold": false,
123+
"italic": false,
124+
"underline": false
125+
},
126+
"Import": {
127+
"text-color": "#8b949e",
128+
"background-color": null,
129+
"bold": true,
130+
"italic": false,
131+
"underline": false
132+
},
133+
"Information": {
134+
"text-color": "#8b949e",
135+
"background-color": null,
136+
"bold": true,
137+
"italic": true,
138+
"underline": false
139+
},
140+
"Keyword": {
141+
"text-color": "#03DAC5",
142+
"background-color": null,
143+
"bold": true,
144+
"italic": false,
145+
"underline": false
146+
},
147+
"Operator": {
148+
"text-color": "#03DAC5",
149+
"background-color": "#161b22",
150+
"bold": false,
151+
"italic": false,
152+
"underline": false
153+
},
154+
"Other": {
155+
"text-color": "#007020",
156+
"background-color": null,
157+
"bold": false,
158+
"italic": false,
159+
"underline": false
160+
},
161+
"Preprocessor": {
162+
"text-color": "#03DAC5",
163+
"background-color": null,
164+
"bold": false,
165+
"italic": false,
166+
"underline": false
167+
},
168+
"SpecialChar": {
169+
"text-color": "#03DAC5",
170+
"background-color": null,
171+
"bold": false,
172+
"italic": false,
173+
"underline": false
174+
},
175+
"SpecialString": {
176+
"text-color": "#03DAC5",
177+
"background-color": null,
178+
"bold": false,
179+
"italic": false,
180+
"underline": false
181+
},
182+
"String": {
183+
"text-color": "#03DAC5",
184+
"background-color": null,
185+
"bold": false,
186+
"italic": false,
187+
"underline": false
188+
},
189+
"Variable": {
190+
"text-color": "#a8daff",
191+
"background-color": null,
192+
"bold": false,
193+
"italic": false,
194+
"underline": false
195+
},
196+
"VerbatimString": {
197+
"text-color": "#03DAC5",
198+
"background-color": null,
199+
"bold": false,
200+
"italic": false,
201+
"underline": false
202+
},
203+
"Warning": {
204+
"text-color": "#60a0b0",
205+
"background-color": null,
206+
"bold": true,
207+
"italic": true,
208+
"underline": false
209+
}
210+
}
211+
}

0 commit comments

Comments
 (0)