feat: allow to hide slides like in Powerpoint

use `<!-- hide -->` in the slide contents.
This commit is contained in:
George Cushen committed 2025-12-14 23:55:50 +00:00
1 parent 972a946bde
commit d15979197a
2 files changed
+26 -2

No files matched your search

@@ -13,12 +13,22 @@
{{/* Let `---` delimit slides. In Goldmark, that is `<hr>`. Alternatively, for Blackfriday, use `<hr />`. */}}
{{ range (split $content "<hr>") }}
{{/* Check if this slide should be hidden using inline comment */}}
{{ $isHidden := false }}
{{ $slideContent := . }}
{{ if in . "<!-- hide -->" }}
{{ $isHidden = true }}
{{/* Remove the hide comment from the content */}}
{{ $slideContent = replace . "<!-- hide -->" "" }}
{{ end }}
{{/* Each `<section>` defines a new slide. */}}
{{/* Only begin new slide `<section>` if not already added by custom `slide` shortcode. */}}
{{ if not (in . "data-noprocess") }}
<section>
<section{{ if $isHidden }} data-visibility="hidden"{{ end }}>
{{ end }}
{{ . | safeHTML }}
{{ $slideContent | safeHTML }}
</section>
{{ end }}
@@ -289,6 +289,20 @@ Try these keyboard shortcuts:
- `/` : Search
- `ESC` : Exit modes
---
<!-- hide -->
## Hidden Slide Demo (Inline Comment)
This slide is hidden using the `<!-- hide -->` comment method.
Perfect for:
- Speaker-only content
- Backup slides
- Work-in-progress content
Note:
This slide won't appear in the presentation but remains in source for reference.
---
## Thanks