Skip to content

Commit 3ab6420

Browse files
committed
style(dprint): add html support
1 parent 868e2de commit 3ab6420

File tree

5 files changed

+145
-128
lines changed

5 files changed

+145
-128
lines changed

content/2023-04-24-egu-conference.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,12 @@ data-background="https://raw.githubusercontent.com/engeir/presentations/dd0a662/
136136
-->
137137
<!-- .slide: data-background-opacity="0.15" -->
138138

139-
<!-- dprint-ignore-start -->
140139
- At the equator
141140
- <!-- .element: class="fragment" -size:29pt" --> $\mathrm{SO_2}$ injected at $18$–$20$ `$\mathrm{km}$` altitude
142-
- <!-- .element: class="fragment" -size:29pt" -->
143-
$\mathrm{SO_2}$ amounts:
141+
- <!-- .element: class="fragment" -size:29pt" --> $\mathrm{SO_2}$ amounts:
144142
- `$26\,\mathrm{Tg}$`(↓)
145143
- `$400\,\mathrm{Tg}$`(—)
146144
- `$1629\,\mathrm{Tg}$`(↑)
147-
<!-- dprint-ignore-end -->
148145

149146
Notes:
150147

dprint.jsonc

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
},
1616
"plugins": [
1717
"https://plugins.dprint.dev/markdown-0.17.8.wasm",
18-
"https://plugins.dprint.dev/exec-0.5.0.json@8d9972eee71fa1590e04873540421f3eda7674d0f1aae3d7c788615e7b7413d0"
18+
"https://plugins.dprint.dev/exec-0.5.0.json@8d9972eee71fa1590e04873540421f3eda7674d0f1aae3d7c788615e7b7413d0",
19+
"https://plugins.dprint.dev/g-plane/markup_fmt-v0.15.1.wasm"
1920
]
2021
}

theme/my-reveal.html

+72-65
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
@@ -41,12 +41,12 @@
4141
{{/cssPaths}} {{#watch}}
4242

4343
<script>
44-
document.write(
45-
'<script src="http://' +
46-
(location.host || "localhost").split(":")[0] +
47-
':35729/livereload.js?snipver=1"></' +
48-
"script>",
49-
);
44+
document.write(
45+
'<script src="http://' +
46+
(location.host || "localhost").split(":")[0] +
47+
':35729/livereload.js?snipver=1"></' +
48+
"script>",
49+
);
5050
</script>
5151
{{/watch}}
5252
</head>
@@ -56,7 +56,8 @@
5656
<section data-markdown {{{slidifyAttributes}}}>
5757
<textarea data-template>
5858
{{{markdown}}}
59-
</textarea>
59+
</textarea
60+
>
6061
</section>
6162
</div>
6263
</div>
@@ -77,83 +78,89 @@
7778
<script src="{{{base}}}/plugin/attribution/plugin.js"></script>
7879
<script src="{{{base}}}/plugin/copycode/copycode.js"></script>
7980
<script src="{{{base}}}/plugin/drawer/drawer.js"></script>
80-
<script src="{{{base}}}/plugin/elapsed-time-bar/elapsed-time-bar.js"></script>
81+
<script
82+
src="{{{base}}}/plugin/elapsed-time-bar/elapsed-time-bar.js"
83+
></script>
8184
<script src="{{{base}}}/plugin/fullscreen/plugin.js"></script>
8285
<script src="{{{base}}}/plugin/pointer/pointer.js"></script>
83-
<script src="https://unpkg.com/@bitjson/qr-code@1.0.2/dist/qr-code.js"></script>
84-
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/js/all.min.js"></script>
86+
<script
87+
src="https://unpkg.com/@bitjson/qr-code@1.0.2/dist/qr-code.js"
88+
></script>
89+
<script
90+
src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/js/all.min.js"
91+
></script>
8592
<script>
86-
function extend() {
87-
var target = {};
88-
for (var i = 0; i < arguments.length; i++) {
89-
var source = arguments[i];
90-
for (var key in source) {
91-
if (source.hasOwnProperty(key)) {
92-
target[key] = source[key];
93-
}
93+
function extend() {
94+
var target = {};
95+
for (var i = 0; i < arguments.length; i++) {
96+
var source = arguments[i];
97+
for (var key in source) {
98+
if (source.hasOwnProperty(key)) {
99+
target[key] = source[key];
94100
}
95101
}
96-
return target;
97102
}
103+
return target;
104+
}
98105

99-
// default options to init reveal.js
100-
var defaultOptions = {
101-
controls: true,
102-
progress: true,
103-
history: true,
104-
center: true,
105-
transition: 'default', // none/fade/slide/convex/concave/zoom
106-
slideNumber: true,
107-
highlight: {
108-
highlightOnLoad: false
109-
},
110-
plugins: [
111-
RevealMarkdown,
112-
RevealHighlight,
113-
RevealZoom,
114-
RevealNotes,
115-
RevealMath,
116-
// My added plugins
117-
CopyCode,
118-
RevealAttribution,
119-
RevealDrawer,
120-
RevealFullscreen,
121-
RevealPointer,
122-
]
123-
};
106+
// default options to init reveal.js
107+
var defaultOptions = {
108+
controls: true,
109+
progress: true,
110+
history: true,
111+
center: true,
112+
transition: 'default', // none/fade/slide/convex/concave/zoom
113+
slideNumber: true,
114+
highlight: {
115+
highlightOnLoad: false
116+
},
117+
plugins: [
118+
RevealMarkdown,
119+
RevealHighlight,
120+
RevealZoom,
121+
RevealNotes,
122+
RevealMath,
123+
// My added plugins
124+
CopyCode,
125+
RevealAttribution,
126+
RevealDrawer,
127+
RevealFullscreen,
128+
RevealPointer,
129+
]
130+
};
124131

125-
// options from URL query string
126-
var queryOptions = Reveal().getQueryHash() || {};
132+
// options from URL query string
133+
var queryOptions = Reveal().getQueryHash() || {};
127134

128-
var options = extend(defaultOptions, {{{revealOptionsStr}}}, queryOptions);
135+
var options = extend(defaultOptions, {{{revealOptionsStr}}}, queryOptions);
129136
</script>
130137

131138
{{#scriptPaths}}
132139
<script src="{{{.}}}"></script>
133140
{{/scriptPaths}}
134141

135142
<script>
136-
Reveal.initialize(options);
137-
Reveal.addEventListener("ready", function (event) {
138-
const blocks = Reveal.getRevealElement().querySelectorAll(
139-
"pre code:not(.mermaid)",
140-
);
141-
const hlp = Reveal.getPlugin("highlight");
142-
blocks.forEach(hlp.highlightBlock);
143-
});
143+
Reveal.initialize(options);
144+
Reveal.addEventListener("ready", function (event) {
145+
const blocks = Reveal.getRevealElement().querySelectorAll(
146+
"pre code:not(.mermaid)",
147+
);
148+
const hlp = Reveal.getPlugin("highlight");
149+
blocks.forEach(hlp.highlightBlock);
150+
});
144151
</script>
145152

146153
{{#mermaidOptionsStr}}
147154
<script>
148-
const mermaidOptions = extend({ startOnLoad: false }, {{{mermaidOptionsStr}}});
149-
mermaid.startOnLoad = false;
150-
mermaid.initialize(mermaidOptions);
151-
const cb = function (event) {
152-
mermaid.init(mermaidOptions, '.stack.present > .present pre code.mermaid');
153-
mermaid.init(mermaidOptions, '.slides > .present:not(.stack) pre code.mermaid');
154-
}
155-
Reveal.addEventListener('ready', cb);
156-
Reveal.addEventListener('slidetransitionend', cb);
155+
const mermaidOptions = extend({ startOnLoad: false }, {{{mermaidOptionsStr}}});
156+
mermaid.startOnLoad = false;
157+
mermaid.initialize(mermaidOptions);
158+
const cb = function (event) {
159+
mermaid.init(mermaidOptions, '.stack.present > .present pre code.mermaid');
160+
mermaid.init(mermaidOptions, '.slides > .present:not(.stack) pre code.mermaid');
161+
}
162+
Reveal.addEventListener('ready', cb);
163+
Reveal.addEventListener('slidetransitionend', cb);
157164
</script>
158165
{{/mermaidOptionsStr}}
159166
</body>

theme/my-site.html

+68-57
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,89 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
4-
<head>
3+
<head>
54
<meta charset="utf-8" />
65
<meta name="viewport" content="width=device-width, initial-scale=1" />
76
<meta name="author" content="Eirik Rolland Enger" />
87
<meta name="description" content="Reveal.js presentations." />
98
<title>{{pageTitle}}</title>
109
<link rel="stylesheet" href="{{{themeUrl}}}" id="theme" />
11-
<link rel="stylesheet"
12-
href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.3/gh-fork-ribbon.min.css" />
13-
</head>
10+
<link
11+
rel="stylesheet"
12+
href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.3/gh-fork-ribbon.min.css"
13+
/>
14+
</head>
1415

15-
<body>
16+
<body>
1617
<!-- Navigation bar -->
1718
<nav class="flexbox">
18-
<ul class="fullwidth">
19-
<li>
20-
<img src="https://github.com/engeir/eirikenger/raw/main/images/my-github-logo.jpg" style="width: 30px" ,
21-
class="logo" />
22-
</li>
23-
<li><a href="https://eirik.re/">Home</a></li>
24-
</ul>
19+
<ul class="fullwidth">
20+
<li>
21+
<img
22+
src="https://github.com/engeir/eirikenger/raw/main/images/my-github-logo.jpg"
23+
style="width: 30px"
24+
,
25+
class="logo"
26+
/>
27+
</li>
28+
<li><a href="https://eirik.re/">Home</a></li>
29+
</ul>
2530
</nav>
2631
<!-- GitHub fork me ribbon -->
27-
<a class="github-fork-ribbon right-bottom fixed" href="https://github.com/engeir/slides/fork"
28-
data-ribbon="Fork me on GitHub" title="Fork me on GitHub">Fork me on GitHub</a>
32+
<a
33+
class="github-fork-ribbon right-bottom fixed"
34+
href="https://github.com/engeir/slides/fork"
35+
data-ribbon="Fork me on GitHub"
36+
title="Fork me on GitHub"
37+
>Fork me on GitHub</a>
2938
<center>
30-
<h1>{{pageTitle}}</h1>
39+
<h1>{{pageTitle}}</h1>
3140
</center>
3241
<table class="center">
33-
<thead>
34-
<tr class="center">
35-
<th class="center">Event</th>
36-
<th class="center">Title</th>
37-
</tr>
38-
</thead>
39-
<tbody>
40-
{{#files}}
41-
{{^hidden}}
42-
<tr class="center">
43-
<td>
44-
<p>{{#event}}{{.}}{{/event}}</p>
45-
<p style="font-size: 12pt; color: #999">{{#date}}{{.}}{{/date}}{{#author}} — by {{.}}{{/author}}</p>
46-
</td>
47-
<td>
48-
<a href="{{filePath}}" title="{{title}}">
49-
{{#title}}{{.}}
50-
{{/title}}{{^title}}{{filePath}}{{/title}}
51-
</a>
52-
</td>
53-
</tr>
54-
{{/hidden}}
55-
{{/files}}
56-
</tbody>
42+
<thead>
43+
<tr class="center">
44+
<th class="center">Event</th>
45+
<th class="center">Title</th>
46+
</tr>
47+
</thead>
48+
<tbody>
49+
{{#files}} {{^hidden}}
50+
<tr class="center">
51+
<td>
52+
<p>{{#event}}{{.}}{{/event}}</p>
53+
<p style="font-size: 12pt; color: #999">
54+
{{#date}}{{.}}{{/date}}{{#author}} — by {{.}}{{/author}}
55+
</p>
56+
</td>
57+
<td>
58+
<a href="{{filePath}}" title="{{title}}">
59+
{{#title}}{{.}} {{/title}}{{^title}}{{filePath}}{{/title}}
60+
</a>
61+
</td>
62+
</tr>
63+
{{/hidden}} {{/files}}
64+
</tbody>
5765
</table>
5866
<myblockquote>
59-
Download the presentations as PDFs by adding <code>?print-pdf</code> to the end
60-
of a link: <br></br>
61-
<code>https://slides.eirik.re/2022-02-08-demo.html?print-pdf</code>
62-
<br></br><br></br>
67+
Download the presentations as PDFs by adding <code>?print-pdf</code> to
68+
the end of a link: <br>
69+
<code>https://slides.eirik.re/2022-02-08-demo.html?print-pdf</code>
70+
<br><br>
6371

64-
You may also include the speaker notes, both during a presentation and when
65-
printing, by adding <code>showNotes=separate-page</code> to the URL:
66-
<br></br>
67-
<code>https://slides.eirik.re/2022-02-08-demo.html?showNotes=separate-page&print-pdf</code> (PDF with
68-
notes on a separate page.)
69-
<br></br>
70-
<code>https://slides.eirik.re/2022-02-08-demo.html?showNotes=true&print-pdf</code> (PDF with notes
71-
overlaid on the presentation slide.)
72-
<br></br>
73-
<code>https://slides.eirik.re/2022-02-08-demo.html?showNotes=separate-page</code> (HTML view with notes on
74-
the side. Note that while presenting, pressing the "S" key is the better option.)
72+
You may also include the speaker notes, both during a presentation and
73+
when printing, by adding <code>showNotes=separate-page</code> to the URL:
74+
<br>
75+
<code
76+
>https://slides.eirik.re/2022-02-08-demo.html?showNotes=separate-page&print-pdf</code
77+
> (PDF with notes on a separate page.)
78+
<br>
79+
<code
80+
>https://slides.eirik.re/2022-02-08-demo.html?showNotes=true&print-pdf</code
81+
> (PDF with notes overlaid on the presentation slide.)
82+
<br>
83+
<code
84+
>https://slides.eirik.re/2022-02-08-demo.html?showNotes=separate-page</code
85+
> (HTML view with notes on the side. Note that while presenting, pressing
86+
the "S" key is the better option.)
7587
</myblockquote>
76-
</body>
77-
88+
</body>
7889
</html>

theme/template/site-template.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
{{#files}}
1212
<li>
1313
<a href="{{filePath}}" title="{{title}}">
14-
{{#title}}{{.}} ({{filePath}}){{/title}}{{^title}}{{filePath}}{{/title}}
14+
{{#title}}{{.}}
15+
({{filePath}}){{/title}}{{^title}}{{filePath}}{{/title}}
1516
</a>
1617
</li>
1718
{{/files}}

0 commit comments

Comments
 (0)