immerslides 1.0.0-beta-6 → 1.0.0-beta-8
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/README.md +164 -106
- package/README.zh-TW.md +191 -74
- package/bin/immerslides.mjs +15 -5
- package/dist/code/HighlightedCode.d.ts +1 -0
- package/dist/code/HighlightedCode.js +11 -2
- package/dist/code/highlighting.js +3 -2
- package/dist/code/languages.d.ts +11 -0
- package/dist/code/languages.js +167 -0
- package/dist/i18n/messages.d.ts +7 -0
- package/dist/i18n/messages.js +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/player/index.d.ts +8 -0
- package/dist/player/index.js +8 -0
- package/dist/presentation/Player.js +41 -3
- package/dist/presentation/PlayerToolbar.d.ts +6 -2
- package/dist/presentation/PlayerToolbar.js +3 -3
- package/dist/presentation/Presenter.js +8 -50
- package/dist/presentation/PresenterPanels.d.ts +23 -0
- package/dist/presentation/PresenterPanels.js +27 -0
- package/dist/presentation/Stage.js +1 -1
- package/dist/presentation/types.d.ts +9 -0
- package/dist/presentation/useTimer.d.ts +7 -0
- package/dist/presentation/useTimer.js +40 -0
- package/dist/presenter-console/Clock.d.ts +4 -0
- package/dist/presenter-console/Clock.js +7 -0
- package/dist/presenter-console/ConsoleHeader.d.ts +10 -0
- package/dist/presenter-console/ConsoleHeader.js +8 -0
- package/dist/presenter-console/ConsoleLayout.d.ts +15 -0
- package/dist/presenter-console/ConsoleLayout.js +9 -0
- package/dist/presenter-console/ConsoleNavigation.d.ts +12 -0
- package/dist/presenter-console/ConsoleNavigation.js +8 -0
- package/dist/presenter-console/JumpSelect.d.ts +6 -0
- package/dist/presenter-console/JumpSelect.js +11 -0
- package/dist/presenter-console/PresenterConsole.d.ts +14 -0
- package/dist/presenter-console/PresenterConsole.js +26 -0
- package/dist/presenter-console/channel.d.ts +27 -0
- package/dist/presenter-console/channel.js +31 -0
- package/dist/presenter-console/index.d.ts +3 -0
- package/dist/presenter-console/index.js +5 -0
- package/dist/presenter-console/sync.d.ts +7 -0
- package/dist/presenter-console/sync.js +31 -0
- package/dist/presenter-console/usePresenterConsole.d.ts +19 -0
- package/dist/presenter-console/usePresenterConsole.js +70 -0
- package/dist/site/Site.js +10 -175
- package/dist/site/SitePage.d.ts +16 -0
- package/dist/site/SitePage.js +51 -0
- package/dist/site/hooks.d.ts +8 -0
- package/dist/site/hooks.js +137 -0
- package/dist/site/model.d.ts +22 -0
- package/dist/site/model.js +8 -0
- package/dist/slides/ChapterRail.js +3 -1
- package/dist/slides/SlideFrame.d.ts +7 -3
- package/dist/slides/SlideFrame.js +4 -2
- package/dist/styles/base.css +1208 -0
- package/dist/styles/presenter.css +260 -0
- package/dist/styles/site.css +239 -0
- package/dist/styles.css +61 -1
- package/package.json +18 -3
- package/skills/immerslides/SKILL.md +44 -34
- package/skills/immerslides/references/authoring.md +4 -2
- package/skills/immerslides/references/composition.md +18 -26
- package/skills/immerslides/references/features.md +31 -28
- package/skills/immerslides/references/presenter.md +28 -0
- package/skills/immerslides/references/site.md +1 -1
- package/skills/immerslides-en/SKILL.md +40 -30
- package/skills/immerslides-en/references/authoring.md +4 -2
- package/skills/immerslides-en/references/composition.md +18 -26
- package/skills/immerslides-en/references/features.md +31 -28
- package/skills/immerslides-en/references/presenter.md +28 -0
- package/skills/immerslides-en/references/site.md +1 -1
- package/starter/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,86 +10,89 @@
|
|
|
10
10
|

|
|
11
11
|
[](LICENSE)
|
|
12
12
|
|
|
13
|
-
React presentations with immersive code and flow walkthroughs.
|
|
13
|
+
React presentations with immersive code and flow walkthroughs. Write slides as React components, reveal code and flows one focus at a time, and publish the same deck as a scrolling reading site.
|
|
14
14
|
|
|
15
15
|
**English** | [繁體中文](README.zh-TW.md)
|
|
16
16
|
|
|
17
17
|
## Features
|
|
18
18
|
|
|
19
|
-
- **Full-page clicks.** One click advances to the next complete slide.
|
|
20
|
-
- **
|
|
21
|
-
- **Flow timelines.** `Timeline`, `FlowNode`, and `FlowConnector` show
|
|
22
|
-
- **Presenter mode.** Press `P`
|
|
23
|
-
- **
|
|
24
|
-
- **Shareable URLs.** Every slide and step has a
|
|
25
|
-
- **
|
|
26
|
-
- **Reduced motion.**
|
|
19
|
+
- **Full-page clicks.** One click advances to the next complete slide. Add extra steps only where the talk needs them.
|
|
20
|
+
- **Code walkthroughs.** `CodeBlock` highlights code in TypeScript, Python, Java, SQL, JSON, YAML, Bash, HTML, CSS, and more, and steps through it one focus at a time.
|
|
21
|
+
- **Flow timelines.** `Timeline`, `FlowNode`, and `FlowConnector` show a process and its steps.
|
|
22
|
+
- **Presenter mode.** Press `P` for a window with the current slide, the next slide, speaker notes, and a timer.
|
|
23
|
+
- **Navigator.** Press `O` to browse chapters and slides as an outline or thumbnails, and filter the slides you marked.
|
|
24
|
+
- **Shareable URLs.** Every slide and step has a link, such as `/#/code-walkthrough?step=2`.
|
|
25
|
+
- **Reading version.** `Site` publishes the same deck as a scrolling page.
|
|
26
|
+
- **Reduced motion.** Transitions turn off for people who prefer less motion, and all content stays visible.
|
|
27
27
|
- **Agent skill.** A bundled skill helps AI coding agents write and revise decks.
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## Quick start
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
### Try the demo
|
|
32
|
+
|
|
33
|
+
You need Node.js 26 or later and pnpm 12.20.0. The repository pins pnpm in its `packageManager` field, and `.nvmrc` pins Node.
|
|
33
34
|
|
|
34
35
|
```sh
|
|
35
|
-
nvm install
|
|
36
|
-
nvm use
|
|
37
|
-
npm install --global pnpm@12.20.0
|
|
38
36
|
pnpm install
|
|
37
|
+
pnpm dev
|
|
39
38
|
```
|
|
40
39
|
|
|
41
|
-
|
|
40
|
+
Open the URL Vite prints, usually `http://127.0.0.1:5173/`. The demo covers layouts, flow diagrams, code highlighting, step-by-step focus, presenter mode, and playback. Three routes are fixed: `/` shows the view set in `starter/src/config.ts`, `/slides/` shows the presentation, and `/site/` shows the scrolling reading view.
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
pnpm dev
|
|
45
|
-
```
|
|
42
|
+
### Create your own presentation
|
|
46
43
|
|
|
47
|
-
|
|
44
|
+
Run the `create` command in any one of three ways:
|
|
48
45
|
|
|
49
|
-
|
|
46
|
+
1. **Without installing anything**, for a one-off project:
|
|
50
47
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
```sh
|
|
49
|
+
pnpm dlx immerslides@beta create my-presentation
|
|
50
|
+
```
|
|
54
51
|
|
|
55
|
-
|
|
52
|
+
2. **Install once, then use it anywhere**:
|
|
56
53
|
|
|
57
|
-
|
|
54
|
+
```sh
|
|
55
|
+
pnpm add -g immerslides@beta
|
|
56
|
+
immerslides create my-presentation
|
|
57
|
+
```
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
node bin/immerslides.mjs create ../my-presentation
|
|
63
|
-
cd ../my-presentation
|
|
64
|
-
pnpm add "$TARBALL"
|
|
65
|
-
pnpm dev
|
|
66
|
-
```
|
|
59
|
+
If `immerslides` is not found after the install, run `pnpm setup` once, then open a new terminal.
|
|
60
|
+
|
|
61
|
+
3. **From a project that already depends on immerslides**:
|
|
67
62
|
|
|
68
|
-
|
|
63
|
+
```sh
|
|
64
|
+
pnpm exec immerslides create ../my-presentation
|
|
65
|
+
```
|
|
69
66
|
|
|
70
|
-
|
|
67
|
+
This works only inside a project where `immerslides` is installed, such as a project you created earlier. In any other folder, `pnpm exec` reports that the command is not found. To add the dependency first, run `pnpm add -D immerslides@beta`.
|
|
68
|
+
|
|
69
|
+
Then open the new project:
|
|
71
70
|
|
|
72
71
|
```sh
|
|
73
|
-
pnpm dlx immerslides create my-presentation
|
|
74
72
|
cd my-presentation
|
|
75
73
|
pnpm install
|
|
76
74
|
pnpm dev
|
|
77
75
|
```
|
|
78
76
|
|
|
79
|
-
|
|
77
|
+
The `create` command copies the starter project and the two agent skills into the new directory. It refuses to write into a non-empty directory and does not install dependencies, so run `pnpm install` first.
|
|
80
78
|
|
|
81
|
-
|
|
79
|
+
`@beta` selects the current pre-release. The `latest` tag still points to an older version, so without `@beta` you get that older CLI. pnpm does not resolve a tag to a version published less than 24 hours earlier, so right after a release `@beta` can still point to the previous version. Until then, use the exact version, for example `immerslides@1.0.0-beta-8`.
|
|
82
80
|
|
|
83
|
-
|
|
84
|
-
$immerslides-en Turn this material into a CI talk.
|
|
85
|
-
One click should advance one full slide. Do not split a flow into one click per node.
|
|
86
|
-
```
|
|
81
|
+
To install from GitHub Packages instead, set the registry for the `@<repository-owner>` scope and log in with a token that has `read:packages`. Projects created by the CLI map the scoped package to `immerslides` with an npm alias, so the import paths stay the same.
|
|
87
82
|
|
|
88
|
-
|
|
83
|
+
Start with these files:
|
|
89
84
|
|
|
90
|
-
|
|
85
|
+
| File | What to change |
|
|
86
|
+
| ----------------- | --------------------------------------------------------------------------------------------- |
|
|
87
|
+
| `src/deck.tsx` | Your slides, their order, the chapters, and the speaker notes. It holds the demo content now. |
|
|
88
|
+
| `src/config.ts` | `defaultView` (what `/` shows) and `locale` (`zh-Hant` or `en`). |
|
|
89
|
+
| `src/site.tsx` | The reading view. Usually no change is needed. |
|
|
90
|
+
| `src/styles.css` | Styles for the demo only. Replace them with your own, or delete them. |
|
|
91
|
+
| `src/examples.ts` | Sample code and timeline data for the demo. Delete it when your deck no longer uses it. |
|
|
91
92
|
|
|
92
|
-
|
|
93
|
+
## Use in your React project
|
|
94
|
+
|
|
95
|
+
Import the styles once, in the entry file, and pass a deck to `Player`:
|
|
93
96
|
|
|
94
97
|
```tsx
|
|
95
98
|
import { Player } from 'immerslides/player';
|
|
@@ -101,7 +104,9 @@ export function App() {
|
|
|
101
104
|
}
|
|
102
105
|
```
|
|
103
106
|
|
|
104
|
-
|
|
107
|
+
The stylesheet is required. Without it the player renders with no layout.
|
|
108
|
+
|
|
109
|
+
Define the deck with `defineDeck`. It sets the slides, their order, the chapters, and a `RenderSlide` component that draws each slide:
|
|
105
110
|
|
|
106
111
|
```tsx
|
|
107
112
|
import { defineDeck, SlideFrame, type SlideRenderProps } from 'immerslides';
|
|
@@ -128,48 +133,77 @@ export const deck = defineDeck({
|
|
|
128
133
|
});
|
|
129
134
|
```
|
|
130
135
|
|
|
131
|
-
|
|
136
|
+
Each slide advances with one click by default, which is `steps: 1`. Set a larger `steps` only when a slide needs focus states. `steps` counts the initial state, so `steps: 2` gives the values `0` and `1`.
|
|
137
|
+
|
|
138
|
+
Slide and deck options:
|
|
139
|
+
|
|
140
|
+
- `SlideFrame` takes `layout="image"` for a full-slide picture with no chapter rail, heading, or footer. Use `header={false}` to hide the heading and `footer={false}` to hide the footer.
|
|
141
|
+
- `presenter: false` removes the presenter button and the `P` shortcut from a deck that does not need them.
|
|
142
|
+
- `chapterRail: { toggle: true }` lets the audience collapse the chapter rail. A chapter with `numbered: false` is listed without a number, and the other chapters still count from 01.
|
|
143
|
+
|
|
144
|
+
### Choosing an entry point
|
|
145
|
+
|
|
146
|
+
The main entry exports everything: the authoring components, the player, and the site view. Bundlers remove the parts you do not use, so `import { CodeWindow } from 'immerslides'` adds only the code window to your bundle. When a file needs only one job, use the entry for that job:
|
|
147
|
+
|
|
148
|
+
| Import | Provides | Use it for |
|
|
149
|
+
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- | --------------------------------- |
|
|
150
|
+
| `immerslides` | Everything: `defineDeck`, `SlideFrame`, the code and flow components, `Player`, `Site`, and hooks | Most code |
|
|
151
|
+
| `immerslides/player` | `Player`, `SlideNavigator`, `SlidePreview`, `usePlayback`, `getSlideHref`, `fadeTransition` | Files that only play a deck |
|
|
152
|
+
| `immerslides/site` | `Site`, `SiteStory`, `getSiteHref` | The reading view |
|
|
153
|
+
| `immerslides/presenter` | `PresenterConsole`, `PresenterSync`, `stepCue` (optional, see below) | The console and the audience sync |
|
|
154
|
+
| `immerslides/styles.css` | All global styles. Import once. | Styles |
|
|
155
|
+
| `immerslides/styles/base.css`, `immerslides/styles/presenter.css`, `immerslides/styles/site.css` | The style parts. Import `base.css` first, then the parts you use. | Shipping less CSS |
|
|
156
|
+
|
|
157
|
+
#### Deprecated entries
|
|
158
|
+
|
|
159
|
+
These entries still work, but they will be removed in a future release. Move to the entry in the right column:
|
|
160
|
+
|
|
161
|
+
| Deprecated | Use instead |
|
|
162
|
+
| ------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
|
|
163
|
+
| `immerslides/deck` | `immerslides` |
|
|
164
|
+
| `immerslides/slide-frame`, `immerslides/chapter-guide` | `immerslides` |
|
|
165
|
+
| `immerslides/slide-navigator`, `immerslides/slide-preview` | `immerslides/player`, or `immerslides` |
|
|
166
|
+
| `immerslides/code-block`, `immerslides/code-window`, `immerslides/highlighted-code` | `immerslides` |
|
|
167
|
+
| `immerslides/timeline`, `immerslides/flow-node`, `immerslides/flow-connector`, `immerslides/step-description` | `immerslides` |
|
|
168
|
+
| `immerslides/presenter-console`, `immerslides/presenter-sync` | `immerslides/presenter` |
|
|
169
|
+
|
|
170
|
+
To ship less CSS, import `immerslides/styles/base.css` first and then only the parts you use. `styles.css` is the three parts together.
|
|
132
171
|
|
|
133
|
-
|
|
172
|
+
Syntax highlighting loads the language the first time a code block needs it, so the main entry does not include highlight.js. Until then, code shows as plain text with the same layout.
|
|
134
173
|
|
|
135
|
-
|
|
136
|
-
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------- |
|
|
137
|
-
| `immerslides` | Everything below, plus `usePlayback` and `useReducedMotion` |
|
|
138
|
-
| `immerslides/player` | `Player` |
|
|
139
|
-
| `immerslides/deck` | `defineDeck` and the deck types |
|
|
140
|
-
| `immerslides/site` | `Site`, `SiteStory`, `getSiteHref` |
|
|
141
|
-
| `immerslides/slide-frame`, `immerslides/chapter-guide` | `SlideFrame`, `ChapterGuide` |
|
|
142
|
-
| `immerslides/slide-navigator`, `immerslides/slide-preview` | `SlideNavigator`, `SlidePreview` |
|
|
143
|
-
| `immerslides/code-block`, `immerslides/code-window`, `immerslides/highlighted-code` | `CodeBlock`, `CodeWindow`, `HighlightedCode` |
|
|
144
|
-
| `immerslides/timeline`, `immerslides/flow-node`, `immerslides/flow-connector` | `Timeline`, `FlowNode`, `FlowConnector` |
|
|
145
|
-
| `immerslides/step-description` | `StepDescription` |
|
|
146
|
-
| `immerslides/styles.css` | Global styles. Import once. |
|
|
174
|
+
## Writing slides
|
|
147
175
|
|
|
148
|
-
|
|
176
|
+
- **Keep the click rhythm.** Advance whole slides by default. A flow slide shows at most three nodes; carry a longer flow onto a continuation slide.
|
|
177
|
+
- **Walk through code and flows.** `CodeBlock` and `Timeline` take `steps`, which focus one section at a time. See [immersive walkthroughs](skills/immerslides-en/references/immersive.md).
|
|
178
|
+
- **Write speaker notes.** Add `notes` to a slide. The notes appear only in the presenter window, never on the audience slide.
|
|
179
|
+
- **Share links.** Give a slide a `slug` for a stable link, and build links inside the content with `getSlideHref(deck, id, step)`.
|
|
180
|
+
- **Translate.** Use `translations` in `defineDeck`. See [Localization](#localization).
|
|
181
|
+
|
|
182
|
+
The guides cover the rest:
|
|
149
183
|
|
|
150
184
|
- [Authoring guide](skills/immerslides-en/references/authoring.md): deck definitions and the public API
|
|
151
185
|
- [Features](skills/immerslides-en/references/features.md): what each feature is for
|
|
152
186
|
- [Immersive walkthroughs](skills/immerslides-en/references/immersive.md): step-by-step code and flow focus
|
|
153
187
|
- [Composition](skills/immerslides-en/references/composition.md): custom layouts with the standalone components
|
|
154
|
-
- [Presenter mode](skills/immerslides-en/references/presenter.md): notes, next-slide preview, and
|
|
188
|
+
- [Presenter mode](skills/immerslides-en/references/presenter.md): notes, next-slide preview, timer, and the console
|
|
155
189
|
- [Slide URLs](skills/immerslides-en/references/urls.md): slugs, hash URLs, and `getSlideHref`
|
|
156
190
|
- [Site view](skills/immerslides-en/references/site.md): publishing the deck as a reading page
|
|
157
191
|
|
|
158
|
-
The Chinese versions
|
|
192
|
+
The Chinese versions are in [`skills/immerslides/references/`](skills/immerslides/references/).
|
|
159
193
|
|
|
160
|
-
##
|
|
194
|
+
## Reading view
|
|
161
195
|
|
|
162
|
-
|
|
196
|
+
`Site` from `immerslides/site` renders the same deck as a scrolling page. The starter's `src/site.tsx` shows the usage:
|
|
163
197
|
|
|
164
198
|
```tsx
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
199
|
+
import { Site } from 'immerslides/site';
|
|
200
|
+
|
|
201
|
+
<Site deck={deck} presentationHref="./slides/" locale="en" />;
|
|
168
202
|
```
|
|
169
203
|
|
|
170
|
-
|
|
204
|
+
`presentationHref` is the address of the presentation, so readers can switch to it.
|
|
171
205
|
|
|
172
|
-
##
|
|
206
|
+
## Playing and sharing
|
|
173
207
|
|
|
174
208
|
| Key | Action |
|
|
175
209
|
| ------------------- | -------------------------------------------------------- |
|
|
@@ -180,58 +214,82 @@ Translate slide titles, notes, chapter titles, and the handout with `translation
|
|
|
180
214
|
| `O` | Open the chapter and slide navigator. |
|
|
181
215
|
| `F` | Toggle fullscreen. |
|
|
182
216
|
| `P` | Open or focus the presenter window. |
|
|
183
|
-
| `?` | Open the help dialog.
|
|
217
|
+
| `?` | Open the help dialog, which also restarts the deck. |
|
|
184
218
|
| Esc | Close menus. |
|
|
185
219
|
|
|
186
|
-
Reloading restores the slide and step from the URL. If the URL does not name a slide, the player restores the progress saved in the same tab.
|
|
220
|
+
Reloading restores the slide and step from the URL. If the URL does not name a slide, the player restores the progress saved in the same tab. Start from the beginning with `<Player deck={deck} fresh />`, or restart from the help dialog.
|
|
187
221
|
|
|
188
|
-
|
|
222
|
+
Marks made with the star in the navigator last for the current playback. Reloading or restarting clears them.
|
|
189
223
|
|
|
190
|
-
|
|
224
|
+
## Presenter console (optional)
|
|
191
225
|
|
|
192
|
-
|
|
226
|
+
The presenter console is a separate page for the speaker. It drives an audience page in another window of the same browser over a `BroadcastChannel`. It is not part of `Player`, and a deck works without it.
|
|
193
227
|
|
|
194
|
-
|
|
228
|
+
Put `PresenterSync` in the deck's `Controls` on the audience page, and mount `PresenterConsole` on its own route. Both sides use the same channel name:
|
|
195
229
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
230
|
+
```tsx
|
|
231
|
+
import { PresenterConsole, PresenterSync } from 'immerslides/presenter';
|
|
232
|
+
|
|
233
|
+
const Controls = (props) => (
|
|
234
|
+
<>
|
|
235
|
+
<PresenterSync
|
|
236
|
+
deck={deck}
|
|
237
|
+
channel="my-deck"
|
|
238
|
+
slideId={props.state.slideId}
|
|
239
|
+
step={props.state.step}
|
|
240
|
+
/>
|
|
241
|
+
</>
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
<PresenterConsole
|
|
245
|
+
deck={deck}
|
|
246
|
+
channel="my-deck"
|
|
247
|
+
audienceHref="../"
|
|
248
|
+
header={<SignOut />}
|
|
249
|
+
/>;
|
|
250
|
+
```
|
|
207
251
|
|
|
208
|
-
|
|
252
|
+
The console has no sign-in of its own. Pass anything your app needs, such as a sign-out form, as `header`.
|
|
209
253
|
|
|
210
|
-
|
|
254
|
+
## Localization
|
|
211
255
|
|
|
212
|
-
|
|
213
|
-
- `bin/`: the `immerslides` CLI, which provides `create`
|
|
214
|
-
- `starter/`: the project template that the CLI copies, and the demo app for `pnpm dev`
|
|
215
|
-
- `skills/immerslides/`: the agent skill and its reference documents
|
|
216
|
-
- `tests/`: Vitest unit tests and Playwright browser tests
|
|
217
|
-
- `scripts/`: build, package smoke test, and favicon generation
|
|
256
|
+
The player, presenter view, navigator, and site support `zh-Hant` (the default) and `en`. Pass `locale` to `Player` or `Site`:
|
|
218
257
|
|
|
219
|
-
|
|
258
|
+
```tsx
|
|
259
|
+
export function App() {
|
|
260
|
+
return <Player deck={deck} locale="en" />;
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Translate slide titles, notes, chapter titles, and the handout with `translations` in `defineDeck`, keyed by locale. Text without a translation falls back to the authored text. Links are built from the authored titles, so they are the same in every language. Slide renderers receive `locale`, and `useI18n()` gives your own components the current `locale` and a translator `t` for the built-in interface text.
|
|
265
|
+
|
|
266
|
+
## Use with an AI agent
|
|
220
267
|
|
|
221
|
-
|
|
268
|
+
New projects include two skills under `.agents/skills/`: `immerslides` (Chinese) and `immerslides-en` (English). In an agent that supports project skills, invoke one of them with a prompt such as:
|
|
269
|
+
|
|
270
|
+
```text
|
|
271
|
+
$immerslides-en Turn this material into a CI talk.
|
|
272
|
+
One click should advance one full slide. Do not split a flow into one click per node.
|
|
273
|
+
```
|
|
222
274
|
|
|
223
|
-
|
|
275
|
+
The skills are written for the agent: they say which reference to read for each task and which mistakes to avoid. The sources are [`skills/immerslides/`](skills/immerslides/) (Chinese) and [`skills/immerslides-en/`](skills/immerslides-en/) (English). Keep the two versions in sync when you change one. To add a skill to an existing project, copy the matching folder to `.agents/skills/` in that project.
|
|
224
276
|
|
|
225
|
-
|
|
277
|
+
## Troubleshooting
|
|
226
278
|
|
|
227
|
-
|
|
279
|
+
| Symptom | What to check |
|
|
280
|
+
| -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
281
|
+
| The slides have no layout or colors. | The entry file must import `immerslides/styles.css`. |
|
|
282
|
+
| Code appears as plain text for a moment. | Highlighting loads a language the first time it is needed. This is expected. For server rendering, await `preloadCodeLanguages([...])` before rendering, and call it with the same languages on the client before hydrating. |
|
|
283
|
+
| The presenter window does not open. | Allow pop-ups for the site. The player shows a message when the browser blocks the window. |
|
|
284
|
+
| The console does not follow the audience. | Both pages must use the same `channel` name, and both must be open in the same browser. |
|
|
285
|
+
| Saved progress lands on the wrong step after you edit slides. | Increase `version` when you change slides or steps. Start over with `fresh`, or restart from the help dialog. |
|
|
286
|
+
| Install or dev server fails with a Node version error. | Use Node.js 26 or later (see `.nvmrc`). |
|
|
287
|
+
| `pnpm build` fails with `Unable to resolve @typescript/typescript-darwin-arm64` on an Apple Silicon Mac. | The pnpm binary is x64, running under Rosetta, so it installs only the x64 TypeScript compiler. Projects created with `1.0.0-beta-8` or later include a `pnpm-workspace.yaml` that fixes this. For an older project, add a `pnpm-workspace.yaml` with `supportedArchitectures` listing `x64` and `arm64` under `cpu`, or delete `node_modules` and install with an arm64 pnpm. |
|
|
288
|
+
| `@beta` installs an older version than the one npm lists. | pnpm skips versions published less than 24 hours ago when it resolves a tag. Install the exact version, for example `pnpm dlx immerslides@1.0.0-beta-8 create my-presentation`, or wait a day. To skip the check for one command, add `--config.minimumReleaseAge=0`. |
|
|
228
289
|
|
|
229
|
-
|
|
230
|
-
2. Add an `NPM_TOKEN` secret to that environment. The token must be allowed to publish `immerslides`.
|
|
231
|
-
3. Make sure the repository's `GITHUB_TOKEN` can write packages, and that the organization allows packages under the scope.
|
|
232
|
-
4. Commit the version you want to release in `package.json`. The release creates the tag `v<version>`.
|
|
290
|
+
## Contributing
|
|
233
291
|
|
|
234
|
-
|
|
292
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for local development, the tests, the pull request workflow, and the release process.
|
|
235
293
|
|
|
236
294
|
## License
|
|
237
295
|
|