Skip to content

Commit 4060346

Browse files
committed
Clean up formatting, including a custom 'cli' language definition for highlight.js
1 parent da138a3 commit 4060346

File tree

6 files changed

+195
-142
lines changed

6 files changed

+195
-142
lines changed

resources/background.webp

22.2 KB
Loading

resources/scripts.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,46 @@ if (window.self === window.top) {
3434
Reveal.on('ready', toggleFooter);
3535
Reveal.on('slidechanged', toggleFooter);
3636
}
37+
38+
/**
39+
* Inject our custom highlight.js language (cli).
40+
*
41+
* This relies on the window.options variable defined in {@see reveal-md/lib/template/reveal.html}.
42+
*/
43+
if (typeof window.options !== undefined) {
44+
window.options.highlight.beforeHighlight = (hljs) => hljs.registerLanguage('cli', (hljs) => {
45+
return {
46+
name: 'CLI',
47+
case_insensitive: true,
48+
contains: [
49+
hljs.HASH_COMMENT_MODE,
50+
hljs.QUOTE_STRING_MODE,
51+
// Bash prompt ($ or ~)
52+
{
53+
scope: 'title',
54+
match: /^\s*[\$~]\s+/,
55+
},
56+
// Boolean operators (&&, ||)
57+
{
58+
scope: 'built_in',
59+
match: /(&&|\|\|)/
60+
},
61+
// Escape characters at the end of a line
62+
{
63+
scope: 'built_in',
64+
match: /\\s*$/,
65+
},
66+
// Single pipes, redirection
67+
{
68+
scope: 'built_in',
69+
match: /[\|>]/,
70+
},
71+
// Command options
72+
{
73+
scope: 'variable',
74+
match: /\s-{1,2}[a-z0-9-_]+=?/,
75+
}
76+
],
77+
};
78+
});
79+
}

resources/spidey-sense.jpg

-271 KB
Binary file not shown.

resources/spidey-sense.png

556 KB
Loading

resources/styles.css

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
.reveal {
1919
font-family: var(--r-body-font);
20+
background: url('./background.webp') center center repeat;
2021
}
2122

2223
/* Special styling for the title slide. */
@@ -40,18 +41,6 @@
4041
font-size: .86em;
4142
}
4243

43-
/* Invert colors for slides with dark backgrounds. */
44-
.reveal .dark-bg {
45-
--r-heading-color: #fff;
46-
--r-main-color: #fff;
47-
48-
color: var(--r-main-color);
49-
}
50-
51-
.reveal .dark-bg a {
52-
color: inherit;
53-
}
54-
5544
/* Persistent footer */
5645
.presentation-footer {
5746
--presentation-footer-color: var(--subdued-text-color);
@@ -94,17 +83,17 @@
9483
display: block;
9584
}
9685

97-
/* Blockquotes */
86+
/* Blockquotes and figures */
9887
.reveal blockquote {
9988
width: 90%;
100-
font-size: 1.2em;
10189
box-shadow: none;
10290
}
10391

10492
.reveal blockquote::before {
10593
content: '\201C';
10694
position: absolute;
107-
top: .3em;
95+
top: .5em;
96+
left: -.3em;
10897
font-family: Georgia, serif;
10998
font-size: 2.25em;
11099
line-height: 0;
@@ -115,12 +104,13 @@
115104
margin-bottom: 0;
116105
}
117106

107+
.reveal cite,
118108
.reveal figure figcaption {
119109
font-size: .8em;
120110
color: var(--subdued-text-color);
121111
}
122112

123-
.reveal figure cite:before {
113+
.reveal cite:before {
124114
content: '—';
125115
}
126116

@@ -170,7 +160,18 @@
170160
border-radius: 50%;
171161
}
172162

163+
/* Allow definition lists to be centered */
164+
.reveal dl {
165+
margin-left: 0;
166+
text-align: center;
167+
}
168+
169+
.reveal dl dd {
170+
margin-left: 0;
171+
}
172+
173173
/* Extra space between elements in a definition list */
174+
.reveal dl + p,
174175
dd + dt {
175176
margin-top: 1em;
176177
}
@@ -179,3 +180,23 @@ dd + dt {
179180
.no-transform {
180181
text-transform: none;
181182
}
183+
184+
/* Hide text that's hidden for the sake of presentation. */
185+
.screen-reader-text {
186+
border: 0;
187+
clip: rect(1px, 1px, 1px, 1px);
188+
clip-path: inset(50%);
189+
height: 1px;
190+
margin: -1px;
191+
overflow: hidden;
192+
padding: 0;
193+
position: absolute;
194+
width: 1px;
195+
word-wrap: normal;
196+
}
197+
198+
/* Don't bold types for variables */
199+
code .typehint {
200+
font-weight: normal;
201+
font-style: italic;
202+
}

0 commit comments

Comments
 (0)