decklight 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -21
- package/README.md +61 -177
- package/SPEC.md +20 -8
- package/cli/agents.mjs +102 -0
- package/cli/bundle.mjs +37 -0
- package/cli/decklight.mjs +18 -0
- package/cli/dev.mjs +266 -0
- package/cli/edit.mjs +230 -17
- package/cli/init.mjs +58 -19
- package/cli/rec.mjs +7 -0
- package/dist/decklight.css +241 -51
- package/dist/decklight.js +120 -76
- package/dist/decklight.js.map +4 -4
- package/package.json +6 -4
- package/themes/aliens.css +3 -0
- package/themes/apple2.css +3 -0
- package/themes/aurora.css +3 -0
- package/themes/berry.css +3 -0
- package/themes/blade-runner.css +3 -0
- package/themes/c64.css +3 -0
- package/themes/carbon.css +3 -0
- package/themes/citrus.css +3 -0
- package/themes/coastal.css +3 -0
- package/themes/cosmos.css +3 -0
- package/themes/dune.css +3 -0
- package/themes/eclipse.css +3 -0
- package/themes/ember.css +3 -0
- package/themes/fjord.css +3 -0
- package/themes/friends.css +3 -0
- package/themes/gameboy.css +3 -0
- package/themes/genesis.css +3 -0
- package/themes/glacier.css +3 -0
- package/themes/godfather.css +3 -0
- package/themes/graphite.css +3 -0
- package/themes/harvest.css +3 -0
- package/themes/ibm-modern.css +3 -0
- package/themes/ibm-oldschool.css +3 -0
- package/themes/ink.css +3 -0
- package/themes/latte.css +3 -0
- package/themes/linen.css +3 -0
- package/themes/meadow.css +3 -0
- package/themes/metropolis.css +3 -0
- package/themes/miami-vice.css +3 -0
- package/themes/midnight.css +3 -0
- package/themes/mint.css +3 -0
- package/themes/moss.css +3 -0
- package/themes/obsidian.css +3 -0
- package/themes/orchid.css +3 -0
- package/themes/packs.json +2 -1
- package/themes/paper.css +3 -0
- package/themes/peony.css +3 -0
- package/themes/porcelain.css +3 -0
- package/themes/pulp-fiction.css +3 -0
- package/themes/reveal-beige.css +3 -0
- package/themes/reveal-black.css +3 -0
- package/themes/reveal-blood.css +3 -0
- package/themes/reveal-dracula.css +3 -0
- package/themes/reveal-league.css +3 -0
- package/themes/reveal-moon.css +3 -0
- package/themes/reveal-night.css +3 -0
- package/themes/reveal-serif.css +3 -0
- package/themes/reveal-simple.css +3 -0
- package/themes/reveal-sky.css +3 -0
- package/themes/reveal-solarized.css +3 -0
- package/themes/reveal-white.css +3 -0
- package/themes/sepia.css +3 -0
- package/themes/seriph.css +3 -0
- package/themes/severance.css +3 -0
- package/themes/slate.css +3 -0
- package/themes/snes.css +3 -0
- package/themes/star-wars.css +3 -0
- package/themes/storm.css +3 -0
- package/themes/stranger-things.css +3 -0
- package/themes/synthwave.css +3 -0
- package/themes/terminator.css +3 -0
- package/themes/velvet.css +3 -0
- package/themes/yamabuki.css +120 -0
- package/tools/chrome.mjs +43 -0
- package/tools/gemini-tts.mjs +19 -1
- package/tools/lipsync-server.mjs +249 -0
- package/tools/lipsync.mjs +166 -0
- package/tools/publish-site-voices.mjs +3 -0
- package/tools/shot.mjs +85 -0
- package/tools/tts-engines.mjs +226 -0
- package/tools/visemes.mjs +26 -0
- package/tools/voiceover-server.mjs +0 -0
- package/tools/voiceover.mjs +51 -34
package/LICENSE
CHANGED
|
@@ -1,21 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -4,11 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
# Decklight
|
|
6
6
|
|
|
7
|
-
**The presentation library that
|
|
7
|
+
**The presentation library that presents itself.**
|
|
8
8
|
|
|
9
|
-
Decklight is a presentation library in the Reveal.js tradition, designed to be **authored by AI agents and humans alike
|
|
9
|
+
A deck is a single HTML file — no build, no server, no framework. Decklight is a presentation library in the Reveal.js tradition, designed to be **authored by AI agents and humans alike**: describe a slide in plain English and your agent writes it, then — because agents can't eyeball a slide — every feature is **verifiable by a headless render** (clipped content flags itself, every theme passes machine-checked contrast gates, terminal demos are recorded truth, not screenshots).
|
|
10
10
|
|
|
11
|
-
`SPEC.md` is the contract
|
|
11
|
+
> `SPEC.md` is the full contract and `demo/showcase.html` is the exhaustive self-demo. **This README is the quick tour.** For the two-minute version, open **`demo/intro.html`** — a short deck that explains what Decklight is, each slide live-demoing the feature it describes. See it all live at **[decklight.io](https://decklight.io)**.
|
|
12
|
+
|
|
13
|
+
## Why Decklight
|
|
14
|
+
|
|
15
|
+
- **Agent-native** — describe a slide to your favorite agent; `init` hands it a skill with the real contract, and overflow flags + contrast gates + headless-render assertions let it verify its own work without eyes.
|
|
16
|
+
- **One file, zero build** — author a single HTML file, double-click it, present.
|
|
17
|
+
- **Diagrams & graphics** — native, theme-aware inline SVG, not just bullet lists.
|
|
18
|
+
- **Animation** — progressive builds, Magic Move between slides, and diagrams that draw themselves in.
|
|
19
|
+
- **61 built-in themes** — every one passes WCAG contrast gates and codified palette rules; generate your own with a keystroke.
|
|
20
|
+
- **Truthful terminals** — real PTY recordings replayed truthfully, never a video.
|
|
21
|
+
- **Live narration** — text-to-speech presents the deck by itself, in sync, captions included.
|
|
22
|
+
- **Everything is text** — no binary formats, so decks diff cleanly in git and agents can read, review, and edit every byte.
|
|
12
23
|
|
|
13
24
|
## Quick start
|
|
14
25
|
|
|
@@ -16,7 +27,7 @@ Decklight is a presentation library in the Reveal.js tradition, designed to be *
|
|
|
16
27
|
npx decklight init "My Deck"
|
|
17
28
|
```
|
|
18
29
|
|
|
19
|
-
Scaffolds a self-contained `deck.html` (double-click it
|
|
30
|
+
Scaffolds a self-contained `deck.html` (double-click it — no server) **and** a `.claude/skills/decklight/` skill + `AGENTS.md`, so Claude Code (or anything reading `AGENTS.md`) has the full authoring contract on hand instead of guessing from Reveal.js memory. The skill is sliced from `SPEC.md`, so it never drifts from the installed runtime.
|
|
20
31
|
|
|
21
32
|
Or hand-author the anatomy directly:
|
|
22
33
|
|
|
@@ -46,199 +57,64 @@ Or hand-author the anatomy directly:
|
|
|
46
57
|
</html>
|
|
47
58
|
```
|
|
48
59
|
|
|
49
|
-
Open
|
|
50
|
-
|
|
51
|
-
## Authoring
|
|
52
|
-
|
|
53
|
-
- **HTML is the default**, markdown is opt-in per slide: `data-markdown` on the section, content in `<script type="text/template">`. CommonMark via bundled `marked`; `Note:` starts speaker notes; `::: build … :::` wraps content in a build container.
|
|
54
|
-
- **Speaker notes**: `<aside class="notes">` (HTML) or `Note:` (markdown). `⟨CLICK⟩` markers segment the notes; the speaker view highlights the segment matching the current build step.
|
|
55
|
-
- **Rehearse notes**: an optional `<aside class="rehearse">` (or `Rehearse:` in markdown) carries a cue-card variant of the notes — a few words per segment, same `⟨CLICK⟩` segmentation — for the speaker view's rehearse mode.
|
|
56
|
-
- **Subtitles**: the `<p>` immediately after a slide's leading `h1`/`h2` is auto-styled as the subtitle — one canonical look whether the slide is HTML- or markdown-authored. Opt out with `data-subtitle="none"`.
|
|
57
|
-
- **Overflow guardrail**: content that would clip gets a `console.warn` and a `data-overflow` attribute on the section — headless verification can assert `[data-overflow]` is absent.
|
|
58
|
-
|
|
59
|
-
## Builds (Keynote-style progressive reveals)
|
|
60
|
-
|
|
61
|
-
The container opts in; the engine does the rest — one attribute on the container, zero classes on the items.
|
|
62
|
-
|
|
63
|
-
| Syntax | Meaning |
|
|
64
|
-
|---|---|
|
|
65
|
-
| `data-build` on a container (`ul`, `ol`, `table`, `svg`, `g`, `div.columns`) | each direct child becomes one step, in DOM order |
|
|
66
|
-
| `data-build` on a leaf (`p`, `img`, `pre`, `blockquote`) | the element itself is one step |
|
|
67
|
-
| `data-build="fade-up"` | entrance style: `fade` (default) · `fade-up` · `fade-down` · `zoom` · `pop` · `draw` · `highlight` · `none` |
|
|
68
|
-
| `data-build-order="3"` | explicit step index within the slide |
|
|
69
|
-
| `data-build-stay` | child of a build container that stays static |
|
|
70
|
-
|
|
71
|
-
Hidden steps use `visibility: hidden`, so layout never shifts. `#/<slide>/<step>` deep-links any build state. Complex widgets (code stepping, the terminal player) register **build providers** — `Decklight.registerBuildProvider(el, { count, apply(i), label(i) })` — and interleave their steps into the slide's sequence.
|
|
72
|
-
|
|
73
|
-
## SVG diagrams
|
|
74
|
-
|
|
75
|
-
Inline SVG is the canonical diagram format, and it's first-class:
|
|
76
|
-
|
|
77
|
-
- **Theme-aware**: author with `var(--d-stroke)`, `var(--d-text)`, `var(--d-muted)`, `var(--d-accent)`, `var(--d-fill-1)`…`var(--d-fill-6)` and the diagram recolors across all themes — including generated ones.
|
|
78
|
-
- **Progressive**: `data-build` on the `<svg>` or a `<g>` steps its direct children; `data-build="draw"` animates strokes via dash-offset (authored dasharrays are restored afterwards).
|
|
79
|
-
- **Collision-proof**: the engine namespaces every `id` inside each inline SVG at init, rewriting `url(#…)` and `href="#…"` — the defs-collision bug class is eliminated.
|
|
80
|
-
- **Concept colors**: `data-concept="agent"` pins a recurring concept to one fill slot deck-wide — the Agent box is the same color on every slide, in every theme. Pin slots explicitly with `Decklight.init({ concepts: { agent: 3, kafka: 1 } })` (or any CSS color); untagged names get a stable hash fallback, and slot collisions warn in the console.
|
|
81
|
-
|
|
82
|
-
## Motion
|
|
83
|
-
|
|
84
|
-
- **Slide transitions**: `none | fade | slide | scale | flip`, deck-level config with per-slide `data-transition` override.
|
|
85
|
-
- **Auto-animate** (Magic Move): `data-auto-animate` on adjacent sections; elements sharing `data-id` FLIP-morph position, size, opacity, color, radius and font-size — HTML and inline-SVG elements alike.
|
|
86
|
-
- **Element animations**: `data-animate="pulse | float | shake | spin | blink | bounce | swing | glow | breathe"` — looping attention effects that only run while the slide is active.
|
|
87
|
-
- All motion collapses under `prefers-reduced-motion`.
|
|
88
|
-
|
|
89
|
-
## Code
|
|
90
|
-
|
|
91
|
-
- Syntax highlighting via bundled highlight.js (13 languages), themed entirely through the `--hl-*` tokens — no separate highlighter theme files.
|
|
92
|
-
- **Line stepping**: `data-lines="1|3-5|all"` on the `<pre>` steps highlight ranges as builds; non-highlighted lines dim to `--dim-opacity`. `data-lines-numbers` adds line numbers.
|
|
93
|
-
|
|
94
|
-
## Terminal recordings
|
|
95
|
-
|
|
96
|
-
Event-based, asciinema-style — never video. You script it, `decklight rec` runs it in a real PTY and captures truthful output:
|
|
97
|
-
|
|
98
|
-
```yaml
|
|
99
|
-
prompt: "$ "
|
|
100
|
-
redact: ["sk-[A-Za-z0-9-_]+"]
|
|
101
|
-
steps:
|
|
102
|
-
- cmd: export STAGE=demo
|
|
103
|
-
hide: true # runs, but omitted from playback
|
|
104
|
-
- cmd: git status
|
|
105
|
-
- cmd: myapp login
|
|
106
|
-
wait_for: "Logged in"
|
|
107
|
-
interact:
|
|
108
|
-
- expect: "Email: "
|
|
109
|
-
send: "demo@example.com\n"
|
|
110
|
-
- expect: "Password: "
|
|
111
|
-
send: { secret: "$APP_PASSWORD\n" } # sent for real; recorded as ▓▓▓
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
- **Playback**: `<div class="terminal" data-cast="demo.cast.json" data-mode="step">` — each advance *types* the command (jittered keystrokes) then streams the recorded output; `data-mode="play"` gives timeline playback with speed control. Typing speed is authored with `data-type-speed` (a 1-slow to 10-fast scale) and changed live by the `⌨` titlebar button, a words-per-minute picker (persists per deck). Each keystroke lands with a subtle synthesized switch sound: pick your board with `data-type-sound="creamy|thocky|clacky|off"` (default creamy) or the `♪` titlebar button, which cycles the voices live (also persists per deck). ANSI colors render through an owned parser (16 named colors map to theme tokens; 256/truecolor pass through). `data-cast-inline="#id"` embeds the cast for `file://`. Terminals keep a stable 16:9-floored footprint and scroll internally.
|
|
115
|
-
- **Refreshable**: casts embed their own script — `decklight refresh` re-records everything and reports drift when your tools change.
|
|
116
|
-
- **Interop**: `decklight export` flattens to asciicast v2 (`agg` GIFs, asciinema.org); plain asciicast v2 files can be played directly, with `m` markers becoming steps.
|
|
117
|
-
- **Secrets**: redaction regexes, `hide:` steps, and `secret:` sends that are typed for real but stored as `▓▓▓`.
|
|
60
|
+
Open it in a browser — `file://` works for everything, no server needed.
|
|
118
61
|
|
|
119
|
-
##
|
|
62
|
+
## How authoring works
|
|
120
63
|
|
|
121
|
-
|
|
64
|
+
The whole loop is agent-friendly, one file end to end:
|
|
122
65
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
66
|
+
1. **`decklight init`** — scaffold a starter deck plus the agent skill above.
|
|
67
|
+
2. **Author** one HTML file: `<section>` slides, `data-build` reveals, inline SVG with theme tokens, `<aside class="notes">` split on `⟨CLICK⟩` (notes drive builds, captions, transcript **and** narration at once).
|
|
68
|
+
3. **`decklight dev deck.html`** — the whole live loop under one Ctrl-C: live-reload editing (from your editor or the browser), plus any narration/lip-sync bridges this machine can run (missing prerequisites are skipped with the fix, never a hard failure). In the browser: **`E`** edits notes back into the file, **`L`** cycles layouts, **`Z`/`⇧Z`** undo/redo, and **`A`** asks an installed coding agent — Claude Code, Codex, Gemini, Copilot, Aider and more, auto-detected from `$PATH` — to edit the deck headlessly; the page reloads when it saves. Edits auto-commit as you go.
|
|
69
|
+
4. **`decklight rec script.term.yaml`** — record a truthful terminal cast in a real PTY.
|
|
70
|
+
5. **`decklight bundle deck.html --themes all`** — flatten runtime, themes, casts and narration into one offline HTML file to hand off.
|
|
126
71
|
|
|
127
|
-
|
|
72
|
+
## Features at a glance
|
|
128
73
|
|
|
129
|
-
|
|
74
|
+
| Feature | In one line | More |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| **Markdown** | opt a slide into CommonMark with `data-markdown`; HTML stays the default | [SPEC §1](SPEC.md#1-deck-anatomy) |
|
|
77
|
+
| **Builds** | `data-build` on a container — each child is a step; the layout never jumps | [SPEC §2](SPEC.md#2-builds-keynote-style-reveal-calls-these-fragments) |
|
|
78
|
+
| **SVG diagrams** | inline SVG authored with `var(--d-*)` tokens; recolors with every theme, strokes draw in | [SPEC §3](SPEC.md#3-svg-diagrams-first-class) |
|
|
79
|
+
| **Motion** | slide transitions, Magic Move auto-animate, looping element effects — all respect reduced-motion | [SPEC §4](SPEC.md#4-motion) |
|
|
80
|
+
| **Theming** | 62 themes in 5 packs on one token contract; `T` picker, `⌃T` generates a contract-complete theme | [SPEC §5](SPEC.md#5-theming--the-token-contract) |
|
|
81
|
+
| **Code** | highlight.js themed through `--hl-*` tokens; `data-lines` steps highlight ranges as builds | [SPEC §6](SPEC.md#6-code) |
|
|
82
|
+
| **Terminals** | `decklight rec` captures real PTY output; replayed by typing then streaming, never a video | [SPEC §7](SPEC.md#7-terminal-recordings) |
|
|
83
|
+
| **Presenting** | speaker view, rehearse cue cards, overview, command palette, slide finder — all on `file://` | [SPEC §8](SPEC.md#8-presenting--output) |
|
|
84
|
+
| **Narration** | TTS reads your notes in sync with builds; the voice is the clock, captions + auto-advance | [SPEC §8](SPEC.md#8-presenting--output) |
|
|
130
85
|
|
|
131
|
-
|
|
86
|
+
## CLI
|
|
132
87
|
|
|
133
|
-
|
|
|
88
|
+
| Command | Purpose |
|
|
134
89
|
|---|---|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
|
|
|
140
|
-
| R6 no pure black or white | every neutral carries the base-hue tint |
|
|
141
|
-
| R7 gradients sparingly | ~15% of rolls, low-drift same-family washes only |
|
|
142
|
-
| R8 semantic anchors | terminal red/green/yellow keep their recognizable hue even when muted |
|
|
143
|
-
|
|
144
|
-
The picker's first row, **✨ Generate new…**, rolls candidates with live preview (`⌃T` re-rolls, `Enter` applies). `⌃⇧T` **saves** the applied roll: prompts for a name, persists it to localStorage, and downloads `<name>.css` — a normal theme file and the portable artifact (drop it into `themes/` and commit). Saved customs appear in the list tagged “custom” and survive reload. Previews for generated/custom themes travel as `?gen=<base64url tokens>`, applied statelessly at init — works on `file://` and inside bundles. Generation is seeded and deterministic; `instance.generateTheme()` does it programmatically.
|
|
90
|
+
| `decklight init ["Title"]` | scaffold a self-contained starter deck + an agent skill |
|
|
91
|
+
| `decklight dev deck.html` | **the whole authoring loop in one command** — live reload + every bridge this machine can run |
|
|
92
|
+
| `decklight rec script.term.yaml` | record a terminal cast in a real PTY |
|
|
93
|
+
| `decklight bundle deck.html [--all]` | flatten to a self-contained single-file HTML |
|
|
94
|
+
| `decklight tts` | live voice bridge — the player synthesizes narration through it |
|
|
145
95
|
|
|
146
|
-
|
|
96
|
+
`decklight help` for every command and flag — `refresh` and `export` are in [SPEC §7](SPEC.md#7-terminal-recordings), `edit` and `lipsync` in [SPEC §8](SPEC.md#8-presenting--output). Drive a deck programmatically with the [JS API](SPEC.md#9-public-js-api). The runtime has **zero dependencies** (marked and highlight.js are bundled at build time); `node-pty` and `js-yaml` are CLI-only.
|
|
147
97
|
|
|
148
|
-
##
|
|
98
|
+
## Keys
|
|
149
99
|
|
|
150
100
|
| Key | Action |
|
|
151
101
|
|---|---|
|
|
152
102
|
| `→` `←` `Space` | next / previous build or slide |
|
|
153
|
-
| `
|
|
154
|
-
| `
|
|
155
|
-
| `S` | speaker view (again: rehearse mode) |
|
|
156
|
-
| `B` / `F` | blackout / fullscreen |
|
|
157
|
-
| `D` | debug log (events, theme/font/narration, errors) |
|
|
158
|
-
| `C` | captions — the current notes segment, YouTube-style |
|
|
159
|
-
| `T` | theme picker (type to filter) |
|
|
160
|
-
| `/` | command palette |
|
|
161
|
-
| `G` | slide finder (live preview) |
|
|
162
|
-
| `E` | edit speaker notes (with `decklight edit` running) |
|
|
103
|
+
| `S` | speaker view (again: rehearse cue cards) |
|
|
104
|
+
| `T` | theme picker (type to filter) · `⌃T` generate a theme |
|
|
163
105
|
| `V` | narration on/off |
|
|
164
|
-
|
|
|
165
|
-
|
|
|
166
|
-
| `<` / `>` | voice speed, 0.25× steps (YouTube's shortcut) |
|
|
167
|
-
| `P` | pause / resume narration |
|
|
168
|
-
| `,` / `.` | cycle theme |
|
|
169
|
-
| `[` / `]` | cycle font |
|
|
170
|
-
| `⌃T` / `⌃⇧T` | generate a theme / save it |
|
|
171
|
-
| `M` | module menu (playlists & merged decks) |
|
|
172
|
-
| `?` | help overlay |
|
|
173
|
-
|
|
174
|
-
### Narration
|
|
175
|
-
|
|
176
|
-
Two sources, one `V` toggle (`N` picks):
|
|
177
|
-
|
|
178
|
-
- **Recorded** — pre-rendered per-slide audio played in sync with slide changes. Generated by `tools/voiceover.mjs`, which pipes speaker notes through a local Ollama model (LLMs write text; they don't speak) and synthesizes with `--engine piper` (neural local TTS, fully offline) or `--engine gemini` (gemini-2.5-pro-tts on Vertex AI; needs `gcloud auth application-default login`). A deck can ship several takes — `narration: { files: [{ label, dir, ext }, …] }` (`ext` defaults to `m4a`) — and `N` switches between them, persisted per deck.
|
|
179
|
-
- **Live voice** — synthesized on the fly *as you present*. Run `decklight tts` (a local bridge to gemini-2.5-pro-tts; the browser can't hold Google credentials), then pick any of the 30 Gemini prebuilt voices and a delivery tone — professional, joyful, too serious, super excited… or **type your own instruction** ("Read like a noir detective") — from the `N` picker or the `/` palette's "Live voice…" command. Every voice **and tone** row has a **▶ preview** that speaks a test sentence (editable at the top of the voices view, ↺ restores the default *"Hey, this is Decklight"*) so you can audition before committing — tone previews speak the drafted voice in that delivery style, the custom-tone input previews a typed instruction before Enter commits it, and after the first preview the rest of the roster prefetches in the background (the default sentence's cache is kept for the whole session). Narration is **synced to builds**: each `⟨CLICK⟩` segment of the notes becomes its own clip, and when it ends the deck reveals the next build — after the last segment it **auto-advances** to the next slide. Pick a voice, press play, and the deck presents itself beat by beat; pressing `→` mid-sentence re-syncs the voice to wherever you went. Mark interactive slides (quizzes, exercises) with `data-narration="hold"` — narration never auto-advances off them, waiting for you instead. The spoken unit is a **sentence** — each one is its own synthesized, cached clip, so first audio lands fast — and while narration is on a **lookahead buffer** keeps the next 10 sentences synthesized in parallel in the background. `P` pauses/resumes mid-sentence, and captions follow the voice sentence by sentence.
|
|
180
|
-
- **⇧V records the live voice offline**: downloads every slide's narration as `slide-NN.wav`, **stitched from the sentence cache** — anything you've already played (or the lookahead buffer warmed) is reused at zero cost, and only unheard sentences synthesize. A progress bar estimates time remaining from the observed per-slide rate. Point `narration.files` at the folder with `ext: 'wav'` and the deck narrates without the bridge.
|
|
181
|
-
|
|
182
|
-
### Chrome & navigation
|
|
183
|
-
|
|
184
|
-
- **Command palette** (`/`): every command with its shortcut, type-to-filter, Enter runs — argument commands drill into their pickers, `goto 27` (or just `27`) jumps to a slide, and unmatched text becomes a slide search.
|
|
185
|
-
- **Transcript** (palette → Transcript…): the deck's full spoken script in an overlay — click a title to jump — with one-click export to `.txt` or `.md`.
|
|
186
|
-
- **Edit mode** (`E`, with `decklight edit deck.html` running): a notes editor over the current slide — plain text with `⟨CLICK⟩` lines between beats — whose Save writes the `<aside class="notes">` back into the file; the server watches the deck and every connected browser **auto-reloads** (the hash keeps your slide/step). Editing the file in your own editor live-reloads too. Works from the printed URL *and* from a double-clicked `file://` deck — the player finds the server on its default port (override with `Decklight.init({ edit: { url } })`).
|
|
187
|
-
- **Slide finder** (`G`, palette → Find slide, or just type words in the palette): type words, get matching slides — title matches rank first, body matches follow — with a live preview of the selected slide on the right. `Enter` jumps. (Deliberately not `⌘F` — browser find stays sacred.)
|
|
188
|
-
- **Speaker view** (`S`): current + next thumbnails, notes with `⟨CLICK⟩` segments highlighted as builds land, elapsed timer, step list. Works on `file://`. Press `S` again for **rehearse mode** — big cue cards (the deck's rehearse notes) instead of full prose, so you practice recalling the material rather than reading it.
|
|
189
|
-
- **Overview** (`O`): scaled grid of every slide, arrow-key navigation.
|
|
190
|
-
- **Brand logo**: `logo: { onLight: '#logo-dark-art', onDark: '#logo-light-art' }` puts a mark on every slide; the engine picks the variant from the applied theme's real background luminance, so the right logo follows every theme switch — generated themes included. `data-logo` on a section swaps the corner mark for a large in-flow one above the slide's title (module openers, covers).
|
|
191
|
-
- **Pinned titles**: `pinTitles: true` keeps slide titles at one vertical position deck-wide instead of drifting with content height (title cards and quote slides stay centered; `data-pin` / `data-pin="none"` / `data-pin="<px>"` per slide). Subtitles join the pinned header.
|
|
192
|
-
- **Playlists**: `playlist: { modules: [{title, href}…], index }` chains decks at their boundaries; `M` opens the module menu. Merged single-file decks navigate by in-file markers instead — no page loads.
|
|
193
|
-
- **Print**: `?print` renders every slide with all builds complete, one per page — print to PDF from there.
|
|
194
|
-
- Touch swipe, hash deep-links (`#/<slide>/<step>`), `slideNumber`, prev/next chrome and progress bar via `controls`.
|
|
195
|
-
|
|
196
|
-
## Single-file bundles
|
|
197
|
-
|
|
198
|
-
```sh
|
|
199
|
-
decklight bundle deck.html -o out.html --themes all # one deck, self-contained
|
|
200
|
-
decklight bundle deck.html --all -o course.html # follow the playlist, merge EVERY module
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
One HTML file with the runtime, structure CSS, chosen themes, casts, and images inlined — email it, it works offline, themes and the generator included. Merged bundles get in-file module navigation and per-module cast namespacing.
|
|
204
|
-
|
|
205
|
-
## CLI
|
|
206
|
-
|
|
207
|
-
| Command | Purpose |
|
|
208
|
-
|---|---|
|
|
209
|
-
| `decklight init ["Title"]` | scaffold a self-contained starter deck + an agent skill (`.claude/skills/decklight/`, `AGENTS.md`) |
|
|
210
|
-
| `decklight rec script.term.yaml` | record a terminal cast in a real PTY |
|
|
211
|
-
| `decklight refresh <dir\|casts…>` | re-record embedded scripts, report drift |
|
|
212
|
-
| `decklight export cast.json` | flatten to asciicast v2 |
|
|
213
|
-
| `decklight bundle deck.html [--all]` | self-contained single-file HTML |
|
|
214
|
-
| `decklight tts` | live voice bridge — the player synthesizes narration through it |
|
|
215
|
-
| `decklight edit deck.html` | live-editing server — `E` edits notes back into the file, saves auto-reload |
|
|
216
|
-
|
|
217
|
-
`decklight help` for flags and examples. The runtime has **zero dependencies** (marked and highlight.js are bundled at build time); `node-pty` and `js-yaml` are CLI-only.
|
|
218
|
-
|
|
219
|
-
## JS API
|
|
220
|
-
|
|
221
|
-
```js
|
|
222
|
-
const deck = Decklight.init(config);
|
|
223
|
-
deck.next(); deck.prev(); deck.goto(slide, step);
|
|
224
|
-
deck.on('slide' | 'build' | 'ready', fn);
|
|
225
|
-
deck.state; // { slide, step, totalSlides }
|
|
226
|
-
deck.sync(); // re-scan a dynamically-edited DOM
|
|
227
|
-
deck.theme(name); // switch theme programmatically
|
|
228
|
-
deck.generateTheme(); // ⌃T programmatically; returns the autoname
|
|
229
|
-
deck.saveGeneratedTheme(name); // ⌃⇧T; a name argument skips the prompt
|
|
230
|
-
Decklight.registerBuildProvider(el, provider);
|
|
231
|
-
```
|
|
106
|
+
| `/` | command palette · `G` find a slide |
|
|
107
|
+
| `?` | help overlay — every key |
|
|
232
108
|
|
|
233
109
|
## Install on another machine
|
|
234
110
|
|
|
235
111
|
```sh
|
|
236
|
-
git clone
|
|
112
|
+
git clone https://github.com/decklight/decklight && cd decklight
|
|
237
113
|
npm install # dev deps for building/recording; decks only need dist/ + themes/
|
|
238
114
|
npm run build
|
|
239
115
|
```
|
|
240
116
|
|
|
241
|
-
Decks reference `dist/decklight.{js,css}` and one theme file — copy those three files (or a bundle) and nothing else.
|
|
117
|
+
Decks reference `dist/decklight.{js,css}` and one theme file — copy those three files (or a `bundle`) and nothing else.
|
|
242
118
|
|
|
243
119
|
## Architecture
|
|
244
120
|
|
|
@@ -246,12 +122,20 @@ Decks reference `dist/decklight.{js,css}` and one theme file — copy those thre
|
|
|
246
122
|
<img src="docs/architecture.svg" width="860" alt="Decklight architecture: a single deck.html and a theme.css feed a zero-dependency browser runtime (engine, terminal player, markdown/svg/code, narration, overlays); two localhost servers sit beside it — decklight edit for live-reload note editing and decklight tts bridging to Vertex AI Gemini TTS; a node CLI records, refreshes, exports and bundles; and a verification band (WCAG gates, palette rules, headless render assertions, property tests) gates everything against SPEC.md.">
|
|
247
123
|
</p>
|
|
248
124
|
|
|
249
|
-
One HTML file and one theme stylesheet feed a **zero-dependency browser runtime**; everything with native dependencies or credentials lives in **localhost tools** (the CLI, the `edit` live-reload server, the `tts` bridge
|
|
125
|
+
One HTML file and one theme stylesheet feed a **zero-dependency browser runtime**; everything with native dependencies or credentials lives in **localhost tools** (the CLI, the `edit` live-reload server, the `tts` bridge); and a **verification band** — contrast gates, palette rules, headless render assertions, property tests — holds all of it to the `SPEC.md` contract.
|
|
250
126
|
|
|
251
127
|
## Development
|
|
252
128
|
|
|
253
|
-
`npm test` (
|
|
129
|
+
`npm test` (unit + property tests) · `node test/render.mjs` (headless-Chrome render assertions) · `node test/contrast.mjs` (WCAG theme gates) · `npm run verify` for the lot. The repo culture: every feature is verified end-to-end against a real render, not just unit-tested — see SPEC §10.
|
|
130
|
+
|
|
131
|
+
## Links
|
|
132
|
+
|
|
133
|
+
- **[decklight.io](https://decklight.io)** — the showcase deck, live and narrating itself
|
|
134
|
+
- **`demo/intro.html`** — the short "what is Decklight" tour
|
|
135
|
+
- **`demo/showcase.html`** — the full self-demo, every feature on its own slide
|
|
136
|
+
- **[`SPEC.md`](SPEC.md)** — the authoring contract
|
|
137
|
+
- **[`CONTRIBUTING.md`](CONTRIBUTING.md)** — how to contribute (DCO sign-off required)
|
|
254
138
|
|
|
255
139
|
## License
|
|
256
140
|
|
|
257
|
-
|
|
141
|
+
Decklight is free and open source, released under the [Apache License 2.0](LICENSE). Contributions are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md).
|