sdocs-dev 1.15.0 → 1.19.2
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/bin/sdocs-dev.js +52 -17
- package/lib/agent-block.js +270 -50
- package/lib/agent-files.js +312 -74
- package/lib/cells-verify.js +1 -0
- package/lib/cloud-bindings.js +85 -0
- package/lib/cloud-commands.js +826 -0
- package/lib/cloud-credentials.js +380 -0
- package/lib/commands.js +46 -5
- package/lib/help-text.js +301 -70
- package/lib/io.js +53 -5
- package/lib/library-commands.js +6 -15
- package/lib/library-scan.js +16 -6
- package/lib/library-server.js +4 -12
- package/lib/setup.js +182 -191
- package/lib/short-link.js +38 -1
- package/lib/slides-verify.js +109 -0
- package/package.json +1 -1
- package/shared/sdocs-cells-formula.js +547 -73
- package/shared/sdocs-cells.js +164 -18
- package/shared/sdocs-shapes.js +1044 -0
- package/shared/sdocs-slide-resolve.js +258 -0
- package/shared/sdocs-slide-stdlib.js +180 -0
- package/shared/sdocs-styles.js +1 -1
package/lib/help-text.js
CHANGED
|
@@ -12,16 +12,23 @@ USAGE
|
|
|
12
12
|
sdoc <file> --style Open with style panel
|
|
13
13
|
sdoc <file> --raw Open raw markdown source
|
|
14
14
|
sdoc <file> --comment Open in comment mode (review/annotate)
|
|
15
|
+
sdoc <file> 12:"note" 24-28:"note"
|
|
16
|
+
Open a guided document walkthrough
|
|
15
17
|
sdoc bridge <file> Live editing session: edits autosave to disk,
|
|
16
18
|
external changes push to the page (see LIVE BRIDGE)
|
|
17
19
|
sdoc new New blank document (write mode)
|
|
18
20
|
sdoc share <file> Copy shareable link to clipboard
|
|
19
21
|
sdoc share <file> --section "X" Link with section anchor
|
|
20
22
|
sdoc share <file> --short Encrypted /s/<id> short link (see SHORT LINKS)
|
|
23
|
+
sdoc share <file> --short --source email-launch
|
|
24
|
+
Short link attributed to a named source
|
|
25
|
+
sdoc share <file> --short --source x --placement launch-reply-01
|
|
26
|
+
Social link attributed to one placement
|
|
21
27
|
sdoc schema Print the full styles schema
|
|
22
28
|
sdoc charts Chart types, options, and styling guide
|
|
23
29
|
sdoc diagrams Mermaid diagrams reference (\`\`\`mermaid blocks)
|
|
24
30
|
sdoc videos YouTube embed reference (\`\`\`video blocks)
|
|
31
|
+
sdoc apps Runnable HTML reference (\`\`\`sdoc-app blocks)
|
|
25
32
|
sdoc cells Inline spreadsheet reference (\`\`\`cells blocks)
|
|
26
33
|
sdoc code Syntax highlighting + code-viewer reference
|
|
27
34
|
sdoc app.rb / server.js / ... Open a source file as a highlighted listing
|
|
@@ -35,16 +42,27 @@ USAGE
|
|
|
35
42
|
sdoc slides list Built-in slide template registry + slot names
|
|
36
43
|
sdoc slides icons [query] Lucide icon names available to the \`icon\` shape kind
|
|
37
44
|
sdoc slides custom-shapes Raw-shape primitives + design principles reference
|
|
45
|
+
sdoc slides verify <file> Validate slide syntax and geometry without a browser
|
|
46
|
+
sdoc slides verify <file> --json Machine-readable validation output for agents
|
|
38
47
|
sdoc present <file> Open <file> and jump straight into fullscreen slides
|
|
39
48
|
sdoc library Open the personal markdown library at smalldocs.org/library
|
|
40
49
|
sdoc library ls List markdown indexed in this project (walks up to .git)
|
|
41
50
|
sdoc library ls --tags Tag bag (tag - count) for this project
|
|
42
51
|
sdoc library --help Full library reference - commands, tagging, rescue, autostart
|
|
52
|
+
sdoc cloud login Sign this CLI into SmallDocs Cloud once
|
|
53
|
+
sdoc cloud status --json Check the connected Cloud account
|
|
54
|
+
sdoc cloud ls List Cloud documents
|
|
55
|
+
sdoc cloud search "query" Search Cloud documents
|
|
56
|
+
sdoc cloud create file.md Add a document to Cloud
|
|
57
|
+
sdoc cloud --help Full Cloud command reference
|
|
43
58
|
sdoc <file> +tag1 +tag2 Inject tags into the file's front matter at open time
|
|
44
59
|
sdoc defaults Show ~/.sdocs/styles.yaml
|
|
45
60
|
sdoc defaults --reset Remove default styles
|
|
46
|
-
sdoc setup
|
|
47
|
-
sdoc
|
|
61
|
+
sdoc setup Install the SmallDocs skill for your coding agents
|
|
62
|
+
sdoc setup --cloud --yes Enable Cloud-first opens and install the Cloud skill
|
|
63
|
+
sdoc setup --cloud --account ID Use one Cloud account for automatic creates
|
|
64
|
+
sdoc setup --standard --yes Return to local-first behavior
|
|
65
|
+
sdoc refresh Refresh the SmallDocs skill to the current version
|
|
48
66
|
sdoc auto-update [on|off] Toggle auto-install of sdoc updates
|
|
49
67
|
sdoc upgrade Upgrade sdoc to the latest version now
|
|
50
68
|
sdoc safe Verify the SmallDocs server is running the published code
|
|
@@ -72,7 +90,12 @@ OPTIONS
|
|
|
72
90
|
--mode <m> Alias for --read / --write / --style / --raw / --comment
|
|
73
91
|
--short Use the encrypted /s/<id> short-URL form (share
|
|
74
92
|
subcommand only). See SHORT LINKS below.
|
|
75
|
-
--
|
|
93
|
+
--source <name> Attribute short-link visits to a source or campaign.
|
|
94
|
+
--placement <id> Attribute a social short link to one publishing
|
|
95
|
+
placement. Use 4-32 letters, numbers, underscores,
|
|
96
|
+
or hyphens with --source x, yt, or youtube.
|
|
97
|
+
--json Machine-readable output for safe and Cloud commands.
|
|
98
|
+
--no-open Do not launch the browser after a normal file open.
|
|
76
99
|
--audit Also print GitHub links to server-side source
|
|
77
100
|
files (safe subcommand only).
|
|
78
101
|
--keep-open feedback subcommand: keep the bridge alive across
|
|
@@ -86,6 +109,22 @@ OPTIONS
|
|
|
86
109
|
ENVIRONMENT
|
|
87
110
|
SDOCS_URL Fallback base URL if --url is not passed.
|
|
88
111
|
|
|
112
|
+
DOCUMENT WALKTHROUGHS
|
|
113
|
+
Add notes after a Markdown filename to guide a reader through the
|
|
114
|
+
rendered document:
|
|
115
|
+
|
|
116
|
+
sdoc report.md 12:"Start with the result" 24-28:"Compare these figures"
|
|
117
|
+
|
|
118
|
+
Each source line or range becomes a highlighted target followed by a
|
|
119
|
+
markdown note with Prev / Next controls. Steps follow command argument
|
|
120
|
+
order, not source order. A prose line highlights its matching rendered
|
|
121
|
+
text. A line inside an ordinary code fence highlights that code line
|
|
122
|
+
and places the note beneath it. A chart, diagram, sheet, slide, form,
|
|
123
|
+
math block, or video is highlighted as one complete rendered element.
|
|
124
|
+
|
|
125
|
+
The annotations ride in the URL and through sdoc share. The source file
|
|
126
|
+
is unchanged.
|
|
127
|
+
|
|
89
128
|
INTERACTIVE FEEDBACK (sdoc feedback)
|
|
90
129
|
An agent writes a fenced \`\`\`form block into a markdown file and runs
|
|
91
130
|
\`sdoc feedback file.md\`. The browser renders real form controls
|
|
@@ -146,7 +185,6 @@ LIBRARY (personal, on-machine index)
|
|
|
146
185
|
sdoc library Open the search UI.
|
|
147
186
|
sdoc library ls List indexed files in this project.
|
|
148
187
|
sdoc library ls --tags Tag bag (tag - count) for this project.
|
|
149
|
-
sdoc library rebuild Walk \$HOME and refresh every entry.
|
|
150
188
|
sdoc library status Show enabled/disabled + entry count.
|
|
151
189
|
sdoc library autostart Manage the macOS LaunchAgent.
|
|
152
190
|
|
|
@@ -176,6 +214,21 @@ SHORT LINKS (sdoc share --short)
|
|
|
176
214
|
|
|
177
215
|
\`--short\` produces a shorter, encrypted form: \`https://smalldocs.org/s/<id>#k=<key>\`.
|
|
178
216
|
|
|
217
|
+
Add any source name when publishing a link, for example
|
|
218
|
+
\`--source email-launch\`, \`--source product-hunt\`, or \`--source x\`.
|
|
219
|
+
This produces a URL such as
|
|
220
|
+
\`https://smalldocs.org/s/<id>?src=email-launch#k=<key>\`. The source appears
|
|
221
|
+
automatically at \`/analytics/sources\`; the visit still counts in the
|
|
222
|
+
ordinary visit and short-link totals.
|
|
223
|
+
|
|
224
|
+
Add \`--placement launch-reply-01\` to an X or YouTube source link
|
|
225
|
+
when the same document is published in more than one place. This produces
|
|
226
|
+
\`https://smalldocs.org/s/<id>?src=x&pid=launch-reply-01#k=<key>\`.
|
|
227
|
+
The placement id is public and identifies the post, reply, or comment where
|
|
228
|
+
the link was used. It does not identify a visitor. Only links with a valid
|
|
229
|
+
placement id appear in the targeted-placement table at
|
|
230
|
+
\`/analytics/sources?type=short\`.
|
|
231
|
+
|
|
179
232
|
How it works:
|
|
180
233
|
1. The CLI brotli-compresses the content, generates a 256-bit AES-GCM
|
|
181
234
|
key + 96-bit nonce locally, and encrypts the compressed bytes.
|
|
@@ -192,6 +245,8 @@ SHORT LINKS (sdoc share --short)
|
|
|
192
245
|
What the server can see:
|
|
193
246
|
- That a ciphertext blob was uploaded under id <id>.
|
|
194
247
|
- When it was fetched and from which IP (standard server logs).
|
|
248
|
+
- For an opted-in placement link, its source, public placement id, and
|
|
249
|
+
short-link id when a visit is counted.
|
|
195
250
|
What the server cannot see:
|
|
196
251
|
- The plaintext document. It does not have the key.
|
|
197
252
|
- The key. The key never leaves the URL fragment.
|
|
@@ -978,6 +1033,141 @@ SECURITY
|
|
|
978
1033
|
`;
|
|
979
1034
|
|
|
980
1035
|
|
|
1036
|
+
const APPS_HELP = `
|
|
1037
|
+
SmallDocs - Runnable HTML
|
|
1038
|
+
========================
|
|
1039
|
+
Run a self-contained HTML document inside Markdown using a \`\`\`sdoc-app
|
|
1040
|
+
fenced code block. The component appears inline and can expand to fill the
|
|
1041
|
+
browser window. Use this for interactive models, calculators, simulations,
|
|
1042
|
+
and other agent-authored browser tools.
|
|
1043
|
+
|
|
1044
|
+
BASIC SYNTAX
|
|
1045
|
+
\`\`\`sdoc-app
|
|
1046
|
+
<!doctype html>
|
|
1047
|
+
<html>
|
|
1048
|
+
<head>
|
|
1049
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
1050
|
+
<title>Counter</title>
|
|
1051
|
+
</head>
|
|
1052
|
+
<body>
|
|
1053
|
+
<button id="count">Count: 0</button>
|
|
1054
|
+
<script>
|
|
1055
|
+
let value = 0;
|
|
1056
|
+
const button = document.getElementById('count');
|
|
1057
|
+
button.onclick = () => button.textContent = 'Count: ' + (++value);
|
|
1058
|
+
</script>
|
|
1059
|
+
</body>
|
|
1060
|
+
</html>
|
|
1061
|
+
\`\`\`
|
|
1062
|
+
|
|
1063
|
+
AUTHORING
|
|
1064
|
+
- Put one complete HTML document in each block.
|
|
1065
|
+
- Use <title> to name the component in its toolbar and fullscreen view.
|
|
1066
|
+
- CSS, inline JavaScript, canvas, SVG, forms, and browser-native controls work.
|
|
1067
|
+
- Package required data and code in the document when the component should
|
|
1068
|
+
keep working without an external service.
|
|
1069
|
+
- An ordinary \`\`\`html fence remains a highlighted source listing.
|
|
1070
|
+
|
|
1071
|
+
INHERITED DESIGN
|
|
1072
|
+
Bare semantic HTML starts with the SmallDocs document's current typography,
|
|
1073
|
+
text and heading colours, background, accent, border, surface, spacing, and
|
|
1074
|
+
corner radius. Native controls receive the same font and a restrained base
|
|
1075
|
+
treatment. These values update when the document theme or styles change.
|
|
1076
|
+
|
|
1077
|
+
The defaults live in a low-priority CSS layer. Ordinary component CSS wins.
|
|
1078
|
+
Override individual values through these custom properties:
|
|
1079
|
+
|
|
1080
|
+
--sdoc-app-background --sdoc-app-surface
|
|
1081
|
+
--sdoc-app-color --sdoc-app-heading-color
|
|
1082
|
+
--sdoc-app-muted-color --sdoc-app-accent-color
|
|
1083
|
+
--sdoc-app-border-color --sdoc-app-font-family
|
|
1084
|
+
--sdoc-app-heading-font-family --sdoc-app-code-font-family
|
|
1085
|
+
--sdoc-app-font-size --sdoc-app-line-height
|
|
1086
|
+
--sdoc-app-heading-scale
|
|
1087
|
+
--sdoc-app-h1-size --sdoc-app-h2-size
|
|
1088
|
+
--sdoc-app-h3-size --sdoc-app-h1-weight
|
|
1089
|
+
--sdoc-app-h2-weight --sdoc-app-h3-weight
|
|
1090
|
+
--sdoc-app-radius --sdoc-app-block-spacing
|
|
1091
|
+
--sdoc-app-padding --sdoc-app-color-scheme
|
|
1092
|
+
|
|
1093
|
+
Example override:
|
|
1094
|
+
|
|
1095
|
+
:root { --sdoc-app-background: #101827; --sdoc-app-color: #f8fafc; }
|
|
1096
|
+
body { padding: 12px; }
|
|
1097
|
+
|
|
1098
|
+
Do not repeat a body reset, font stack, or page background when the inherited
|
|
1099
|
+
design is appropriate. Add CSS for the component's layout and intentional
|
|
1100
|
+
visual differences. The bundled Inter faces load inside the component.
|
|
1101
|
+
Load other webfonts inside the component when their exact face is required.
|
|
1102
|
+
|
|
1103
|
+
VISUAL DIRECTION
|
|
1104
|
+
Let the tool's purpose determine its layout. Start with semantic HTML and the
|
|
1105
|
+
inherited design, then add treatment where it clarifies hierarchy, grouping,
|
|
1106
|
+
state, or interaction.
|
|
1107
|
+
|
|
1108
|
+
- Try a clear page, list, table, or form before turning every region into a
|
|
1109
|
+
dashboard card. Use a canvas or stage when the interaction is spatial.
|
|
1110
|
+
Whitespace and dividers are often enough to structure repeated rows.
|
|
1111
|
+
For repeated records, try one list with border-bottom separators before
|
|
1112
|
+
wrapping every record in its own card.
|
|
1113
|
+
- Reserve a bordered or raised surface for content that needs to read as a
|
|
1114
|
+
separate group, selection, or interaction. Avoid stacking several levels
|
|
1115
|
+
of rounded containers only to create hierarchy.
|
|
1116
|
+
- Keep a consistent shape language and begin with the inherited radius.
|
|
1117
|
+
Pills suit compact statuses and category choices; ordinary actions and
|
|
1118
|
+
metrics do not need to become pills.
|
|
1119
|
+
- For an ordinary document tool, leave the inherited design tokens unchanged
|
|
1120
|
+
unless the brief calls for a distinct visual direction. Add semantic colour
|
|
1121
|
+
when it carries meaning. Gradients, glows, and shadows should support the
|
|
1122
|
+
subject or interaction rather than decorate empty space.
|
|
1123
|
+
- Accent rails, badges, uppercase eyebrows, and wide letter spacing are
|
|
1124
|
+
conspicuous patterns. Use them when they communicate something specific,
|
|
1125
|
+
not as automatic decoration. A title does not also need an eyebrow unless
|
|
1126
|
+
that label adds context the title does not contain.
|
|
1127
|
+
- Match density to the task. Repeated controls should read as efficient rows;
|
|
1128
|
+
the primary result or working area should receive the strongest emphasis.
|
|
1129
|
+
A few totals can often share one summary line or bar instead of separate
|
|
1130
|
+
metric cards.
|
|
1131
|
+
|
|
1132
|
+
SIZING AND RESPONSIVE LAYOUT
|
|
1133
|
+
The component owns its inline height. SmallDocs measures the complete
|
|
1134
|
+
document and follows that height without imposing a minimum or maximum. The
|
|
1135
|
+
frame width follows the SmallDocs reading column. Fullscreen uses the
|
|
1136
|
+
available browser viewport.
|
|
1137
|
+
|
|
1138
|
+
- Include a viewport meta tag in every component.
|
|
1139
|
+
- Let normal document flow determine height when content can grow.
|
|
1140
|
+
- Use the component's own CSS min-height, height, or aspect-ratio when an
|
|
1141
|
+
interactive canvas or stage needs a deliberate working area.
|
|
1142
|
+
- Avoid fixed page widths. Use fluid widths, grid or flex wrapping, media or
|
|
1143
|
+
container queries, and controls that remain usable at narrow widths.
|
|
1144
|
+
- Resize canvas and other measured graphics from their rendered container.
|
|
1145
|
+
ResizeObserver and the normal window resize event are available.
|
|
1146
|
+
- Check the component inline and fullscreen at both narrow and wide widths.
|
|
1147
|
+
|
|
1148
|
+
A concise inline height keeps the surrounding document easy to navigate.
|
|
1149
|
+
Dense tools can use more space or rely on the expand control. These are
|
|
1150
|
+
authoring choices rather than renderer limits.
|
|
1151
|
+
|
|
1152
|
+
VIEWING
|
|
1153
|
+
Expand opens the same running frame fullscreen, so its current inputs and
|
|
1154
|
+
JavaScript state remain in place. When a document has several components,
|
|
1155
|
+
Previous and Next move between them.
|
|
1156
|
+
|
|
1157
|
+
BROWSER BOUNDARY
|
|
1158
|
+
Component code runs in a sandboxed frame. It cannot read the SmallDocs page,
|
|
1159
|
+
browser storage for smalldocs.org, or account controls. Scripts can use forms,
|
|
1160
|
+
modals, downloads, and popups. Network requests still leave the browser and
|
|
1161
|
+
are subject to the destination's CORS rules, so a document can communicate
|
|
1162
|
+
with services that allow it.
|
|
1163
|
+
|
|
1164
|
+
FAILURE BEHAVIOUR
|
|
1165
|
+
If the runner cannot start or does not respond within 15 seconds, SmallDocs
|
|
1166
|
+
leaves the component source readable in an error panel. Re-rendering or
|
|
1167
|
+
destroying an SDK instance removes its frames and event listeners.
|
|
1168
|
+
`;
|
|
1169
|
+
|
|
1170
|
+
|
|
981
1171
|
const CELLS_HELP = `
|
|
982
1172
|
SmallDocs - Cells (sheets)
|
|
983
1173
|
======================
|
|
@@ -1018,27 +1208,40 @@ WRAPPING
|
|
|
1018
1208
|
text - markup never renders.
|
|
1019
1209
|
|
|
1020
1210
|
FORMATTING
|
|
1021
|
-
Numbers display with thousands separators and
|
|
1022
|
-
|
|
1211
|
+
Numbers display with thousands separators and up to two decimal places by
|
|
1212
|
+
default. Negatives are red. One or more leading format: lines can control a
|
|
1213
|
+
sheet, column, row, or individual cell:
|
|
1023
1214
|
|
|
1024
1215
|
\`\`\`cells
|
|
1025
|
-
format: A=plain B=$ C=%
|
|
1216
|
+
format: A=plain B=$ C=% C4=%.1
|
|
1026
1217
|
Year,Revenue,Margin
|
|
1027
1218
|
2024,12000,0.23
|
|
1028
1219
|
\`\`\`
|
|
1029
1220
|
|
|
1030
1221
|
Renders 2024 (plain - no comma), $12,000.00, 23%.
|
|
1031
1222
|
|
|
1032
|
-
|
|
1223
|
+
Targets use familiar sheet addresses:
|
|
1224
|
+
* whole sheet
|
|
1225
|
+
A column A
|
|
1226
|
+
4 row 4
|
|
1227
|
+
C4 cell C4
|
|
1228
|
+
|
|
1229
|
+
A cell overrides its row, a row overrides its column, and a column overrides
|
|
1230
|
+
the whole sheet. This makes \`format: B=$ B4=%\` a currency column with one
|
|
1231
|
+
percentage cell.
|
|
1232
|
+
|
|
1233
|
+
Format tokens:
|
|
1033
1234
|
$ / usd currency, e.g. $12,000.00 (also £ / gbp, € / eur)
|
|
1034
1235
|
% percent - multiplies by 100, e.g. 0.23 -> 23%
|
|
1035
|
-
, / number thousands separators
|
|
1236
|
+
, / number thousands separators
|
|
1036
1237
|
plain / text no number formatting (good for years, ids, codes)
|
|
1037
|
-
.N suffix fixed decimals,
|
|
1238
|
+
.N suffix fixed decimals, attached directly: $.0, %.1, .2
|
|
1038
1239
|
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1240
|
+
Each target accepts one format token. Use C=%.2, not C=%,.2. Unknown or
|
|
1241
|
+
malformed rules are ignored without changing the sheet's data.
|
|
1242
|
+
|
|
1243
|
+
Formatting changes appearance, not the underlying values. Copy preserves
|
|
1244
|
+
the source values; Excel export preserves both the values and number formats.
|
|
1042
1245
|
|
|
1043
1246
|
FORMULAS
|
|
1044
1247
|
A cell whose value starts with = is a formula, evaluated in the browser.
|
|
@@ -1287,7 +1490,8 @@ EXPORT
|
|
|
1287
1490
|
formulas and recalculate when the file opens; the format: directive's
|
|
1288
1491
|
currency / percent / comma columns carry over as Excel number formats.
|
|
1289
1492
|
The export uses the document's row order (plus any fullscreen edits),
|
|
1290
|
-
never the sorted view, so formula references stay correct.
|
|
1493
|
+
never the sorted view, so formula references stay correct. Sheet, column,
|
|
1494
|
+
row, and cell number formats carry over to Excel.
|
|
1291
1495
|
`;
|
|
1292
1496
|
|
|
1293
1497
|
const SLIDES_HELP = `
|
|
@@ -1299,6 +1503,31 @@ present-mode icon in the slide's top-right corner to enter fullscreen.
|
|
|
1299
1503
|
Text inside a slide thumbnail is selectable. Esc to exit, arrows to
|
|
1300
1504
|
navigate.
|
|
1301
1505
|
|
|
1506
|
+
\u2500\u2500 START HERE \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
1507
|
+
Use \`@extends\` for covers, section breaks, quotations, simple
|
|
1508
|
+
text, and layouts that repeat. Fill named slots and the template
|
|
1509
|
+
handles layout, spacing, and alignment for you:
|
|
1510
|
+
|
|
1511
|
+
~~~slide
|
|
1512
|
+
@extends title-body
|
|
1513
|
+
#title: What is SmallDocs?
|
|
1514
|
+
#body:
|
|
1515
|
+
- Markdown in, styled docs out
|
|
1516
|
+
- No server, hash-only state
|
|
1517
|
+
~~~
|
|
1518
|
+
|
|
1519
|
+
Run \`sdoc slides list\` for the template + slot names (cover,
|
|
1520
|
+
title-body, two-column, three-column, exhibit, quote, metric,
|
|
1521
|
+
section, closing).
|
|
1522
|
+
|
|
1523
|
+
Use custom shapes when geometry explains the idea: a process,
|
|
1524
|
+
architecture, hierarchy, comparison, feedback loop, market
|
|
1525
|
+
structure, or causal model. This applies to internal presentations
|
|
1526
|
+
too. An internal audience should be able to see the model instead
|
|
1527
|
+
of reconstructing it from title-and-bullet slides. Mix templates
|
|
1528
|
+
and custom slides in the same deck. Read DESIGN GUIDELINES and
|
|
1529
|
+
\`sdoc slides custom-shapes\` before hand-placing shapes.
|
|
1530
|
+
|
|
1302
1531
|
\u2500\u2500 COMMANDS \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
1303
1532
|
sdoc present <file> Open file directly in fullscreen slide view
|
|
1304
1533
|
sdoc <file> Open normally (click a slide's present icon)
|
|
@@ -1306,9 +1535,11 @@ navigate.
|
|
|
1306
1535
|
sdoc slides list List built-in templates + slot names
|
|
1307
1536
|
sdoc slides icons [query] List the Lucide icons available to the
|
|
1308
1537
|
\`icon\` shape kind. Optional substring filter.
|
|
1309
|
-
sdoc slides custom-shapes
|
|
1310
|
-
|
|
1311
|
-
|
|
1538
|
+
sdoc slides custom-shapes Shape syntax and design guidance for visual
|
|
1539
|
+
explanations, diagrams, and custom layouts.
|
|
1540
|
+
sdoc slides verify <file> Validate every slide headlessly. Exit 0 when
|
|
1541
|
+
clean, 1 for diagnostics, or 2 for bad usage.
|
|
1542
|
+
sdoc slides verify <file> --json Return the same result as structured JSON.
|
|
1312
1543
|
|
|
1313
1544
|
── DESIGN GUIDELINES ────────────────────────────────────
|
|
1314
1545
|
The built-in templates encode a few rules that separate professional
|
|
@@ -1316,18 +1547,12 @@ navigate.
|
|
|
1316
1547
|
template), keep these in mind - they're the difference between a
|
|
1317
1548
|
deck that lands and one that doesn't.
|
|
1318
1549
|
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
external-facing - a client, a conference, a launch, anything with
|
|
1326
|
-
your name on it that you will not be in the room to narrate -
|
|
1327
|
-
compose the deck from raw shapes instead. If you are not sure which
|
|
1328
|
-
setting you are in, ask your user, explaining the trade-off:
|
|
1329
|
-
templates are faster and uniform, raw shapes take longer but let
|
|
1330
|
-
the deck carry a designed look. See \`sdoc slides custom-shapes\`
|
|
1550
|
+
Match the layout to the information. Templates are the fast path
|
|
1551
|
+
for covers, section breaks, simple text, and repeated structures.
|
|
1552
|
+
Raw shapes are the explanatory path when position, direction,
|
|
1553
|
+
grouping, size, or sequence carries meaning. Audience type does
|
|
1554
|
+
not decide this: internal architecture and process decks often
|
|
1555
|
+
benefit most from a visual model. See \`sdoc slides custom-shapes\`
|
|
1331
1556
|
for the shape vocabulary and the design principles that go with it.
|
|
1332
1557
|
|
|
1333
1558
|
Margins. Keep all content inside a 1-unit safe area on every side
|
|
@@ -1360,9 +1585,13 @@ navigate.
|
|
|
1360
1585
|
Caption renders as ~3px in a 240px-wide thumbnail - never put
|
|
1361
1586
|
load-bearing content in caption role.
|
|
1362
1587
|
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1588
|
+
Use \`valign=top\` for body copy - bullets, paragraphs, columns.
|
|
1589
|
+
Text has a reading order and a top edge readers expect just under
|
|
1590
|
+
the title, so anchor it there and let it grow down. \`valign=center\`
|
|
1591
|
+
is for a single short block that balances its box or a neighbouring
|
|
1592
|
+
visual (a takeaway beside a chart, a caption, a lead line) - not for
|
|
1593
|
+
a list. If a top-anchored body leaves dead space below, shrink the
|
|
1594
|
+
shape rather than re-centering the text.
|
|
1366
1595
|
|
|
1367
1596
|
Content fills 55-65% of the safe area, no more. Empty space is a
|
|
1368
1597
|
feature: it's what makes a deck feel confident rather than crowded.
|
|
@@ -1380,17 +1609,19 @@ navigate.
|
|
|
1380
1609
|
A bulleted paragraph is hiding the fact that you haven't decided
|
|
1381
1610
|
what you're claiming.
|
|
1382
1611
|
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
that hand-built deck on the professional side of the line. If a
|
|
1389
|
-
custom layout repeats across slides, define it once as your own
|
|
1390
|
-
\`@template\` and \`@extends\` it - the consistency of a template
|
|
1391
|
-
with a look you designed.
|
|
1612
|
+
Do not default an internal deck to title-and-bullet templates.
|
|
1613
|
+
If the slide explains relationships, stages, or movement, compose
|
|
1614
|
+
those relationships with shapes. If a custom layout repeats across
|
|
1615
|
+
slides, define it once as your own \`@template\` and \`@extends\` it -
|
|
1616
|
+
the consistency of a template with a look you designed.
|
|
1392
1617
|
|
|
1393
1618
|
\u2500\u2500 VERIFYING A DECK (OPTIONAL, BUT IT IS WHAT SEPARATES CLEAN FROM BROKEN) \u2500\u2500
|
|
1619
|
+
Run \`sdoc slides verify <file> --json\` after authoring. It uses the
|
|
1620
|
+
same parser, template resolver, reference resolver, and bounds check
|
|
1621
|
+
as the browser. Fix every reported problem or acknowledge intentional
|
|
1622
|
+
off-canvas decoration on that shape with \`bleed=allow\`, then run it
|
|
1623
|
+
again. The command exits 0 only when the deck is clean.
|
|
1624
|
+
|
|
1394
1625
|
You are authoring slides you cannot see. You place coordinates and
|
|
1395
1626
|
trust them, and the renderer does not warn you when a shape covers
|
|
1396
1627
|
text, when a label wraps to a line you did not intend, when text sits
|
|
@@ -1645,7 +1876,8 @@ navigate.
|
|
|
1645
1876
|
Everything after \`|\` is standard markdown. Multi-line uses
|
|
1646
1877
|
indentation under the shape line - continuation lines MUST be
|
|
1647
1878
|
indented at least 2 spaces, or the parser treats them as fresh
|
|
1648
|
-
top-level shape lines (and fails).
|
|
1879
|
+
top-level shape lines (and fails). In short inline labels, \`\\n\`
|
|
1880
|
+
inserts a visible line break; \`\\\\n\` keeps the literal text \`\\n\`.
|
|
1649
1881
|
|
|
1650
1882
|
r 5 20 90 60 align=left |
|
|
1651
1883
|
## Heading
|
|
@@ -1668,17 +1900,20 @@ navigate.
|
|
|
1668
1900
|
- Title shapes (one heading or phrase)
|
|
1669
1901
|
- Subheaders, section labels
|
|
1670
1902
|
- Standalone caption text
|
|
1903
|
+
- A single short block balancing a box or a neighbouring visual
|
|
1671
1904
|
|
|
1672
|
-
Switch to \`align=left\` when the shape holds body copy -
|
|
1673
|
-
bullet lists, numbered lists, blockquotes. Left-aligned
|
|
1674
|
-
once you have multiple lines
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1905
|
+
Switch to \`align=left valign=top\` when the shape holds body copy -
|
|
1906
|
+
paragraphs, bullet lists, numbered lists, blockquotes. Left-aligned
|
|
1907
|
+
reads better once you have multiple lines, and top-anchoring puts the
|
|
1908
|
+
first line just under the title where the reader looks first.
|
|
1909
|
+
Centering a list in an oversized box floats it toward the middle, so
|
|
1910
|
+
the gap under the title reads as a mistake. If top-anchoring leaves
|
|
1911
|
+
dead space below, shrink the shape - don't re-center the text.
|
|
1678
1912
|
|
|
1679
1913
|
Rule of thumb:
|
|
1680
|
-
ONE short phrase
|
|
1681
|
-
MULTIPLE lines
|
|
1914
|
+
ONE short phrase / balancing block \u2192 center both axes
|
|
1915
|
+
MULTIPLE lines / bullets / columns \u2192 align=left valign=top
|
|
1916
|
+
Footer / attribution label \u2192 valign=bottom
|
|
1682
1917
|
|
|
1683
1918
|
\u2500\u2500 PULLING FROM DOC STYLES \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
1684
1919
|
Slides pick up the host document's styles so a deck feels visually
|
|
@@ -1955,7 +2190,8 @@ navigate.
|
|
|
1955
2190
|
|
|
1956
2191
|
Common errors:
|
|
1957
2192
|
- "shape extends outside grid WxH" bbox past an edge by >10% of the
|
|
1958
|
-
grid
|
|
2193
|
+
grid. Add \`bleed=allow\` only when
|
|
2194
|
+
that individual shape is intentional
|
|
1959
2195
|
- \`unknown id "@name"\` @-ref before the shape is declared
|
|
1960
2196
|
- \`duplicate id "#name"\` two shapes share an id
|
|
1961
2197
|
- \`invalid attribute key\` key must start with a letter
|
|
@@ -1969,10 +2205,10 @@ navigate.
|
|
|
1969
2205
|
const SLIDES_CUSTOM_SHAPES_HELP = `
|
|
1970
2206
|
SmallDocs — Slides (raw shapes)
|
|
1971
2207
|
===========================
|
|
1972
|
-
Reference + design notes for slides built from raw shapes
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
2208
|
+
Reference + design notes for slides built from raw shapes. Use templates
|
|
2209
|
+
for simple or repeated layouts. Use these shapes when geometry explains
|
|
2210
|
+
a process, architecture, hierarchy, comparison, or causal model, including
|
|
2211
|
+
in internal presentations.
|
|
1976
2212
|
|
|
1977
2213
|
Read DESIGN PRINCIPLES first. The syntax reference below assumes you've
|
|
1978
2214
|
made the visual choices the principles describe. Without them, raw
|
|
@@ -2286,7 +2522,8 @@ rather than as designed.
|
|
|
2286
2522
|
All shapes EXCEPT \`l\` and \`a\` can hold markdown after \`|\` - full
|
|
2287
2523
|
markdown (headings, lists, bold/italic, code, blockquote, tables).
|
|
2288
2524
|
Non-rectangle shapes use their bounding box as the text area (see
|
|
2289
|
-
the TEXT INSIDE NON-RECT SHAPES section).
|
|
2525
|
+
the TEXT INSIDE NON-RECT SHAPES section). In a short inline label,
|
|
2526
|
+
\`\\n\` inserts a visible line break.
|
|
2290
2527
|
|
|
2291
2528
|
No \`fill=\` on a shape -> transparent (slide background shows through).
|
|
2292
2529
|
Color values accept any CSS colour: hex (#1e40af), named (tomato),
|
|
@@ -2465,6 +2702,8 @@ rather than as designed.
|
|
|
2465
2702
|
backdrops, ghosted "previous state" shapes,
|
|
2466
2703
|
overlapping highlights. Out-of-range values
|
|
2467
2704
|
clamp.
|
|
2705
|
+
bleed=allow Acknowledge intentional off-canvas overflow for
|
|
2706
|
+
this shape. Other shapes are still checked.
|
|
2468
2707
|
|
|
2469
2708
|
Numeric attributes (strokeWidth, radius) are in grid units - pick
|
|
2470
2709
|
values relative to your grid size, no prescribed defaults. On a
|
|
@@ -2715,14 +2954,8 @@ COMMANDS
|
|
|
2715
2954
|
bag (tag - count, sorted by
|
|
2716
2955
|
frequency). Run before tagging
|
|
2717
2956
|
a new file to stay consistent.
|
|
2718
|
-
sdoc library status Print enabled/disabled
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
Refresh
|
|
2722
|
-
sdoc library rebuild Walk \$HOME again from scratch
|
|
2723
|
-
and refresh every entry. Use
|
|
2724
|
-
after moving files around or
|
|
2725
|
-
when an entry seems stale.
|
|
2957
|
+
sdoc library status Print enabled/disabled and the
|
|
2958
|
+
current entry count.
|
|
2726
2959
|
|
|
2727
2960
|
On/off
|
|
2728
2961
|
sdoc library enable Re-enable indexing-on-open if
|
|
@@ -2755,9 +2988,7 @@ COMMANDS
|
|
|
2755
2988
|
sdoc library help Same.
|
|
2756
2989
|
|
|
2757
2990
|
WHAT GETS INDEXED
|
|
2758
|
-
Every file you open with \`sdoc <file>\` is recorded at open time
|
|
2759
|
-
\`sdoc library rebuild\` additionally walks \$HOME looking for
|
|
2760
|
-
markdown that fits these rules:
|
|
2991
|
+
Every file you open with \`sdoc <file>\` is recorded at open time when:
|
|
2761
2992
|
- extension is .md, .mdx, or .markdown
|
|
2762
2993
|
- size is at most 1 MB
|
|
2763
2994
|
- not under a hidden directory (.git, .venv, .cache, ...)
|
|
@@ -2931,8 +3162,8 @@ PRIVACY MODEL
|
|
|
2931
3162
|
|
|
2932
3163
|
COMMON QUESTIONS
|
|
2933
3164
|
Q: I opened a file but I don't see it in the library.
|
|
2934
|
-
A: Check \`sdoc library status\` (is it enabled?), then
|
|
2935
|
-
\`sdoc
|
|
3165
|
+
A: Check \`sdoc library status\` (is it enabled?), then open the file
|
|
3166
|
+
again with \`sdoc <file>\`. If the file is in front matter
|
|
2936
3167
|
\`sdocs-library: false\`, that's the opt-out. Also check for a
|
|
2937
3168
|
.sdocsignore in the file's directory or any ancestor.
|
|
2938
3169
|
|
|
@@ -3035,4 +3266,4 @@ SUPPORTED LANGUAGES
|
|
|
3035
3266
|
they appear. An unknown language label renders as plain text.
|
|
3036
3267
|
`;
|
|
3037
3268
|
|
|
3038
|
-
module.exports = { HELP, COMMENTS_HELP, SCHEMA, CHARTS_HELP, DIAGRAMS_HELP, VIDEOS_HELP, CELLS_HELP, CODE_HELP, SLIDES_HELP, SLIDES_CUSTOM_SHAPES_HELP, LIBRARY_HELP };
|
|
3269
|
+
module.exports = { HELP, COMMENTS_HELP, SCHEMA, CHARTS_HELP, DIAGRAMS_HELP, VIDEOS_HELP, APPS_HELP, CELLS_HELP, CODE_HELP, SLIDES_HELP, SLIDES_CUSTOM_SHAPES_HELP, LIBRARY_HELP };
|