@markdstage/markdstage 2.6.0 → 3.1.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/README.md +6 -6
- package/package.json +1 -1
- package/shared/README.md +54 -20
- package/shared/markdstage-guide.mjs +8 -2
- package/shared/renderer/renderer.js +713 -64
- package/shared/renderer/slides.css +33 -0
- package/shared/runtime/browser.mjs +127 -111
- package/shared/runtime/output.mjs +237 -55
- package/shared/runtime/pptx-package.mjs +404 -67
- package/src/cli.mjs +13 -13
- package/src/commands/present.mjs +4 -2
- package/src/skills.mjs +6 -6
package/README.md
CHANGED
|
@@ -16,8 +16,8 @@ exported PDF, or hybrid editable PowerPoint deck.
|
|
|
16
16
|
## Install
|
|
17
17
|
|
|
18
18
|
```console
|
|
19
|
-
npx @markdstage/markdstage presentation slides.md
|
|
20
19
|
npx @markdstage/markdstage present slides.md
|
|
20
|
+
npx @markdstage/markdstage preview slides.md
|
|
21
21
|
npm install --global @markdstage/markdstage
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -31,8 +31,8 @@ npm install --global .\markdstage-markdstage-<version>.tgz
|
|
|
31
31
|
## Commands
|
|
32
32
|
|
|
33
33
|
```console
|
|
34
|
-
markdstage
|
|
35
|
-
markdstage
|
|
34
|
+
markdstage present slides.md
|
|
35
|
+
markdstage preview slides.md --watch
|
|
36
36
|
markdstage validate slides.md --json
|
|
37
37
|
markdstage inspect slides.md --json
|
|
38
38
|
markdstage capture slides.md --pages 2,4
|
|
@@ -45,8 +45,8 @@ markdstage skill install --target claude
|
|
|
45
45
|
|
|
46
46
|
| Command | Description |
|
|
47
47
|
| --- | --- |
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
48
|
+
| `present` | Opens the presenter view with the current slide, next-slide preview, speaker notes, and navigation. Select **Start presentation** to open the synchronized audience-facing window; select **End presentation** to close it. `--watch` reloads on save, and `--no-open` serves the presenter URL without launching a browser. |
|
|
49
|
+
| `preview` | Serves the deck on loopback and opens the MarkdStage preview: navigation, presenter view, next-slide preview, speaker notes, overview, custom themes, Mermaid, Architecture DSL, and local assets. `--watch` reloads on save while preserving the current slide, keeps the last valid deck when a save is broken, and enables Architecture editing. Without `--watch`, the source is read-only. `--no-open` serves the deck only. |
|
|
50
50
|
| `validate` | Checks deck structure, Architecture DSL blocks, themes, and theme paths. |
|
|
51
51
|
| `inspect` | Reports the same compact 1280x720 clipping diagnostics as the canvas `inspect_layout` action. `--slide <n>` limits it to one page, `--all` includes slides that fit, `--fail-on-issues` exits with code 5. |
|
|
52
52
|
| `capture` | Writes 1280x720 PNG files. Without `--pages` only the slides reported as clipped are captured. |
|
|
@@ -60,7 +60,7 @@ Global options: `--workspace <dir>`, `--theme <name>`, `--theme-file <path>`,
|
|
|
60
60
|
|
|
61
61
|
## Architecture editing
|
|
62
62
|
|
|
63
|
-
Run `markdstage
|
|
63
|
+
Run `markdstage preview slides.md --watch` for the live authoring workflow. The
|
|
64
64
|
browser starts in viewing mode. Select the pencil control to move Architecture
|
|
65
65
|
elements; those placement changes are saved atomically to the matching
|
|
66
66
|
`architecture` fence. Select **Advanced edit** to add, update, duplicate,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markdstage/markdstage",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Present, validate, inspect, capture, and export MarkdStage Markdown decks from the command line — no Copilot canvas required.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "runceel",
|
package/shared/README.md
CHANGED
|
@@ -93,11 +93,18 @@ The themed slide is displayed and updates automatically
|
|
|
93
93
|
produces a 16:9 PDF with backgrounds, images, highlighted code, and Mermaid.
|
|
94
94
|
- **Hybrid editable PowerPoint export is available from More controls > Export
|
|
95
95
|
PowerPoint.** It
|
|
96
|
-
preserves supported text, lists, links, tables,
|
|
97
|
-
DSL objects as native PowerPoint content.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
preserves supported text, lists, links, tables, fenced code blocks, raster
|
|
97
|
+
images, and Architecture DSL objects as native PowerPoint content. Code blocks
|
|
98
|
+
retain editable syntax-colored runs, whitespace, monospace typography, and
|
|
99
|
+
block decoration; unsupported effects such as shadows remain cropped fallback
|
|
100
|
+
pictures. Architecture nodes, groups, and connector-label pills are visible
|
|
101
|
+
AutoShapes with integrated text; icons use a transparent foreground picture
|
|
102
|
+
layer. Supported SVG files remain individual pictures. Mermaid, shadows, and
|
|
103
|
+
other unsupported styling stay visible as cropped, positioned fallback
|
|
104
|
+
pictures and are listed in the export report. Each theme used in the deck gets
|
|
105
|
+
its own slide master with named `title`, `default`, `center`, `section`, and
|
|
106
|
+
`backcover` layouts. Common backgrounds and top bars are stored in layout
|
|
107
|
+
artwork; supported cover logos are separate layout pictures. Speaker
|
|
101
108
|
notes are converted from Markdown to readable plain text in the corresponding
|
|
102
109
|
PowerPoint notes pane. AI may call `export_pptx` with another
|
|
103
110
|
workspace-confined `.pptx` path.
|
|
@@ -207,10 +214,31 @@ When the extension detects a presentation-related prompt, it adds a short hint
|
|
|
207
214
|
to use `markdstage_guide` at most once per session. No hint is added after the
|
|
208
215
|
tool has already been called, and session-end cleanup removes the state.
|
|
209
216
|
|
|
210
|
-
###
|
|
217
|
+
### Markdown file syntax
|
|
211
218
|
|
|
212
|
-
|
|
213
|
-
|
|
219
|
+
A Markdown file represents the complete deck. At the top level, a line containing
|
|
220
|
+
only `---` after a blank line separates slides. A leading `---` block is file
|
|
221
|
+
front matter, and `---` inside a fenced code block is not a separator.
|
|
222
|
+
|
|
223
|
+
Use only the top-level `---` syntax for slide boundaries. Custom markers such as
|
|
224
|
+
`<!-- slide -->` are not slide separators and must not be used.
|
|
225
|
+
|
|
226
|
+
Do not place a top-level HTML comment immediately before a slide separator. End
|
|
227
|
+
the comment, leave a blank line, and then write `---`; without the blank line,
|
|
228
|
+
the separator may not be recognized as a slide boundary.
|
|
229
|
+
|
|
230
|
+
To have MarkdStage read and split a workspace Markdown file, use **More controls >
|
|
231
|
+
Open Markdown**. This file-loading workflow is separate from the Canvas API.
|
|
232
|
+
|
|
233
|
+
### Canvas API `slides` array
|
|
234
|
+
|
|
235
|
+
For canvas `open` and `load_deck`, each element of the `slides` array is exactly
|
|
236
|
+
one slide. The caller must read, split, or generate the deck before invoking the
|
|
237
|
+
Canvas API. Do not pass a complete multi-slide Markdown file as one array element
|
|
238
|
+
and expect its `---` lines to be split.
|
|
239
|
+
|
|
240
|
+
Each array element is one Markdown string. It may start with front matter
|
|
241
|
+
delimited by `---`, followed by GFM-compatible content.
|
|
214
242
|
|
|
215
243
|
| Front matter | Purpose |
|
|
216
244
|
| --- | --- |
|
|
@@ -245,14 +273,6 @@ First explain the **prerequisites**.
|
|
|
245
273
|
-->
|
|
246
274
|
```
|
|
247
275
|
|
|
248
|
-
Write local images as `` and pass the source
|
|
249
|
-
Markdown's workspace-relative path as `sourceName`. Lookup tries adjacent
|
|
250
|
-
`assets/` before workspace-root `assets/`. Architecture `icon` and `image.src`
|
|
251
|
-
use `assets/foo.svg` without a leading slash and follow the same lookup order.
|
|
252
|
-
`sourceName` supplies this resolution base only; it does not read or watch the
|
|
253
|
-
Markdown file.
|
|
254
|
-
Specifically, lookup checks `assets/` beside the Markdown before `assets/` at the workspace root.
|
|
255
|
-
|
|
256
276
|
On a standard slide, the first H1/H2 is fixed in the top title area, so its
|
|
257
277
|
position does not move with body length. Later headings remain in the body.
|
|
258
278
|
Specialized `title`, `section`, and `backcover` layouts retain their own
|
|
@@ -287,6 +307,20 @@ layout: section
|
|
|
287
307
|
## Key GitHub Copilot features
|
|
288
308
|
```
|
|
289
309
|
|
|
310
|
+
### `sourceName` role
|
|
311
|
+
|
|
312
|
+
`sourceName` is workspace-relative metadata used to resolve adjacent themes and
|
|
313
|
+
images and to derive output filenames. It does not read, parse, split, or watch
|
|
314
|
+
Markdown content. Passing `sourceName` does not load a deck; non-empty canvas
|
|
315
|
+
input must still include the complete `slides` array.
|
|
316
|
+
|
|
317
|
+
To have MarkdStage load a Markdown file, use **More controls > Open Markdown**.
|
|
318
|
+
|
|
319
|
+
Write local images as ``. With `sourceName`,
|
|
320
|
+
lookup tries `assets/` beside the Markdown before workspace-root `assets/`.
|
|
321
|
+
Architecture `icon` and `image.src` use `assets/foo.svg` without a leading slash
|
|
322
|
+
and follow the same lookup order.
|
|
323
|
+
|
|
290
324
|
### Choosing a theme
|
|
291
325
|
|
|
292
326
|
Set the deck-wide `theme`; use `dark` when omitted.
|
|
@@ -745,8 +779,8 @@ Architecture diagrams can be moved directly over the rendered result. For decks
|
|
|
745
779
|
imported through **More controls > Open Markdown**, edits write back to the source `architecture` fence and
|
|
746
780
|
survive re-import. Decks supplied directly through open / `load_deck` cannot be
|
|
747
781
|
reversibly mapped to a source file, so they save only to canvas deck state.
|
|
748
|
-
In the standalone CLI, `markdstage
|
|
749
|
-
source-backed editing workflow; `
|
|
782
|
+
In the standalone CLI, `markdstage preview slides.md --watch` enables the same
|
|
783
|
+
source-backed editing workflow; `preview` without `--watch` is read-only.
|
|
750
784
|
|
|
751
785
|
**Placement editing is a stable part of Architecture DSL v1.**
|
|
752
786
|
|
|
@@ -837,7 +871,7 @@ blocks.
|
|
|
837
871
|
For a source-backed deck imported through **More controls > Open Markdown**,
|
|
838
872
|
**Shape editing** opens this editor directly. If the slide contains multiple
|
|
839
873
|
Architecture blocks, select one from the accessible picker first. CLI
|
|
840
|
-
`
|
|
874
|
+
`preview --watch` opens the same editor in a browser window. Agents can open
|
|
841
875
|
the editor canvas directly:
|
|
842
876
|
|
|
843
877
|
```json
|
|
@@ -968,7 +1002,7 @@ fails with `invalid_input`; pass the complete `slides` array or call
|
|
|
968
1002
|
| `inspect_layout` | `{ index?: number, includeFits?: boolean }`. Render the registered in-memory PDF snapshot with the fixed 1280×720 output layout; this does not inspect the source file on disk. Omit `index` for one preferred whole-deck inspection. Serialize targeted calls because PDF, layout, and PNG jobs are exclusive. By default, return only clipped pages; `includeFits` includes successful pages. Returns dimensions, issue counts, overflow measurements, nested scroll containers, and a bounded list of element hints. Requires Edge, Chrome, or Chromium. |
|
|
969
1003
|
| `capture_slides` | `{ indexes?: number[], outputDirectory?: string, theme?: "dark" | "light" | "microsoft" | "custom" }`. Generate PDF-equivalent 1280×720 PNGs for at most 10 zero-based indexes. When `indexes` is omitted, inspect the deck and capture only clipped pages. Paths stay inside the workspace; results contain paths and layout summaries, not image bytes. Requires Edge, Chrome, or Chromium. |
|
|
970
1004
|
| `export_pdf` | `{ outputPath?: string, theme?: "dark" | "light" | "microsoft" | "custom" }`. Export one 16:9 page per slide. Relative paths use workspace root; default is `markdstage.pdf`. Theme affects PDF only. Reject paths outside workspace and non-`.pdf` files. Temporary slide replacement and the automatic back cover are included. Returns `{ ok, path, total, theme, bytes }`. Requires Edge, Chrome, or Chromium. |
|
|
971
|
-
| `export_pptx` | `{ outputPath?: string, theme?: "dark" | "light" | "microsoft" | "custom" }`. Export a hybrid editable 16:9 PowerPoint deck. Supported text, lists, links, tables, raster images, and Architecture DSL objects remain native. Speaker-note Markdown is exported as readable plain text in the corresponding PowerPoint notes pane. Architecture nodes, groups, and connector-label pills are visible AutoShapes with integrated text; icons are foreground pictures. Mermaid and unsupported visuals become reported background fallbacks. Relative paths use workspace root; default is `markdstage.pptx`. Reject paths outside workspace and non-`.pptx` files. Temporary slide replacement and the automatic back cover are included. Returns `{ ok, path, total, theme, bytes, format, fallbackCount, fallbacks }`. Requires Edge, Chrome, or Chromium. |
|
|
1005
|
+
| `export_pptx` | `{ outputPath?: string, theme?: "dark" | "light" | "microsoft" | "custom" }`. Export a hybrid editable 16:9 PowerPoint deck. Supported text, lists, links, tables, fenced code blocks, raster images, and Architecture DSL objects remain native. Code blocks preserve syntax-colored editable runs, whitespace, monospace typography, and block decoration; unsupported effects such as shadows remain reported background fallbacks. Speaker-note Markdown is exported as readable plain text in the corresponding PowerPoint notes pane. Architecture nodes, groups, and connector-label pills are visible AutoShapes with integrated text; icons are foreground pictures. Mermaid and unsupported visuals become reported background fallbacks. Relative paths use workspace root; default is `markdstage.pptx`. Reject paths outside workspace and non-`.pptx` files. Temporary slide replacement and the automatic back cover are included. Returns `{ ok, path, total, theme, bytes, format, fallbackCount, fallbacks }`. Requires Edge, Chrome, or Chromium. |
|
|
972
1006
|
| `edit_architecture` | `{ enabled: boolean }`. Toggle placement editing. Imported decks also write to the source fence; direct decks write to canvas state. Presenter/print omit UI. Mode is not persisted and `reset` disables it. Returns `{ ok, enabled, version }`. |
|
|
973
1007
|
| `reset` | No input. Clear deck/slide state, disable editing, and return to the waiting view. |
|
|
974
1008
|
|
|
@@ -110,12 +110,18 @@ export async function readGuide(topic = "overview") {
|
|
|
110
110
|
section(readme, "## How it works"),
|
|
111
111
|
"",
|
|
112
112
|
"Users can load workspace Markdown directly with **More controls > Open Markdown** (deterministic splitting without AI; natural-language summarization remains the AI's responsibility). The workspace root is the Git repository root when available, otherwise the folder opened for the current session.",
|
|
113
|
-
"Use **More controls > Shape editing** to adjust the placement of an existing Architecture diagram. In the CLI, run `markdstage
|
|
113
|
+
"Use **More controls > Shape editing** to adjust the placement of an existing Architecture diagram. In the CLI, run `markdstage preview slides.md --watch`; it starts in viewing mode and enables the same placement editor plus the detailed Architecture designer. CLI `preview` without `--watch` is read-only. Comprehensive edits affect the source Markdown only when explicitly saved.",
|
|
114
114
|
"",
|
|
115
115
|
"For details, request `slide-format`, `themes`, `custom-themes`, `theme-schema`, `architecture-dsl`, or `architecture-schema`.",
|
|
116
116
|
].join("\n");
|
|
117
117
|
case "slide-format":
|
|
118
|
-
return
|
|
118
|
+
return [
|
|
119
|
+
section(readme, "### Markdown file syntax"),
|
|
120
|
+
"",
|
|
121
|
+
section(readme, "### Canvas API `slides` array"),
|
|
122
|
+
"",
|
|
123
|
+
section(readme, "### `sourceName` role"),
|
|
124
|
+
].join("\n");
|
|
119
125
|
case "themes":
|
|
120
126
|
return section(readme, "### Choosing a theme");
|
|
121
127
|
case "custom-themes":
|