@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/src/cli.mjs
CHANGED
|
@@ -36,8 +36,8 @@ import {
|
|
|
36
36
|
const PACKAGE_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
37
37
|
|
|
38
38
|
const COMMANDS = [
|
|
39
|
-
["
|
|
40
|
-
["
|
|
39
|
+
["present", "Open presenter view and launch the audience view from it."],
|
|
40
|
+
["preview", "Serve a deck on loopback and open it in a browser window."],
|
|
41
41
|
["validate", "Check deck structure, Architecture DSL blocks, and themes."],
|
|
42
42
|
["inspect", "Report 1280x720 clipping diagnostics for a deck."],
|
|
43
43
|
["capture", "Write 1280x720 PNG files for selected or clipped slides."],
|
|
@@ -59,8 +59,8 @@ const GLOBAL_OPTIONS = {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
const COMMAND_OPTIONS = {
|
|
62
|
-
presentation: { watch: { type: "boolean" }, "no-open": { type: "boolean" } },
|
|
63
62
|
present: { watch: { type: "boolean" }, "no-open": { type: "boolean" } },
|
|
63
|
+
preview: { watch: { type: "boolean" }, "no-open": { type: "boolean" } },
|
|
64
64
|
validate: {},
|
|
65
65
|
inspect: { slide: { type: "string" }, all: { type: "boolean" }, "fail-on-issues": { type: "boolean" } },
|
|
66
66
|
capture: { pages: { type: "string" }, output: { type: "string" } },
|
|
@@ -103,8 +103,8 @@ function usage(command) {
|
|
|
103
103
|
return lines.join("\n");
|
|
104
104
|
}
|
|
105
105
|
const help = {
|
|
106
|
-
|
|
107
|
-
"Usage: markdstage
|
|
106
|
+
present: [
|
|
107
|
+
"Usage: markdstage present <file.md> [options]",
|
|
108
108
|
"",
|
|
109
109
|
"Opens presenter view with the current slide, next-slide preview, and speaker notes.",
|
|
110
110
|
"Use Start presentation in that view to open the synchronized audience window.",
|
|
@@ -114,16 +114,16 @@ function usage(command) {
|
|
|
114
114
|
"",
|
|
115
115
|
"Presentation requires an installed Microsoft Edge, Google Chrome, or Chromium.",
|
|
116
116
|
],
|
|
117
|
-
|
|
118
|
-
"Usage: markdstage
|
|
117
|
+
preview: [
|
|
118
|
+
"Usage: markdstage preview <file.md> [options]",
|
|
119
119
|
"",
|
|
120
120
|
" --watch Reload on save and enable Architecture editing.",
|
|
121
121
|
" --no-open Serve the deck without launching a browser.",
|
|
122
122
|
"",
|
|
123
|
-
"Without --watch,
|
|
123
|
+
"Without --watch, preview is read-only. Watch mode starts in normal viewing mode;",
|
|
124
124
|
"use the pencil control to edit Architecture diagrams and open the detailed designer.",
|
|
125
125
|
"",
|
|
126
|
-
"
|
|
126
|
+
"Preview requires an installed Microsoft Edge, Google Chrome, or Chromium.",
|
|
127
127
|
],
|
|
128
128
|
validate: [
|
|
129
129
|
"Usage: markdstage validate <file.md> [--json]",
|
|
@@ -262,8 +262,8 @@ export async function run(argv, io = {}) {
|
|
|
262
262
|
|
|
263
263
|
try {
|
|
264
264
|
switch (command) {
|
|
265
|
-
case "
|
|
266
|
-
const file = requireFile(positionals, "
|
|
265
|
+
case "preview": {
|
|
266
|
+
const file = requireFile(positionals, "preview");
|
|
267
267
|
const report = await presentCommand(
|
|
268
268
|
{ ...deckOptions(file, values), watch: values.watch, open: !values["no-open"], until: io.until },
|
|
269
269
|
{
|
|
@@ -277,8 +277,8 @@ export async function run(argv, io = {}) {
|
|
|
277
277
|
if (values.json) json(report);
|
|
278
278
|
return EXIT_OK;
|
|
279
279
|
}
|
|
280
|
-
case "
|
|
281
|
-
const file = requireFile(positionals, "
|
|
280
|
+
case "present": {
|
|
281
|
+
const file = requireFile(positionals, "present");
|
|
282
282
|
const report = await presentCommand(
|
|
283
283
|
{
|
|
284
284
|
...deckOptions(file, values),
|
package/src/commands/present.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Shared server for the markdstage preview and present commands.
|
|
2
2
|
|
|
3
3
|
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
4
4
|
import { join, resolve } from "node:path";
|
|
@@ -139,7 +139,9 @@ export async function presentCommand(options, io) {
|
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
io.print(
|
|
142
|
+
io.print(
|
|
143
|
+
`MarkdStage is ${options.presenterView ? "presenting" : "previewing"} ${session.sourceName || session.file}`,
|
|
144
|
+
);
|
|
143
145
|
io.print(` slides: ${session.slides.length}`);
|
|
144
146
|
io.print(` theme: ${session.theme}`);
|
|
145
147
|
io.print(` workspace: ${resolve(session.workspaceRoot)}`);
|
package/src/skills.mjs
CHANGED
|
@@ -78,7 +78,7 @@ what the MarkdStage canvas and MarkdStage Desktop render.
|
|
|
78
78
|
\`references/slide-format.md\`).
|
|
79
79
|
4. Validate structure, themes, and Architecture DSL before visual review:
|
|
80
80
|
\`markdstage validate slides.md --json\`.
|
|
81
|
-
5. Use \`markdstage
|
|
81
|
+
5. Use \`markdstage preview slides.md --watch\` for live source-backed authoring.
|
|
82
82
|
It reloads on save without losing the current slide and keeps the last valid
|
|
83
83
|
deck while a save is incomplete.
|
|
84
84
|
6. Check fixed 16:9 output with \`markdstage inspect slides.md --json\`. Use
|
|
@@ -88,14 +88,14 @@ what the MarkdStage canvas and MarkdStage Desktop render.
|
|
|
88
88
|
whose balance, spacing, or diagrams need visual judgment.
|
|
89
89
|
8. Revise Markdown and repeat validation plus targeted inspection until the deck
|
|
90
90
|
is valid, unclipped, concise, and visually balanced.
|
|
91
|
-
9. Deliver from the same source with \`markdstage
|
|
91
|
+
9. Deliver from the same source with \`markdstage present slides.md\`,
|
|
92
92
|
\`markdstage export slides.md --output slides.pdf\`, or
|
|
93
93
|
\`markdstage export slides.md --output slides.pptx\`.
|
|
94
94
|
|
|
95
|
-
The browser in \`
|
|
95
|
+
The browser in \`preview --watch\` starts in viewing mode. The user can activate
|
|
96
96
|
the pencil control to move Architecture elements, then choose **Advanced edit**
|
|
97
97
|
for the detailed designer. Placement changes save immediately, while the
|
|
98
|
-
detailed designer saves only when the user selects **Save**. \`
|
|
98
|
+
detailed designer saves only when the user selects **Save**. \`preview\` without
|
|
99
99
|
\`--watch\` is read-only.
|
|
100
100
|
|
|
101
101
|
Never hand-write HTML or CSS for a slide. Fix layout problems by shortening the
|
|
@@ -106,8 +106,8 @@ and layout diagnostics over capturing every slide.
|
|
|
106
106
|
|
|
107
107
|
| Command | Purpose |
|
|
108
108
|
| --- | --- |
|
|
109
|
-
| \`markdstage
|
|
110
|
-
| \`markdstage
|
|
109
|
+
| \`markdstage present <file> [--watch]\` | Open presenter view with the current slide, next-slide preview, speaker notes, and controls for a synchronized audience window. |
|
|
110
|
+
| \`markdstage preview <file> [--watch]\` | Serve the deck on loopback and open it in a browser window. \`--watch\` reloads on save, keeps the current slide, and enables Architecture placement and detailed editing. Without it, the source is read-only. |
|
|
111
111
|
| \`markdstage validate <file> [--json]\` | Check deck structure, Architecture DSL blocks, and themes. |
|
|
112
112
|
| \`markdstage inspect <file> [--json]\` | Report 1280x720 clipping diagnostics for the deck or one slide; use \`--fail-on-issues\` for quality gates. |
|
|
113
113
|
| \`markdstage capture <file> [--pages 2,4]\` | Write 1280x720 PNG files; without \`--pages\` only clipped slides are captured. |
|