@entropicwarrior/sdoc 0.1.3 → 0.1.5
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/knowledge.js +2 -0
- package/lexica/sdoc-authoring.sdoc +445 -0
- package/lexica/slide-authoring.sdoc +411 -0
- package/lexica/specification.sdoc +779 -0
- package/package.json +5 -2
- package/src/slide-pdf.js +99 -0
- package/src/slide-renderer.js +344 -0
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
# SDOC Slide Authoring Guide @slide-authoring
|
|
2
|
+
{
|
|
3
|
+
# Meta @meta
|
|
4
|
+
{
|
|
5
|
+
type: skill
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
# About @about
|
|
9
|
+
{
|
|
10
|
+
How to create HTML presentation slides from SDOC files. Covers the slide
|
|
11
|
+
deck structure, available layouts (center, two-column), speaker notes,
|
|
12
|
+
theme system, and CLI usage. Read the Quick Reference for everyday
|
|
13
|
+
authoring. Read the Full Example for a complete deck template.
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
# Quick Reference @quick-reference
|
|
17
|
+
{
|
|
18
|
+
A slide deck is an SDOC file where each top-level scope becomes one
|
|
19
|
+
slide. Set \`type: slides\` in the \`@meta\` section.
|
|
20
|
+
|
|
21
|
+
# Minimal Deck @minimal
|
|
22
|
+
{
|
|
23
|
+
```
|
|
24
|
+
# My Presentation {
|
|
25
|
+
@meta {
|
|
26
|
+
type: slides
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
# Title Slide {
|
|
30
|
+
config: center
|
|
31
|
+
|
|
32
|
+
Welcome to the presentation.
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
# Content Slide {
|
|
36
|
+
Key points:
|
|
37
|
+
|
|
38
|
+
{[.]
|
|
39
|
+
- First point
|
|
40
|
+
- Second point
|
|
41
|
+
- Third point
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
# Building Slides @building
|
|
49
|
+
{
|
|
50
|
+
Use the CLI tool:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
node tools/build-slides.js deck.sdoc
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
This produces \`deck.html\` — a self-contained HTML file. Open it
|
|
57
|
+
in any browser. Navigate with arrow keys or swipe on touch devices.
|
|
58
|
+
|
|
59
|
+
To specify output path:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
node tools/build-slides.js deck.sdoc -o output.html
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
To export as PDF:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
node tools/build-slides.js deck.sdoc --pdf
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
This produces \`deck.pdf\` using headless Chrome in 16:9 landscape
|
|
72
|
+
format. Each slide becomes one page. Requires Chrome or Chromium
|
|
73
|
+
installed on the system.
|
|
74
|
+
|
|
75
|
+
To use a custom theme:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
node tools/build-slides.js deck.sdoc --theme path/to/theme
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Flags can be combined:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
node tools/build-slides.js deck.sdoc --pdf --theme path/to/theme -o presentation.pdf
|
|
85
|
+
```
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
# Slide Properties @properties
|
|
89
|
+
{
|
|
90
|
+
Add \`config:\` lines at the top of a slide scope (before content)
|
|
91
|
+
to control layout:
|
|
92
|
+
|
|
93
|
+
\`config: center\` — centres content vertically and horizontally.
|
|
94
|
+
Use for title slides, section dividers, and closing slides.
|
|
95
|
+
|
|
96
|
+
\`config: two-column\` — child scopes become side-by-side columns.
|
|
97
|
+
Use for comparisons, before/after, pros/cons.
|
|
98
|
+
|
|
99
|
+
No config line means default layout: left-aligned, top-to-bottom.
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
# Speaker Notes @notes
|
|
103
|
+
{
|
|
104
|
+
Add a child scope with id \`notes\` inside any slide. Notes are
|
|
105
|
+
hidden in the output but present in the HTML.
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
# My Slide {
|
|
109
|
+
Visible content.
|
|
110
|
+
|
|
111
|
+
# Notes @notes {
|
|
112
|
+
Only the presenter sees this.
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
# Slide Structure @structure
|
|
120
|
+
{
|
|
121
|
+
# Document Root @root
|
|
122
|
+
{
|
|
123
|
+
The outermost scope is the document wrapper. Its title is used as
|
|
124
|
+
the HTML page title (unless overridden by \`title:\` in \`@meta\`).
|
|
125
|
+
Every child scope of the root becomes one slide.
|
|
126
|
+
|
|
127
|
+
The \`@meta\` scope is extracted and never rendered as a slide.
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
# Meta Properties @meta-properties
|
|
131
|
+
{
|
|
132
|
+
Supported properties in \`@meta\` (separate each with a blank line):
|
|
133
|
+
|
|
134
|
+
\`type: slides\` — identifies this file as a slide deck.
|
|
135
|
+
|
|
136
|
+
\`title: Presentation Title\` — sets the HTML page title.
|
|
137
|
+
|
|
138
|
+
\`company: Name\` — company name, shown in the bottom-left of
|
|
139
|
+
every slide.
|
|
140
|
+
|
|
141
|
+
\`confidential: true\` — adds a confidentiality notice across
|
|
142
|
+
the bottom of every slide. Uses the \`company\` name if set.
|
|
143
|
+
Use \`confidential: Custom Entity\` to override with a specific
|
|
144
|
+
entity name.
|
|
145
|
+
|
|
146
|
+
\`theme: company\` — names the intended theme (informational;
|
|
147
|
+
the actual theme is selected via the \`--theme\` CLI flag).
|
|
148
|
+
|
|
149
|
+
\`author: Name\` — author name (metadata only).
|
|
150
|
+
|
|
151
|
+
\`date: 2026-02-20\` — date (metadata only).
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
# What Maps to What @mapping
|
|
155
|
+
{
|
|
156
|
+
{[table]
|
|
157
|
+
SDOC Construct | HTML Output
|
|
158
|
+
Top-level scope | Slide (\`<div class="slide">\`)
|
|
159
|
+
Scope heading | Slide title (\`<h2>\`)
|
|
160
|
+
Paragraph | \`<p>\`
|
|
161
|
+
\`{[.]}\` bullet list | \`<ul>\`
|
|
162
|
+
\`{[#]}\` numbered list | \`<ol>\`
|
|
163
|
+
\`{[table]}\` | \`<table>\`
|
|
164
|
+
Code fence | \`<pre><code>\`
|
|
165
|
+
Mermaid code fence | \`<pre class="mermaid">\` (rendered as SVG)
|
|
166
|
+
\`**bold**\` | \`<strong>\`
|
|
167
|
+
\`*italic*\` | \`<em>\`
|
|
168
|
+
\`\\\`code\\\`\` | \`<code>\`
|
|
169
|
+
\`[text](url)\` | \`<a>\`
|
|
170
|
+
\`\` / \`\` | \`<img>\` (with optional width/alignment)
|
|
171
|
+
Nested scope | \`<section>\` within the slide
|
|
172
|
+
\`@notes\` child | Hidden \`<aside class="notes">\`
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
# Layouts @layouts
|
|
178
|
+
{
|
|
179
|
+
# Default Layout @default-layout
|
|
180
|
+
{
|
|
181
|
+
No \`config:\` line needed. Content flows top-to-bottom,
|
|
182
|
+
left-aligned. Good for most content slides.
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
# Regular Slide {
|
|
186
|
+
A paragraph of text.
|
|
187
|
+
|
|
188
|
+
{[.]
|
|
189
|
+
- A bullet list
|
|
190
|
+
- With items
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
# Center Layout @center-layout
|
|
197
|
+
{
|
|
198
|
+
Use \`config: center\` for title slides, section dividers,
|
|
199
|
+
and closing slides.
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
# Welcome {
|
|
203
|
+
config: center
|
|
204
|
+
|
|
205
|
+
My Presentation Title
|
|
206
|
+
|
|
207
|
+
A subtitle or tagline.
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
# Two-Column Layout @two-column-layout
|
|
213
|
+
{
|
|
214
|
+
Use \`config: two-column\`. Child scopes become columns.
|
|
215
|
+
Good for comparisons, before/after, side-by-side content.
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
# Comparison {
|
|
219
|
+
config: two-column
|
|
220
|
+
|
|
221
|
+
# Before {
|
|
222
|
+
Manual HTML slides.
|
|
223
|
+
|
|
224
|
+
Tedious and inconsistent.
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
# After {
|
|
228
|
+
Write SDOC, get slides.
|
|
229
|
+
|
|
230
|
+
Fast and branded.
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Any content before the child scopes appears above the columns.
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
# Theme System @themes
|
|
240
|
+
{
|
|
241
|
+
Themes control the visual appearance of slides. A theme is a directory
|
|
242
|
+
containing:
|
|
243
|
+
|
|
244
|
+
\`theme.css\` — all visual styling (typography, colours, spacing, layouts).
|
|
245
|
+
|
|
246
|
+
\`theme.js\` (optional) — runtime behaviour (keyboard nav, touch support,
|
|
247
|
+
slide counter). The built-in default theme includes this.
|
|
248
|
+
|
|
249
|
+
# Built-in Default Theme @default-theme
|
|
250
|
+
{
|
|
251
|
+
Used when no \`--theme\` flag is provided. Clean, minimal styling
|
|
252
|
+
with keyboard navigation and touch swipe support.
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
# Custom Themes @custom-themes
|
|
256
|
+
{
|
|
257
|
+
Create a directory with \`theme.css\` and optionally \`theme.js\`,
|
|
258
|
+
then pass it via the CLI:
|
|
259
|
+
|
|
260
|
+
```
|
|
261
|
+
--theme path/to/your/theme
|
|
262
|
+
```
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
# Navigation Controls @navigation
|
|
266
|
+
{
|
|
267
|
+
All themes include these controls by default:
|
|
268
|
+
|
|
269
|
+
Arrow right or Space — next slide.
|
|
270
|
+
|
|
271
|
+
Arrow left — previous slide.
|
|
272
|
+
|
|
273
|
+
Home — first slide.
|
|
274
|
+
|
|
275
|
+
End — last slide.
|
|
276
|
+
|
|
277
|
+
Touch swipe left/right on mobile devices.
|
|
278
|
+
|
|
279
|
+
Slide counter shown in the bottom-right corner.
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
# Full Example @full-example
|
|
284
|
+
{
|
|
285
|
+
A complete slide deck demonstrating all features:
|
|
286
|
+
|
|
287
|
+
````
|
|
288
|
+
# Product Update — Q1 2026 {
|
|
289
|
+
@meta {
|
|
290
|
+
type: slides
|
|
291
|
+
|
|
292
|
+
title: Product Update Q1 2026
|
|
293
|
+
|
|
294
|
+
author: Team Lead
|
|
295
|
+
|
|
296
|
+
date: 2026-03-15
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
# Product Update {
|
|
300
|
+
config: center
|
|
301
|
+
|
|
302
|
+
Q1 2026
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
# What We Shipped {
|
|
306
|
+
Key deliverables this quarter:
|
|
307
|
+
|
|
308
|
+
{[.]
|
|
309
|
+
- New authentication system
|
|
310
|
+
- Dashboard redesign
|
|
311
|
+
- API v2 launch
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
# Notes @notes {
|
|
315
|
+
Mention the 40% performance improvement.
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
# Metrics {
|
|
320
|
+
{[table]
|
|
321
|
+
Metric | Q4 2025 | Q1 2026
|
|
322
|
+
Users | 12,000 | 18,500
|
|
323
|
+
API calls/day | 1.2M | 2.1M
|
|
324
|
+
Uptime | 99.9% | 99.95%
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
# Before and After {
|
|
329
|
+
config: two-column
|
|
330
|
+
|
|
331
|
+
# Before {
|
|
332
|
+
Manual deployments.
|
|
333
|
+
|
|
334
|
+
2-hour release cycles.
|
|
335
|
+
|
|
336
|
+
Frequent rollbacks.
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
# After {
|
|
340
|
+
Automated CI/CD.
|
|
341
|
+
|
|
342
|
+
15-minute releases.
|
|
343
|
+
|
|
344
|
+
Zero rollbacks this quarter.
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
# Architecture {
|
|
349
|
+
The new system:
|
|
350
|
+
|
|
351
|
+
```mermaid
|
|
352
|
+
graph LR
|
|
353
|
+
Client --> Gateway[API Gateway]
|
|
354
|
+
Gateway --> Auth[Auth Service]
|
|
355
|
+
Gateway --> Core[Core Service]
|
|
356
|
+
Gateway --> Analytics
|
|
357
|
+
```
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
# What's Next {
|
|
361
|
+
Q2 priorities:
|
|
362
|
+
|
|
363
|
+
{[#]
|
|
364
|
+
- Mobile app launch
|
|
365
|
+
- Internationalisation
|
|
366
|
+
- Enterprise SSO
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
# Thank You {
|
|
371
|
+
config: center
|
|
372
|
+
|
|
373
|
+
Questions?
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
````
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
# Common Mistakes @common-mistakes
|
|
380
|
+
{
|
|
381
|
+
**Forgetting blank lines between meta properties.** SDOC joins
|
|
382
|
+
consecutive lines into a single paragraph. Put a blank line between
|
|
383
|
+
each \`key: value\` pair in \`@meta\`:
|
|
384
|
+
|
|
385
|
+
```
|
|
386
|
+
# Wrong — these become one paragraph:
|
|
387
|
+
@meta {
|
|
388
|
+
type: slides
|
|
389
|
+
title: My Deck
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
# Correct:
|
|
393
|
+
@meta {
|
|
394
|
+
type: slides
|
|
395
|
+
|
|
396
|
+
title: My Deck
|
|
397
|
+
}
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
**Putting config after content.** The \`config:\` line must appear
|
|
401
|
+
before any content in the slide scope. If it appears after a paragraph,
|
|
402
|
+
it will be rendered as regular text.
|
|
403
|
+
|
|
404
|
+
**Using config on the document root.** \`config:\` only works on slide
|
|
405
|
+
scopes (direct children of the root), not on the root itself.
|
|
406
|
+
|
|
407
|
+
**Forgetting the @notes id.** Speaker notes require the \`@notes\` id
|
|
408
|
+
on the child scope heading. Without it, the scope renders as a visible
|
|
409
|
+
section.
|
|
410
|
+
}
|
|
411
|
+
}
|