Skip to content

Commit 4cded73

Browse files
committed
chore(ci): upstream update
1 parent 9ae0eb8 commit 4cded73

28 files changed

+357221
-112
lines changed

index.html

Lines changed: 101 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,123 @@
11
<!doctype html>
22
<html lang="en">
3-
4-
<head>
5-
<meta charset="utf-8" />
6-
<meta name="apple-mobile-web-app-capable" content="yes" />
7-
<meta name="generator" content="slidesdown 0.19.0" />
8-
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
9-
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
10-
<title>Slidesdown</title>
11-
<link rel="stylesheet" href="/vendor/reveal.js/dist/reveal.css" />
12-
<link rel="stylesheet" href="/vendor/reveal.js-plugins/chalkboard/style.css" />
13-
<link rel="stylesheet" href="/vendor/reveal.js-plugins/customcontrols/style.css" />
14-
<link rel="stylesheet" href="/styles.css" />
15-
<script type="importmap">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="apple-mobile-web-app-capable" content="yes" />
6+
<meta name="generator" content="slidesdown 0.19.1" />
7+
<meta
8+
name="apple-mobile-web-app-status-bar-style"
9+
content="black-translucent"
10+
/>
11+
<meta
12+
name="viewport"
13+
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
14+
/>
15+
<title>Slidesdown</title>
16+
<link rel="stylesheet" href="/vendor/reveal.js/dist/reveal.css" />
17+
<link
18+
rel="stylesheet"
19+
href="/vendor/reveal.js-plugins/chalkboard/style.css"
20+
/>
21+
<link
22+
rel="stylesheet"
23+
href="/vendor/reveal.js-plugins/customcontrols/style.css"
24+
/>
25+
<link rel="stylesheet" href="/styles.css" />
26+
<script type="importmap">
1627
{
1728
"imports": {
29+
"@kurkle/color": "/vendor/kurkle/color.esm.js",
1830
"apexcharts": "/vendor/apexcharts/apexcharts.esm.js",
1931
"chartjs": "/vendor/chart.js/auto/auto.js",
2032
"dompurify": "/vendor/dompurify/purify.es.mjs",
33+
"echarts": "/vendor/echarts/echarts.esm.js",
34+
"github-slugger": "/vendor/github-slugger/index.js",
2135
"marked": "/vendor/marked/marked.esm.js",
2236
"marked-base-url": "/vendor/marked-base-url/index.js",
2337
"marked-gfm-heading-id": "/vendor/marked-gfm-heading-id/index.js",
24-
"github-slugger": "/vendor/github-slugger/index.js",
2538
"mermaid": "/vendor/mermaid/mermaid.esm.min.mjs",
26-
"slidesdown": "/plugin/slidesdown.js",
27-
"@kurkle/color": "/vendor/kurkle/color.esm.js",
28-
"revealjs": "/vendor/reveal.js/dist/reveal.esm.js",
39+
"reveal-apexchart": "/vendor/reveal.js-apexchart/plugin.js",
40+
"reveal-chalkboard": "/vendor/reveal.js-plugins/chalkboard/plugin.js",
41+
"reveal-chartjs": "/vendor/reveal.js-chartjs/plugin.js",
42+
"reveal-customcontrols": "/vendor/reveal.js-plugins/customcontrols/plugin.js",
43+
"reveal-echarts": "/vendor/reveal.js-echarts/plugin.js",
2944
"reveal-highlight": "/vendor/reveal.js/plugin/highlight/highlight.esm.js",
3045
"reveal-math": "/vendor/reveal.js/plugin/math/math.esm.js",
46+
"reveal-mermaid": "/vendor/reveal.js-mermaid/plugin.js",
3147
"reveal-notes": "/vendor/reveal.js/plugin/notes/notes.esm.js",
48+
"reveal-pdfexport": "/vendor/reveal-pdfexport/pdfexport.js",
3249
"reveal-search": "/vendor/reveal.js/plugin/search/search.esm.js",
3350
"reveal-zoom": "/vendor/reveal.js/plugin/zoom/zoom.esm.js",
34-
"reveal-pdfexport": "/vendor/reveal-pdfexport/pdfexport.js",
35-
"reveal-chalkboard": "/vendor/reveal.js-plugins/chalkboard/plugin.js",
36-
"reveal-customcontrols": "/vendor/reveal.js-plugins/customcontrols/plugin.js",
37-
"reveal-chartjs": "/vendor/reveal.js-chartjs/plugin.js",
38-
"reveal-apexchart": "/vendor/reveal.js-apexchart/plugin.js",
39-
"reveal-mermaid": "/vendor/reveal.js-mermaid/plugin.js"
51+
"revealjs": "/vendor/reveal.js/dist/reveal.esm.js",
52+
"slidesdown": "/plugin/slidesdown.js"
4053
}
4154
}
4255
</script>
43-
<script type="module" crossorigin src="/assets/index-DSdvHOuL.js"></script>
44-
</head>
45-
46-
<body>
47-
<div class="reveal">
48-
<div class="slides">
49-
<section data-load-metadata data-separator="^(#{1,2} |---$)" data-separator-vertical="^(#{3} |\|\|\|$)"
50-
data-separator-notes="^notes?:" id="markdown"></section>
51-
</div>
56+
<script type="module" crossorigin src="/assets/index-DSdvHOuL.js"></script>
57+
</head>
5258

53-
<!-- Layout components -->
54-
<header id="slide-header">
55-
<div id="slide-header-1"></div>
56-
<div id="slide-header-2"></div>
57-
<div id="slide-header-3"></div>
58-
</header>
59-
<footer id="slide-footer">
60-
<div id="slide-footer-1"></div>
61-
<div id="slide-footer-2"></div>
62-
<div id="slide-footer-3"></div>
63-
</footer>
64-
</div>
59+
<body>
60+
<div class="reveal">
61+
<div class="slides">
62+
<section
63+
data-load-metadata
64+
data-separator="^(#{1,2} |---$)"
65+
data-separator-vertical="^(#{3} |\|\|\|$)"
66+
data-separator-notes="^notes?:"
67+
id="markdown"
68+
></section>
69+
</div>
6570

66-
<script src="/vendor/reveal.js/dist/reveal.js"></script>
67-
<script src="/vendor/reveal-pdfexport/pdfexport.js"></script>
68-
<script src="/vendor/reveal.js-plugins/chalkboard/plugin.js"></script>
69-
<script src="/vendor/reveal.js-plugins/customcontrols/plugin.js"></script>
70-
<script type="module" src="/init.js"></script>
71-
<script src="/vendor/unocss/preset-attributify.global.js"></script>
72-
<script src="/vendor/unocss/preset-icons.global.js"></script>
73-
<script src="/vendor/unocss/preset-typography.global.js"></script>
74-
<script src="/vendor/unocss/preset-uno.global.js"></script>
75-
<script src="/vendor/unocss/preset-web-fonts.global.js"></script>
76-
<script>
77-
window.__unocss = {
78-
presets: [
79-
() => window.__unocss_runtime.presets.presetAttributify(),
80-
() =>
81-
window.__unocss_runtime.presets.presetIcons({
82-
scale: 1.2,
83-
cdn: "/vendor/",
84-
}),
85-
() => window.__unocss_runtime.presets.presetTypography(),
86-
() => window.__unocss_runtime.presets.presetUno(),
87-
() => window.__unocss_runtime.presets.presetWebFonts(),
88-
],
89-
};
90-
</script>
91-
<script src="/vendor/unocss/core.global.js"></script>
92-
<!-- <script -->
93-
<!-- async -->
94-
<!-- src="https://www.googletagmanager.com/gtag/js?id=G-5277P6Q3RP" -->
95-
<!-- ></script> -->
96-
<!-- <script> -->
97-
<!-- window.dataLayer = window.dataLayer || [] -->
98-
<!-- function gtag() { -->
99-
<!-- dataLayer.push(arguments) -->
100-
<!-- } -->
101-
<!-- gtag("js", new Date()) -->
102-
<!-- gtag("config", "G-5277P6Q3RP") -->
103-
<!-- </script> -->
104-
</body>
71+
<!-- Layout components -->
72+
<header id="slide-header">
73+
<div id="slide-header-1"></div>
74+
<div id="slide-header-2"></div>
75+
<div id="slide-header-3"></div>
76+
</header>
77+
<footer id="slide-footer">
78+
<div id="slide-footer-1"></div>
79+
<div id="slide-footer-2"></div>
80+
<div id="slide-footer-3"></div>
81+
</footer>
82+
</div>
10583

106-
</html>
84+
<script src="/vendor/reveal.js/dist/reveal.js"></script>
85+
<script src="/vendor/reveal-pdfexport/pdfexport.js"></script>
86+
<script src="/vendor/reveal.js-plugins/chalkboard/plugin.js"></script>
87+
<script src="/vendor/reveal.js-plugins/customcontrols/plugin.js"></script>
88+
<script type="module" src="/init.js"></script>
89+
<script src="/vendor/unocss/preset-attributify.global.js"></script>
90+
<script src="/vendor/unocss/preset-icons.global.js"></script>
91+
<script src="/vendor/unocss/preset-typography.global.js"></script>
92+
<script src="/vendor/unocss/preset-uno.global.js"></script>
93+
<script src="/vendor/unocss/preset-web-fonts.global.js"></script>
94+
<script>
95+
window.__unocss = {
96+
presets: [
97+
() => window.__unocss_runtime.presets.presetAttributify(),
98+
() =>
99+
window.__unocss_runtime.presets.presetIcons({
100+
scale: 1.2,
101+
cdn: "/vendor/",
102+
}),
103+
() => window.__unocss_runtime.presets.presetTypography(),
104+
() => window.__unocss_runtime.presets.presetUno(),
105+
() => window.__unocss_runtime.presets.presetWebFonts(),
106+
],
107+
};
108+
</script>
109+
<script src="/vendor/unocss/core.global.js"></script>
110+
<!-- <script -->
111+
<!-- async -->
112+
<!-- src="https://www.googletagmanager.com/gtag/js?id=G-5277P6Q3RP" -->
113+
<!-- ></script> -->
114+
<!-- <script> -->
115+
<!-- window.dataLayer = window.dataLayer || [] -->
116+
<!-- function gtag() { -->
117+
<!-- dataLayer.push(arguments) -->
118+
<!-- } -->
119+
<!-- gtag("js", new Date()) -->
120+
<!-- gtag("config", "G-5277P6Q3RP") -->
121+
<!-- </script> -->
122+
</body>
123+
</html>

init.js

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import RevealNotes from "reveal-notes";
77
import RevealSearch from "reveal-search";
88
import RevealZoom from "reveal-zoom";
99
import RevealApexchart from "reveal-apexchart";
10+
import RevealECharts from "reveal-echarts";
1011
import RevealMermaid from "reveal-mermaid";
1112
import RevealChartjs from "reveal-chartjs";
1213
// INFO: non-esm therefore they can't be properly imported:
@@ -47,35 +48,44 @@ function computeURL(defaults, url) {
4748
`${match.groups.dir_or_branch}/${match.groups.resource}/${defaults.resource}`;
4849
} else if (match.groups.blob && match.groups.dir_or_branch) {
4950
// if tree or blob are not present, then dir_or_branch must be a dir but the branch name can't be determined
50-
resource = `${match.groups.dir_or_branch}/${match.groups.resource ? match.groups.resource : defaults.resource
51-
}`;
51+
resource = `${match.groups.dir_or_branch}/${
52+
match.groups.resource ? match.groups.resource : defaults.resource
53+
}`;
5254
} else {
5355
if (match.groups.dir_or_branch) {
54-
resource = `${defaults.branch}/${match.groups.dir_or_branch}/${match.groups.resource ? match.groups.resource : defaults.resource
55-
}`;
56+
resource = `${defaults.branch}/${match.groups.dir_or_branch}/${
57+
match.groups.resource ? match.groups.resource : defaults.resource
58+
}`;
5659
} else {
57-
resource = `${defaults.branch}/${match.groups.resource ? match.groups.resource : defaults.resource
58-
}`;
60+
resource = `${defaults.branch}/${
61+
match.groups.resource ? match.groups.resource : defaults.resource
62+
}`;
5963
}
6064
}
6165
return `https://raw.githubusercontent.com/${match.groups.owner}/${match.groups.repo}/${resource}`;
6266
} else if ((match = gistRegExp.exec(decodedURL)) !== null) {
6367
return `https://gist.githubusercontent.com/${match.groups.owner}/${match.groups.repo}/raw/SLIDES.md`;
6468
}
6569
return decodedURL;
66-
};
70+
}
6771

6872
async function main(defaults) {
6973
if (!(defaults.branch && defaults.resource && defaults.markdownElementId)) {
70-
console.error("Default branch, resource and/or markdownElementId are not set");
74+
console.error(
75+
"Default branch, resource and/or markdownElementId are not set",
76+
);
7177
return;
7278
}
7379
const mdSection = document.getElementById(defaults.markdownElementId);
7480
if (!mdSection) {
75-
console.error(`Couldn't find markdown element with id: ${defaults.markdownElementId}`);
81+
console.error(
82+
`Couldn't find markdown element with id: ${defaults.markdownElementId}`,
83+
);
7684
return;
7785
}
78-
const customSlidesBase64Gzip = new URLSearchParams(new URL(document.URL).search).get("slides64");
86+
const customSlidesBase64Gzip = new URLSearchParams(
87+
new URL(document.URL).search,
88+
).get("slides64");
7989
if (customSlidesBase64Gzip) {
8090
async function decompressBlob(blob) {
8191
const decompressedStream = blob.pipeThrough(
@@ -103,7 +113,8 @@ async function main(defaults) {
103113
mdSection.setAttribute("data-markdown", "<<load-plain-markdown>>");
104114
mdSection.setAttribute("data-markdown-plain", text);
105115
} else {
106-
const customSlidesURL = new URLSearchParams(new URL(document.URL).search).get("slides");
116+
const customSlidesURL = new URLSearchParams(new URL(document.URL).search)
117+
.get("slides");
107118
let slidesURL = customSlidesURL
108119
? customSlidesURL
109120
: `github.com/slidesdown/slidesdown/blob/${defaults.branch}/${defaults.resource}`;
@@ -116,7 +127,9 @@ async function main(defaults) {
116127
}
117128
mdSection.setAttribute("data-markdown", slidesURL);
118129
}
119-
const multiplexBase64 = new URLSearchParams(new URL(document.URL).search).get("multiplex64");
130+
const multiplexBase64 = new URLSearchParams(new URL(document.URL).search).get(
131+
"multiplex64",
132+
);
120133
let multiplex = {};
121134
let dependencies = [];
122135
if (multiplexBase64) {
@@ -128,22 +141,25 @@ async function main(defaults) {
128141
multiplex = {
129142
secret: multiplex?.secret || null,
130143
id: multiplex?.id || null,
131-
url: "/"
144+
url: "/",
132145
// url: "https://reveal-multiplex.glitch.me"
133146
};
134147
const minium_secret_length = 20;
135-
if (typeof multiplex.id != "string" && multiplex.id.length < minium_secret_length) {
136-
multiplex = {}
148+
if (
149+
typeof multiplex.id != "string" &&
150+
multiplex.id.length < minium_secret_length
151+
) {
152+
multiplex = {};
137153
}
138154
if (multiplex?.id) {
139-
dependencies.push({ src: '/socket.io/socket.io.js', async: true })
155+
dependencies.push({ src: "/socket.io/socket.io.js", async: true });
140156
// dependencies.push({ src: 'https://reveal-multiplex.glitch.me/socket.io/socket.io.js', async: true })
141157
}
142158
if (multiplex?.secret) {
143-
dependencies.push({ src: '/vendor/multiplex/master.js', async: true })
159+
dependencies.push({ src: "/vendor/multiplex/master.js", async: true });
144160
// dependencies.push({ src: 'https://reveal-multiplex.glitch.me/master.js', async: true })
145161
} else {
146-
dependencies.push({ src: '/vendor/multiplex/client.js', async: true })
162+
dependencies.push({ src: "/vendor/multiplex/client.js", async: true });
147163
// dependencies.push({ src: 'https://reveal-multiplex.glitch.me/client.js', async: true })
148164
}
149165
}
@@ -178,6 +194,7 @@ async function main(defaults) {
178194
// RevealAnything,
179195
RevealChartjs,
180196
RevealApexchart,
197+
RevealECharts,
181198
RevealMermaid,
182199
],
183200
customcontrols: {
@@ -215,7 +232,7 @@ async function main(defaults) {
215232
}).then(() => {
216233
console.debug("initialization finished");
217234
});
218-
};
235+
}
219236

220237
main({
221238
branch: "main",

plugin/slidesdown.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,17 @@ function codeHandler(code, language) {
294294
}"></div>`;
295295
} else if (language === "chartjs") {
296296
// INFO: maybe set height and width are to work around bug https://github.com/chartjs/Chart.js/issues/5805
297-
return `<div><div style="display: flex; align-items: center; justify-content: center; position: relative; width: 100%; height: 100%;"><canvas data-chartjs=${
297+
return `<div><canvas style="width: clamp(200px, 100%, 100vw); height: clamp(200px, 100%, 100vh);" data-chartjs=${
298298
btoa(code)
299-
}></canvas></div></div>`;
300-
} else if (
301-
language === "apexchart"
302-
) {
303-
// INFO: height and width are set to work around bug https://github.com/chartjs/Chart.js/issues/5805
304-
return `<div data-apexchart=${btoa(code)}></div>`;
299+
}></canvas></div>`;
300+
} else if (language === "apexchart") {
301+
return `<div style="width: clamp(200px, 100%, 100vw); height: clamp(200px, 100%, 100vh);" data-apexchart=${
302+
btoa(code)
303+
}></div>`;
304+
} else if (language === "echarts") {
305+
return `<div><div style="width: 100px; height: 100px; width: clamp(100px, 100%, 100vw); height: clamp(100px, 100%, 100vh);" data-echarts=${
306+
btoa(code)
307+
}></div></div>`;
305308
} else {
306309
return SANITIZE(defaultCodeHandler(code, language));
307310
}

0 commit comments

Comments
 (0)