Skip to content

Commit 1f1c2c0

Browse files
committed
docs: brand voice + terminology sweep, hide legacy AI pages, rename Custom UI demo (SD-2873)
Final pass over the docs surface to align with brand.md voice and the new IA terminology. Terminology: - 'Bring Your Own UI' / 'BYO UI' to 'Custom UI' across 12+ mdx files, llms.txt, llms-full.txt, code comments in packages/super-editor and packages/superdoc. - Rename the Custom UI demo: demos/bring-your-own-ui to demos/custom-ui. Update package.json name, playwright port mapping key, README, and GitHub URL references in mdx. Brand voice: - Em-dash sweep across hand-written mdx (skip auto-generated files under document-api/reference and the gen:docs marker block in document-engine/sdks.mdx). 'X — Y' becomes 'X. Y' or 'X (Y)' or 'X: Y' depending on context. - Wrap frontmatter description values that contain colons in double quotes so YAML parses correctly (caught by mintlify validate). - Touch up grammatical regressions where the colon substitution read worse than the em-dash (theming.mdx, document-engine/overview.mdx, getting-started/{ai,import-export}.mdx). Legacy hides (kept reachable for inbound links, removed from search): - document-engine/ai-agents/* (7 pages) and getting-started/ai-agents.mdx add hidden: true frontmatter. Redirects already point /ai/* and /getting-started/ai at the new homes; this stops the old pages from surfacing in search results. Notes: - Auto-generated content (Document API reference, sdks.mdx marker block) still has em-dashes. Filing a follow-up for the generator. - demos/custom-ui/ folder renamed cleanly (no backward-compat shim per direction). Old GitHub URLs that pointed at demos/bring-your-own-ui will 404; trade-off accepted.
1 parent 7ce9a0f commit 1f1c2c0

91 files changed

Lines changed: 380 additions & 370 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/docs/advanced/headless-toolbar-examples.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ keywords: "toolbar examples, vue toolbar, svelte toolbar, custom toolbar example
88
Framework-agnostic patterns built on `createHeadlessToolbar()`. Pick the one closest to your stack.
99

1010
<Note>
11-
**On React?** Reach for [Bring Your Own UI › Toolbar and commands](/editor/custom-ui/toolbar-and-commands) instead. The typed React surface (`useSuperDocCommand`, `ui.commands.register`) re-renders one button per command, ships with selection / comments / track-changes hooks, and works with any design system (shadcn, MUI, Mantine, Tailwind). The headless examples below are for non-React stacks.
11+
**On React?** Reach for [Custom UI › Toolbar and commands](/editor/custom-ui/toolbar-and-commands) instead. The typed React surface (`useSuperDocCommand`, `ui.commands.register`) re-renders one button per command, ships with selection / comments / track-changes hooks, and works with any design system (shadcn, MUI, Mantine, Tailwind). The headless examples below are for non-React stacks.
1212
</Note>
1313

1414
## Vue + Vuetify
@@ -141,7 +141,7 @@ Replace `<example-name>` with `vue-vuetify`, `svelte-shadcn`, or `vanilla`.
141141
## Next steps
142142

143143
<CardGroup cols={2}>
144-
<Card title="Bring Your Own UI (React)" icon="atom" href="/editor/custom-ui/toolbar-and-commands">
144+
<Card title="Custom UI (React)" icon="atom" href="/editor/custom-ui/toolbar-and-commands">
145145
The recommended path for React apps. Typed hooks, custom commands, selection-aware buttons.
146146
</Card>
147147
<Card title="Headless toolbar API reference" icon="code" href="/advanced/headless-toolbar">

apps/docs/advanced/headless-toolbar.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Build your own toolbar UI. SuperDoc provides the state and commands — you rend
99

1010
## Using React?
1111

12-
`superdoc/headless-toolbar` is the framework-agnostic substrate. **For new React apps, reach for `useSuperDocCommand` from `superdoc/ui/react` instead.** It re-renders one button per command (not the whole toolbar) and ships alongside companion hooks for selection, comments, and tracked changes. See [Bring Your Own UI › Toolbar and commands](/editor/custom-ui/toolbar-and-commands).
12+
`superdoc/headless-toolbar` is the framework-agnostic substrate. **For new React apps, reach for `useSuperDocCommand` from `superdoc/ui/react` instead.** It re-renders one button per command (not the whole toolbar) and ships alongside companion hooks for selection, comments, and tracked changes. See [Custom UI › Toolbar and commands](/editor/custom-ui/toolbar-and-commands).
1313

1414
`superdoc/headless-toolbar` stays supported for existing integrations and framework-agnostic toolbar-only use cases. Both paths read from the same internal substrate.
1515

apps/docs/advanced/supereditor/overview.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SuperEditor is the low-level DOCX editing engine that powers SuperDoc. Most apps
99

1010
## Pick the right layer
1111

12-
**Use SuperDoc + Bring Your Own UI for custom React UI.** `<SuperDocEditor>` (or `new SuperDoc(...)`) plus `superdoc/ui/react` gives you typed hooks for toolbar, comments, tracked changes, selection, and document control. See [Bring Your Own UI](/editor/custom-ui/overview).
12+
**Use SuperDoc + Custom UI for custom React UI.** `<SuperDocEditor>` (or `new SuperDoc(...)`) plus `superdoc/ui/react` gives you typed hooks for toolbar, comments, tracked changes, selection, and document control. See [Custom UI](/editor/custom-ui/overview).
1313

1414
**Use the Document API for document mutations.** [`editor.doc.*`](/document-api/overview) is the stable, request/response surface that's identical on server, client, and AI agents. It's the recommended path for any insert / replace / format / comment / tracked-change operation.
1515

@@ -22,7 +22,7 @@ SuperEditor is the low-level DOCX editing engine that powers SuperDoc. Most apps
2222
- You're building a custom extension that taps into ProseMirror plugins or schemas.
2323
- You explicitly need engine internals the higher layers don't surface.
2424

25-
For a typical React DOCX editor with a custom UI, you don't need this page — start at [Bring Your Own UI](/editor/custom-ui/overview).
25+
For a typical React DOCX editor with a custom UI, you don't need this page — start at [Custom UI](/editor/custom-ui/overview).
2626

2727
## Quick start
2828

apps/docs/ai/agents/best-practices.mdx

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
title: Best practices
33
sidebarTitle: Best practices
4-
description: Get better results from LLM document editingprompting, tool call patterns, and workflow tips
4+
description: "Get better results from LLM document editing: prompting, tool call patterns, and workflow tips"
55
keywords: "llm best practices, ai document editing, prompt engineering, superdoc tools, tool calling, document automation"
66
---
77

88
These patterns help your LLM agent produce reliable, efficient document edits.
99

1010
## Use the bundled system prompt
1111

12-
`getSystemPrompt()` returns a tested prompt that teaches the model how to use SuperDoc tools targeting, workflow order, and multi-action tools. Load it once and pass it as the system message.
12+
`getSystemPrompt()` returns a tested prompt that teaches the model how to use SuperDoc tools: targeting, workflow order, and multi-action tools. Load it once and pass it as the system message.
1313

1414
```typescript
1515
import { getSystemPrompt } from '@superdoc-dev/sdk';
@@ -32,15 +32,15 @@ You edit `.docx` files using SuperDoc intent tools. Be efficient and minimize to
3232

3333
## Workflow
3434

35-
1. **Read** Use `superdoc_get_content` to understand the document.
36-
2. **Search** Use `superdoc_search` to find stable handles or block addresses.
37-
3. **Edit** Use the focused tool that matches the job:
35+
1. **Read**: Use `superdoc_get_content` to understand the document.
36+
2. **Search**: Use `superdoc_search` to find stable handles or block addresses.
37+
3. **Edit**: Use the focused tool that matches the job:
3838
- `superdoc_edit` for insert, replace, delete, undo, redo
3939
- `superdoc_format` for inline or paragraph formatting
4040
- `superdoc_create` for paragraphs and headings
4141
- `superdoc_comment` for comment threads
4242
- `superdoc_track_changes` for review decisions
43-
4. **Batch only when useful** Use `superdoc_mutations` for preview/apply or atomic multi-step edits.
43+
4. **Batch only when useful**: Use `superdoc_mutations` for preview/apply or atomic multi-step edits.
4444

4545
## Rules
4646

@@ -55,17 +55,17 @@ You edit `.docx` files using SuperDoc intent tools. Be efficient and minimize to
5555

5656
A typical edit takes 3-5 tool calls:
5757

58-
1. `superdoc_get_content` understand what's in the document
59-
2. `superdoc_search` find the exact location (returns stable handles/addresses)
60-
3. Edit tool (`superdoc_edit`, `superdoc_format`, etc.) apply the change using targets from search
58+
1. `superdoc_get_content`: understand what's in the document
59+
2. `superdoc_search`: find the exact location (returns stable handles/addresses)
60+
3. Edit tool (`superdoc_edit`, `superdoc_format`, etc.): apply the change using targets from search
6161

6262
This matters because handles from search results point to the exact right location. If the model guesses a block address instead of searching for it, edits land in the wrong place.
6363

6464
## Minimize tool calls
6565

6666
Instruct the LLM to plan all edits before calling tools. A well-structured prompt like "Find the termination clause and rewrite it to allow 30-day notice" should take 3-5 calls, not 15.
6767

68-
Batch multiple changes only when atomic execution is genuinely helpful use `superdoc_mutations` for that.
68+
Batch multiple changes only when atomic execution is genuinely helpful: use `superdoc_mutations` for that.
6969

7070
## Prefer markdown insert for multi-block creation
7171

@@ -79,9 +79,9 @@ When you need to create multiple headings and paragraphs in one operation, use `
7979
}
8080
```
8181

82-
After inserting, apply formatting in a single `superdoc_mutations` batch using `format.apply` steps one step per block or range. This reduces a workflow that might otherwise take 40+ calls down to 4: read, search, insert, format.
82+
After inserting, apply formatting in a single `superdoc_mutations` batch using `format.apply` steps: one step per block or range. This reduces a workflow that might otherwise take 40+ calls down to 4: read, search, insert, format.
8383

84-
## Use focused tools `superdoc_mutations` is an escape hatch
84+
## Use focused tools: `superdoc_mutations` is an escape hatch
8585

8686
For straightforward edits, use the focused intent tools (`superdoc_edit`, `superdoc_format`, `superdoc_create`, `superdoc_list`, `superdoc_comment`). They validate arguments, give clear errors, and are easier for models to call correctly.
8787

@@ -92,14 +92,14 @@ Reach for `superdoc_mutations` only when you need:
9292

9393
## Feed errors back
9494

95-
`dispatchSuperDocTool` returns structured errors. Pass them back as tool results most models self-correct on the next turn.
95+
`dispatchSuperDocTool` returns structured errors. Pass them back as tool results: most models self-correct on the next turn.
9696

9797
```typescript
9898
try {
9999
const result = await dispatchSuperDocTool(doc, toolCall.function.name, JSON.parse(toolCall.function.arguments));
100100
messages.push({ role: 'tool', tool_call_id: toolCall.id, content: JSON.stringify(result) });
101101
} catch (err: any) {
102-
// Return the error as a tool result the model will see it and adjust
102+
// Return the error as a tool result: the model will see it and adjust
103103
messages.push({ role: 'tool', tool_call_id: toolCall.id, content: JSON.stringify({ error: err.message }) });
104104
}
105105
```
@@ -110,9 +110,9 @@ Don't hardcode formatting values. Read them from the document's existing content
110110

111111
**Body text:** Read `fontFamily`, `fontSize`, and `color` from non-empty paragraphs with `alignment: "justify"` or `alignment: "left"`. Set `bold: false` for body paragraphs.
112112

113-
Many DOCX documents report `underline: true` on all blocks due to style inheritance. This is a DOCX artifact not intentional formatting. Do not carry it forward when inserting new paragraphs.
113+
Many DOCX documents report `underline: true` on all blocks due to style inheritance. This is a DOCX artifact: not intentional formatting. Do not carry it forward when inserting new paragraphs.
114114

115-
**Headings:** Read from existing heading blocks in the document. Scale `fontSize` up relative to body text. Headings are typically bold and sometimes centered confirm against what's already in the document rather than assuming.
115+
**Headings:** Read from existing heading blocks in the document. Scale `fontSize` up relative to body text. Headings are typically bold and sometimes centered: confirm against what's already in the document rather than assuming.
116116

117117
```typescript
118118
// Get content first, find a representative body paragraph
@@ -173,7 +173,7 @@ These prompts have been tested against the SuperDoc tool set. Use them as inspir
173173
- "Apply yellow highlight to every sentence that contains an indemnification obligation."
174174
- "Replace all references to 'Contractor' with 'Service Provider' and make each replacement italic with tracked changes enabled."
175175
- "Underline every sentence that references payment terms or late fees."
176-
- "Insert CONFIDENTIAL DO NOT DISTRIBUTE at the very top of the document and make it bold, red, 14pt."
176+
- "Insert CONFIDENTIAL: DO NOT DISTRIBUTE at the very top of the document and make it bold, red, 14pt."
177177
- "Scan the document for inconsistent capitalization of defined terms and fix them with tracked changes enabled."
178178

179179
### Formatting and structure
@@ -200,7 +200,7 @@ These prompts have been tested against the SuperDoc tool set. Use them as inspir
200200

201201
## Related
202202

203-
- [LLM tools](/ai/agents/llm-tools) tool catalog and SDK functions
204-
- [How to use](/ai/agents/integrations) step-by-step integration guide
205-
- [Debugging](/ai/agents/debugging) troubleshoot tool call failures
206-
- [Document API](/document-api/overview) the operation set behind the tools
203+
- [LLM tools](/ai/agents/llm-tools): tool catalog and SDK functions
204+
- [How to use](/ai/agents/integrations): step-by-step integration guide
205+
- [Debugging](/ai/agents/debugging): troubleshoot tool call failures
206+
- [Document API](/document-api/overview): the operation set behind the tools

apps/docs/ai/agents/debugging.mdx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Debugging
33
sidebarTitle: Debugging
4-
description: Troubleshoot LLM tool callslogging, error shapes, and common failure modes
4+
description: "Troubleshoot LLM tool calls: logging, error shapes, and common failure modes"
55
keywords: "llm debugging, tool call errors, superdoc tools, ai document editing, troubleshooting, document api"
66
---
77

@@ -13,8 +13,8 @@ Every LLM tool call maps to a [Document API](/document-api/overview) operation u
1313

1414
This gives you a clear debugging strategy:
1515

16-
1. **Test the Document API directly.** Call the underlying SDK method with the same arguments. If it works, the operation is fine the problem is in the prompt or the tool schema.
17-
2. **If the API call fails,** the issue is in the operation itself check arguments, targets, and document state.
16+
1. **Test the Document API directly.** Call the underlying SDK method with the same arguments. If it works, the operation is fine: the problem is in the prompt or the tool schema.
17+
2. **If the API call fails,** the issue is in the operation itself: check arguments, targets, and document state.
1818
3. **If the API call succeeds but the LLM tool call fails,** the model is calling the tool incorrectly. Fix the prompt, add examples, or check the tool schema.
1919

2020
```typescript
@@ -55,29 +55,29 @@ for (const toolCall of choice.message.tool_calls) {
5555
```
5656

5757
What to look for in logs:
58-
- **Tool name** is the model calling the right tool?
59-
- **Arguments** are required fields present? Is the `action` correct?
60-
- **Targets** are handles/addresses from a recent search, or did the model guess?
61-
- **Result** did the operation return data or an error?
58+
- **Tool name**: is the model calling the right tool?
59+
- **Arguments**: are required fields present? Is the `action` correct?
60+
- **Targets**: are handles/addresses from a recent search, or did the model guess?
61+
- **Result**: did the operation return data or an error?
6262

6363
## Error shapes
6464

6565
`dispatchSuperDocTool` throws errors in two categories:
6666

67-
**Validation errors** bad arguments before the operation runs:
67+
**Validation errors**: bad arguments before the operation runs:
6868
```json
6969
{ "error": "Missing required parameter: action" }
7070
{ "error": "Unknown action 'bold' for tool superdoc_format. Valid actions: inline, set_style, set_alignment, set_indentation, set_spacing" }
7171
{ "error": "Parameter 'target' is required for action 'replace'" }
7272
```
7373

74-
**Execution errors** the operation ran but failed:
74+
**Execution errors**: the operation ran but failed:
7575
```json
7676
{ "error": "Target not found: no node matches the given handle" }
7777
{ "error": "Invalid address: block at index 42 does not exist" }
7878
```
7979

80-
Both types are returned as strings in `err.message`. Pass them back as tool results the model usually self-corrects.
80+
Both types are returned as strings in `err.message`. Pass them back as tool results: the model usually self-corrects.
8181

8282
## Common failure modes
8383

@@ -88,7 +88,7 @@ Both types are returned as strings in `err.message`. Pass them back as tool resu
8888
| Edits land in the wrong place | Model invented a block address | Use `superdoc_search` to get fresh handles |
8989
| Infinite tool call loop | Model never reaches a stopping point | Add a max iterations guard (see below) |
9090
| Model doesn't use tools at all | Tools not passed to the API call | Verify `chooseTools()` result is in the `tools` param |
91-
| "Missing required parameter" | Model forgot `action` or another field | Check the tool schema add examples to the prompt |
91+
| "Missing required parameter" | Model forgot `action` or another field | Check the tool schema: add examples to the prompt |
9292
| Collaboration edits not appearing | SDK not in the same collab room | Verify the collaboration URL and documentId match |
9393
| Operation works via API but fails via tool | Model passes wrong argument types/names | Log the parsed arguments and compare to the API signature |
9494

@@ -130,13 +130,13 @@ while (iterations++ < MAX_ITERATIONS) {
130130
}
131131

132132
if (iterations >= MAX_ITERATIONS) {
133-
console.warn('[agent] Hit max iterations stopping');
133+
console.warn('[agent] Hit max iterations: stopping');
134134
}
135135
```
136136

137137
## Related
138138

139-
- [LLM tools](/ai/agents/llm-tools) tool catalog and SDK functions
140-
- [How to use](/ai/agents/integrations) step-by-step integration guide
141-
- [Best practices](/ai/agents/best-practices) prompting and workflow tips
142-
- [Document API](/document-api/overview) the underlying operations that tools call
139+
- [LLM tools](/ai/agents/llm-tools): tool catalog and SDK functions
140+
- [How to use](/ai/agents/integrations): step-by-step integration guide
141+
- [Best practices](/ai/agents/best-practices): prompting and workflow tips
142+
- [Document API](/document-api/overview): the underlying operations that tools call

0 commit comments

Comments
 (0)