Skip to content

Commit d4bfe95

Browse files
committed
Add highlighting and fix font size on code blocks
1 parent f7c014b commit d4bfe95

File tree

4 files changed

+102
-4
lines changed

4 files changed

+102
-4
lines changed

_includes/header.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<!--[if gte IE 5]>
3737
<link rel="stylesheet" href="/assets/css/style-print.css" media="print">
3838
<![endif]-->
39+
<link rel="stylesheet" href="/assets/css/native.css">
3940
<link rel="alternate" type="application/atom+xml" title="Blog posts" href="/feed.xml" />
4041
</head>
4142
<body>

assets/css/native.css

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
.highlight .hll { background-color: #404040 }
2+
.highlight { background: #202020; color: #d0d0d0 }
3+
.highlight .c { color: #999999; font-style: italic } /* Comment */
4+
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
5+
.highlight .esc { color: #d0d0d0 } /* Escape */
6+
.highlight .g { color: #d0d0d0 } /* Generic */
7+
.highlight .k { color: #6ab825; font-weight: bold } /* Keyword */
8+
.highlight .l { color: #d0d0d0 } /* Literal */
9+
.highlight .n { color: #d0d0d0 } /* Name */
10+
.highlight .o { color: #d0d0d0 } /* Operator */
11+
.highlight .x { color: #d0d0d0 } /* Other */
12+
.highlight .p { color: #d0d0d0 } /* Punctuation */
13+
.highlight .ch { color: #999999; font-style: italic } /* Comment.Hashbang */
14+
.highlight .cm { color: #999999; font-style: italic } /* Comment.Multiline */
15+
.highlight .cp { color: #cd2828; font-weight: bold } /* Comment.Preproc */
16+
.highlight .cpf { color: #999999; font-style: italic } /* Comment.PreprocFile */
17+
.highlight .c1 { color: #999999; font-style: italic } /* Comment.Single */
18+
.highlight .cs { color: #e50808; font-weight: bold; background-color: #520000 } /* Comment.Special */
19+
.highlight .gd { color: #d22323 } /* Generic.Deleted */
20+
.highlight .ge { color: #d0d0d0; font-style: italic } /* Generic.Emph */
21+
.highlight .gr { color: #d22323 } /* Generic.Error */
22+
.highlight .gh { color: #ffffff; font-weight: bold } /* Generic.Heading */
23+
.highlight .gi { color: #589819 } /* Generic.Inserted */
24+
.highlight .go { color: #cccccc } /* Generic.Output */
25+
.highlight .gp { color: #aaaaaa } /* Generic.Prompt */
26+
.highlight .gs { color: #d0d0d0; font-weight: bold } /* Generic.Strong */
27+
.highlight .gu { color: #ffffff; text-decoration: underline } /* Generic.Subheading */
28+
.highlight .gt { color: #d22323 } /* Generic.Traceback */
29+
.highlight .kc { color: #6ab825; font-weight: bold } /* Keyword.Constant */
30+
.highlight .kd { color: #6ab825; font-weight: bold } /* Keyword.Declaration */
31+
.highlight .kn { color: #6ab825; font-weight: bold } /* Keyword.Namespace */
32+
.highlight .kp { color: #6ab825 } /* Keyword.Pseudo */
33+
.highlight .kr { color: #6ab825; font-weight: bold } /* Keyword.Reserved */
34+
.highlight .kt { color: #6ab825; font-weight: bold } /* Keyword.Type */
35+
.highlight .ld { color: #d0d0d0 } /* Literal.Date */
36+
.highlight .m { color: #3677a9 } /* Literal.Number */
37+
.highlight .s { color: #ed9d13 } /* Literal.String */
38+
.highlight .na { color: #bbbbbb } /* Name.Attribute */
39+
.highlight .nb { color: #24909d } /* Name.Builtin */
40+
.highlight .nc { color: #447fcf; text-decoration: underline } /* Name.Class */
41+
.highlight .no { color: #40ffff } /* Name.Constant */
42+
.highlight .nd { color: #ffa500 } /* Name.Decorator */
43+
.highlight .ni { color: #d0d0d0 } /* Name.Entity */
44+
.highlight .ne { color: #bbbbbb } /* Name.Exception */
45+
.highlight .nf { color: #447fcf } /* Name.Function */
46+
.highlight .nl { color: #d0d0d0 } /* Name.Label */
47+
.highlight .nn { color: #447fcf; text-decoration: underline } /* Name.Namespace */
48+
.highlight .nx { color: #d0d0d0 } /* Name.Other */
49+
.highlight .py { color: #d0d0d0 } /* Name.Property */
50+
.highlight .nt { color: #6ab825; font-weight: bold } /* Name.Tag */
51+
.highlight .nv { color: #40ffff } /* Name.Variable */
52+
.highlight .ow { color: #6ab825; font-weight: bold } /* Operator.Word */
53+
.highlight .w { color: #666666 } /* Text.Whitespace */
54+
.highlight .mb { color: #3677a9 } /* Literal.Number.Bin */
55+
.highlight .mf { color: #3677a9 } /* Literal.Number.Float */
56+
.highlight .mh { color: #3677a9 } /* Literal.Number.Hex */
57+
.highlight .mi { color: #3677a9 } /* Literal.Number.Integer */
58+
.highlight .mo { color: #3677a9 } /* Literal.Number.Oct */
59+
.highlight .sa { color: #ed9d13 } /* Literal.String.Affix */
60+
.highlight .sb { color: #ed9d13 } /* Literal.String.Backtick */
61+
.highlight .sc { color: #ed9d13 } /* Literal.String.Char */
62+
.highlight .dl { color: #ed9d13 } /* Literal.String.Delimiter */
63+
.highlight .sd { color: #ed9d13 } /* Literal.String.Doc */
64+
.highlight .s2 { color: #ed9d13 } /* Literal.String.Double */
65+
.highlight .se { color: #ed9d13 } /* Literal.String.Escape */
66+
.highlight .sh { color: #ed9d13 } /* Literal.String.Heredoc */
67+
.highlight .si { color: #ed9d13 } /* Literal.String.Interpol */
68+
.highlight .sx { color: #ffa500 } /* Literal.String.Other */
69+
.highlight .sr { color: #ed9d13 } /* Literal.String.Regex */
70+
.highlight .s1 { color: #ed9d13 } /* Literal.String.Single */
71+
.highlight .ss { color: #ed9d13 } /* Literal.String.Symbol */
72+
.highlight .bp { color: #24909d } /* Name.Builtin.Pseudo */
73+
.highlight .fm { color: #447fcf } /* Name.Function.Magic */
74+
.highlight .vc { color: #40ffff } /* Name.Variable.Class */
75+
.highlight .vg { color: #40ffff } /* Name.Variable.Global */
76+
.highlight .vi { color: #40ffff } /* Name.Variable.Instance */
77+
.highlight .vm { color: #40ffff } /* Name.Variable.Magic */
78+
.highlight .il { color: #3677a9 } /* Literal.Number.Integer.Long */

assets/css/style-reduced.css

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,25 @@ th, td {
154154
code {
155155
font-size: 11pt;
156156
background: #404040;
157-
border-radius: 3pt; /* N/A on IE6 */
158-
padding: 0pt 3pt;
157+
border-radius: 4px; /* N/A on IE6 */
158+
padding: 0pt 4px;
159+
}
160+
pre.highlight > code {
161+
background: #202020; /* manual override instead of :not */
162+
}
163+
div.highlighter-rouge {
164+
width: 100%;
165+
overflow-x: scroll; /* auto results in overlapping scrollbar */
166+
}
167+
div.highlight {
168+
border-radius: 8px; /* N/A on IE6 */
169+
}
170+
pre.highlight {
171+
margin: 0;
172+
padding: 6px 8px;
173+
}
174+
pre.highlight > code {
175+
padding: 0;
159176
}
160177
iframe {
161178
display: block;

assets/css/style.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,17 @@ div.scroll > table > thead > tr > th {
278278
div.td2nowrap > table > tbody > tr > td:nth-child(2) {
279279
white-space: nowrap;
280280
}
281-
code, div.highlight {
281+
code {
282282
font-size: 0.95em;
283+
}
284+
:not(pre.highlight) > code, div.highlight {
283285
background: #404040;
284286
}
285287
code {
286288
border-radius: 4px;
287289
padding: 0 4px;
288290
}
289-
div:has(div.highlight) {
291+
div.highlighter-rouge {
290292
overflow-x: hidden;
291293
}
292294
div.highlight {

0 commit comments

Comments
 (0)