Skip to content

Commit 84105be

Browse files
authored
Merge pull request #435 from iamgio/chore/reveal-6
chore(deps): upgrade to Reveal 6
2 parents 8a5de7e + 9c9a40e commit 84105be

File tree

14 files changed

+978
-1161
lines changed

14 files changed

+978
-1161
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ Text alignment in `plain` documents switches from justified to start-aligned on
2020

2121
Captions for figures and tables in `plain` and `docs` documents now use a smaller font size on small screens.
2222

23+
#### Upgraded to Reveal.js 6
24+
25+
Upgraded Reveal.js, the library powering `slides` documents, to v6.0.0.
26+
No breaking changes are expected in the rendered output.
27+
2328
### Fixed
2429

2530
#### Split paragraphs in `paged` documents now justify the last line correctly

quarkdown-html/package-lock.json

Lines changed: 797 additions & 1149 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

quarkdown-html/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,17 @@
1313
"test:e2e:ui": "playwright test --ui"
1414
},
1515
"devDependencies": {
16-
"esbuild": "^0.25.10",
17-
"reveal.js": "^5.2.1",
18-
"@types/reveal.js": "^5.2.1",
16+
"esbuild": "^0.27.4",
17+
"reveal.js": "^6.0.0",
1918
"pagedjs": "^0.4.3",
2019
"katex": "^0.16.23",
2120
"@types/katex": "^0.16.3",
2221
"highlight.js": "^11.11.1",
2322
"mermaid": "^11.12.0",
2423
"minisearch": "^7.2.0",
25-
"vitest": "^3.2.4",
24+
"vitest": "^4.1.2",
2625
"happy-dom": "^20.0.2",
27-
"@types/node": "^24.7.2",
26+
"@types/node": "^25.5.0",
2827
"@playwright/test": "^1.57.0",
2928
"romans": "^3.1.0"
3029
}

quarkdown-html/src/main/kotlin/com/quarkdown/rendering/html/post/document/HtmlDocumentBuilder.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ class HtmlDocumentBuilder(
139139
/** Loads Reveal.js scripts and styles for slide documents. No-op for other document types. */
140140
private fun HEAD.slidesScripts() {
141141
if (document.type != DocumentType.SLIDES) return
142-
script(src = "https://cdnjs.cloudflare.com/ajax/libs/reveal.js/5.2.1/reveal.js") {}
143-
script(src = "https://cdnjs.cloudflare.com/ajax/libs/reveal.js/5.2.1/plugin/notes/notes.js") {}
144-
link(rel = "stylesheet", href = "https://cdnjs.cloudflare.com/ajax/libs/reveal.js/5.2.1/reset.css")
145-
link(rel = "stylesheet", href = "https://cdnjs.cloudflare.com/ajax/libs/reveal.js/5.2.1/reveal.css")
146-
link(rel = "stylesheet", href = "https://cdnjs.cloudflare.com/ajax/libs/reveal.js/5.2.1/theme/white.css")
142+
script(src = "https://cdn.jsdelivr.net/npm/reveal.js@6.0.0/dist/reveal.js") {}
143+
script(src = "https://cdn.jsdelivr.net/npm/reveal.js@6.0.0/dist/plugin/notes.js") {}
144+
link(rel = "stylesheet", href = "https://cdn.jsdelivr.net/npm/reveal.js@6.0.0/dist/reset.css")
145+
link(rel = "stylesheet", href = "https://cdn.jsdelivr.net/npm/reveal.js@6.0.0/dist/reveal.css")
146+
link(rel = "stylesheet", href = "https://cdn.jsdelivr.net/npm/reveal.js@6.0.0/dist/theme/white.css")
147147
}
148148

149149
private fun HEAD.iconLibrary() {

quarkdown-html/src/main/typescript/document/type/slides-document.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import {PageNumbers} from "../handlers/page-numbers";
77
import {PagedLikeQuarkdownDocument, QuarkdownPage} from "../paged-like-quarkdown-document";
88
import {PersistentHeadings} from "../handlers/persistent-headings";
99

10-
declare const Reveal: typeof import("reveal.js"); // global Reveal at runtime
11-
declare const RevealNotes: typeof import("reveal.js/plugin/notes/notes");
10+
type RevealType = typeof import("reveal.js").default;
11+
declare const Reveal: RevealType;
12+
declare const RevealNotes: typeof import("reveal.js/dist/plugin/notes").default;
1213

1314
const SLIDE_SELECTOR = ".reveal .slides > :is(section, .pdf-page)";
1415
const BACKGROUND_SELECTOR = ".reveal :is(.backgrounds, .slides > .pdf-page) > .slide-background";
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Slide 1
2+
3+
.speakernote
4+
hello
5+
6+
# Slide 2
7+
8+
.speakernote
9+
**Formatted** speaker note
10+
11+
- Bullet 1
12+
- Bullet 2
13+
- Bullet 3
14+
15+
# Slide 3
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import {suite} from "../../../quarkdown";
2+
3+
const {testMatrix, expect} = suite(__dirname);
4+
5+
testMatrix(
6+
"speaker notes are accessible in the speaker view",
7+
["slides"],
8+
async (page) => {
9+
// Inline .speaker-notes should be empty when showNotes is not enabled
10+
const speakerNotes = page.locator(".speaker-notes");
11+
await expect(speakerNotes).toBeEmpty();
12+
13+
// Open speaker view by pressing S
14+
const popupPromise = page.context().waitForEvent("page");
15+
await page.keyboard.press("s");
16+
const speakerPage = await popupPromise;
17+
await speakerPage.waitForLoadState("domcontentloaded");
18+
19+
const notesContainer = speakerPage.locator(".speaker-controls-notes");
20+
await expect(notesContainer).toBeVisible({timeout: 10000});
21+
22+
// The speaker view shows the current slide's notes
23+
await expect(notesContainer).toContainText("hello");
24+
}
25+
);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.slides speakernotes:{yes}
2+
3+
# Slide 1
4+
5+
.speakernote
6+
hello
7+
8+
# Slide 2
9+
10+
.speakernote
11+
**Formatted** speaker note
12+
13+
- Bullet 1
14+
- Bullet 2
15+
- Bullet 3
16+
17+
# Slide 3
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import {Locator} from "@playwright/test";
2+
import {suite} from "../../../quarkdown";
3+
4+
const {testMatrix, expect} = suite(__dirname);
5+
6+
async function assertNoteContent(note: Locator) {
7+
await expect(note).toContainText("Formatted");
8+
const bullets = note.locator("li");
9+
await expect(bullets).toHaveCount(3);
10+
await expect(bullets.nth(0)).toHaveText("Bullet 1");
11+
await expect(bullets.nth(1)).toHaveText("Bullet 2");
12+
await expect(bullets.nth(2)).toHaveText("Bullet 3");
13+
}
14+
15+
testMatrix(
16+
"speaker notes are visible on each slide",
17+
["slides", "slides-print"],
18+
async (page, docType) => {
19+
const notes = page.locator(".speaker-notes");
20+
21+
if (docType === "slides-print") {
22+
// In print mode, each slide has its own .speaker-notes element
23+
await expect(notes).toHaveCount(3);
24+
25+
await expect(notes.nth(0)).toContainText("hello");
26+
await assertNoteContent(notes.nth(1));
27+
28+
// Slide 3 has no speaker note
29+
await expect(notes.nth(2)).toBeEmpty();
30+
} else {
31+
// In regular slides mode, .speaker-notes shows the current slide's note
32+
await expect(notes).toContainText("hello");
33+
34+
await page.keyboard.press("ArrowRight");
35+
await assertNoteContent(notes);
36+
37+
// Slide 3 has no speaker note
38+
await page.keyboard.press("ArrowRight");
39+
await expect(notes).toContainText("No notes on this slide.");
40+
}
41+
}
42+
);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import {suite} from "../../../quarkdown";
2+
import {getTransitionConfig} from "../transition-config";
3+
4+
const {testMatrix, expect} = suite(__dirname);
5+
6+
testMatrix(
7+
"applies custom transition configuration",
8+
["slides"],
9+
async (page) => {
10+
const config = await getTransitionConfig(page);
11+
expect(config.transition).toBe("fade");
12+
expect(config.transitionSpeed).toBe("fast");
13+
14+
// Navigate and verify the slide changes with custom transition
15+
await expect(page.locator(".reveal .slides > section.present h1")).toHaveText("Slide 1");
16+
await page.keyboard.press("ArrowRight");
17+
await expect(page.locator(".reveal .slides > section.present h1")).toHaveText("Slide 2");
18+
}
19+
);

0 commit comments

Comments
 (0)