Commit bf71650
authored
feat(docs): add em-dash + metadata validators (SD-2884, SD-2885) (#3054)
* fix(docs): sweep em-dashes at the source + add validator (SD-2885)
The earlier final pass swept hand-written mdx for em-dashes but
generated content (Document API reference, Document Engine SDKs
overview) kept emitting them because the descriptions in
packages/document-api/src/contract/operation-definitions.ts and
related TS sources still contained em-dashes.
This sweep covers:
- packages/document-api/src/**/*.ts (excluding test files)
- packages/document-api/scripts/lib/reference-docs-artifacts.ts
(the placeholder em-dash for empty cells, now a hyphen)
- apps/docs/scripts/generate-sdk-overview.ts (the hand-written
prose blocks the generator splices into sdks.mdx)
- apps/docs/document-engine/sdks.mdx (hand-written sections
outside the generated marker block)
- apps/docs/llms.txt and llms-full.txt
- apps/docs/guides/migration/{prosemirror,breaking-changes-v1}.mdx
(now visible under Resources > Upgrade guides)
- apps/docs/snippets/components/*.jsx
- apps/docs/docs.json banner text
Regenerated reference docs are em-dash-free. Hidden pages,
internal scripts, and the auto-generated openapi.json are left
alone.
Add scripts/validate-em-dashes.ts as a pre-commit lefthook to
prevent the rule from drifting again. Skips frontmatter-hidden
pages. Wired as docs-check-em-dashes.
* feat(repo): add demos and examples metadata validator (SD-2884)
Catches the class of drift surfaced during the SD-2873 audit:
- Invalid demo-config.json (e.g. trailing comma)
- Hardcoded /Users/<name>/ absolute paths in human-edited content
- Stale docs.superdoc.dev URLs from the old IA (/modules, /core,
/document-engine/ai-agents, /extensions/track-changes, etc.)
Includes the immediate fixes the validator was written to enforce:
- demos/toolbar/demo-config.json: trailing comma removed
- examples/collaboration/{fastapi,liveblocks}/README.md: hardcoded
/Users/nickjbernal/... paths replaced with relative or <repo-root>
- Stale URL references across example READMEs swept to new IA paths
(modules/* to editor/built-in-ui/*, core/* to editor/*, etc.)
Wired as scripts/validate-examples-demos.ts plus a root
check:examples-demos pnpm script and an examples-demos-validate
lefthook pre-commit hook scoped to demos/** and examples/**.
Companion to validate-em-dashes.ts and validate-icons.ts.
The same pattern catches metadata drift before deploy.
* fix(docs): address PR #3054 review findings (SD-2885)
Five fixes flagged in code review:
- apps/docs/document-engine/sdks.mdx: the em-dash sweep over the
collaboration parameter table replaced 'no default' em-dash placeholders
with literal colons (rendering as ': ' in the Default column). Replace
with the word 'none' so the cells read as parameters with no default.
- apps/docs/document-engine/sdks.mdx: a paired-em-dash parenthetical
('at workflow boundaries -- after opening, after edits, or before
saving -- not in a polling loop') became two colons. Rewrite using
parentheses, which the brand voice guide explicitly allows.
- apps/docs/docs.json: the banner lost its separator after em-dash
removal, leaving '**Introducing Document Engine** edit DOCX files...'
as a run-on phrase. Add a period inside the bold so it reads as a
proper sentence.
- apps/docs/scripts/generate-sdk-overview.ts: an aligned ASCII comment
block had paired colons after the sweep. Use hyphens to restore the
intended column-separator look.
- apps/docs/scripts/validate-em-dashes.ts: the hidden-page skip regex
matched 'hidden: true' anywhere in the file body. Tighten to parse
the YAML frontmatter block strictly via readFrontmatter().
Plus an extension flagged by Codex: the validator now also scans
apps/docs/scripts/generate-sdk-overview.ts and packages/document-api/
src/contract/operation-definitions.ts -- both feed user-facing copy
into the rendered docs through gen:all. A future em-dash added to
either source will fail the check before deploy. Lefthook glob
expanded to trigger on those paths.1 parent 3e09cbe commit bf71650
135 files changed
Lines changed: 925 additions & 456 deletions
File tree
- apps
- docs
- document-api/reference
- authorities
- bookmarks
- citations
- comments
- create
- cross-refs
- fields
- footnotes
- index
- lists
- mutations
- selection
- document-engine
- guides/migration
- scripts
- snippets/components
- mcp/src/generated
- demos
- loading-from-json/src
- nodejs
- toolbar
- examples
- ai
- bedrock
- collaboration
- fastapi
- yjs-hub
- hocuspocus
- liveblocks
- superdoc-yjs
- features
- getting-started
- angular
- cdn
- nuxt
- vanilla
- vue
- headless
- packages/document-api
- scripts
- lib
- src
- authorities
- capabilities
- citations
- clear-content
- comments
- content-controls
- contract
- cross-refs
- delete
- diff
- format
- hyperlinks
- images
- index
- inline-semantics
- insert
- invoke
- lists
- markdown-to-fragment
- paragraphs
- protection
- ranges
- replace
- selection
- styles
- toc
- track-changes
- types
- validation
- write
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1031 | 1031 | | |
1032 | 1032 | | |
1033 | 1033 | | |
1034 | | - | |
| 1034 | + | |
1035 | 1035 | | |
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
42 | 47 | | |
43 | 48 | | |
44 | 49 | | |
| |||
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
83 | 91 | | |
84 | 92 | | |
85 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| |||
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| |||
87 | 93 | | |
88 | 94 | | |
89 | 95 | | |
90 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
91 | 101 | | |
92 | 102 | | |
93 | 103 | | |
| |||
161 | 171 | | |
162 | 172 | | |
163 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
164 | 177 | | |
165 | 178 | | |
166 | 179 | | |
| |||
231 | 244 | | |
232 | 245 | | |
233 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
234 | 250 | | |
235 | 251 | | |
236 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
42 | 47 | | |
43 | 48 | | |
44 | 49 | | |
| |||
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
| 61 | + | |
56 | 62 | | |
57 | 63 | | |
58 | 64 | | |
| |||
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
75 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
76 | 86 | | |
77 | 87 | | |
78 | 88 | | |
| |||
106 | 116 | | |
107 | 117 | | |
108 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
109 | 122 | | |
110 | 123 | | |
111 | 124 | | |
| |||
142 | 155 | | |
143 | 156 | | |
144 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
145 | 161 | | |
146 | 162 | | |
147 | 163 | | |
| |||
212 | 228 | | |
213 | 229 | | |
214 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
215 | 234 | | |
216 | 235 | | |
217 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
| |||
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
| 63 | + | |
58 | 64 | | |
59 | 65 | | |
60 | 66 | | |
| |||
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
77 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
78 | 88 | | |
79 | 89 | | |
80 | 90 | | |
| |||
112 | 122 | | |
113 | 123 | | |
114 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
115 | 128 | | |
116 | 129 | | |
117 | 130 | | |
| |||
149 | 162 | | |
150 | 163 | | |
151 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
152 | 168 | | |
153 | 169 | | |
154 | 170 | | |
| |||
219 | 235 | | |
220 | 236 | | |
221 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
222 | 241 | | |
223 | 242 | | |
224 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
0 commit comments