@driftime/sanity-plugin-handbook 0.3.1 → 0.3.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/README.md +24 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
<picture>
|
|
3
3
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/driftime/sanity-plugin-handbook/HEAD/.github/assets/icon-dark.svg" />
|
|
4
4
|
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/driftime/sanity-plugin-handbook/HEAD/.github/assets/icon-light.svg" />
|
|
5
|
-
<img src="https://raw.githubusercontent.com/driftime/sanity-plugin-handbook/HEAD/.github/assets/icon-light.svg" alt="Handbook
|
|
5
|
+
<img src="https://raw.githubusercontent.com/driftime/sanity-plugin-handbook/HEAD/.github/assets/icon-light.svg" alt="Handbook plugin logo" width="48" />
|
|
6
6
|
</picture>
|
|
7
|
-
<h1>Handbook
|
|
7
|
+
<h1>Handbook</h1>
|
|
8
|
+
<p><strong>A Sanity Studio plugin by Driftime®</strong></p>
|
|
8
9
|
<p>Schema-driven documentation and editorial guides, built right into Sanity Studio.</p>
|
|
9
10
|
</div>
|
|
10
11
|
|
|
@@ -35,6 +36,8 @@ Handbook is built for Sanity Studio 6 and React 19, and declares both as peer de
|
|
|
35
36
|
bun add -E @driftime/sanity-plugin-handbook
|
|
36
37
|
```
|
|
37
38
|
|
|
39
|
+
<br />
|
|
40
|
+
|
|
38
41
|
## Basic Setup
|
|
39
42
|
|
|
40
43
|
Add the plugin to your Sanity configuration and pass in the document types you want to document, grouped by the role they play in your content model. Each role appears as a labelled section in the sidebar.
|
|
@@ -137,6 +140,8 @@ If no `handbook` property is provided, the tool falls back to the field's `title
|
|
|
137
140
|
|
|
138
141
|
Fields with nested structure display a collapsible section that editors can expand to explore subfields. Custom types extending built-in types like `image` or `file` show only the fields you add. Inherited fields are excluded automatically. Circular type references are detected and labelled rather than rendering infinitely.
|
|
139
142
|
|
|
143
|
+
<br />
|
|
144
|
+
|
|
140
145
|
## Guide Content
|
|
141
146
|
|
|
142
147
|
Handbook includes a guide authoring system powered by Portable Text. The plugin automatically registers a `handbook.handbook` singleton and a `handbook.guide` document type. No additional schema setup is required.
|
|
@@ -211,6 +216,8 @@ export default defineConfig({
|
|
|
211
216
|
});
|
|
212
217
|
```
|
|
213
218
|
|
|
219
|
+
<br />
|
|
220
|
+
|
|
214
221
|
## Editor Permissions
|
|
215
222
|
|
|
216
223
|
Restrict who can create and edit Handbook documents by providing a list of email addresses.
|
|
@@ -234,6 +241,8 @@ import { useIsHandbookEditor } from "@driftime/sanity-plugin-handbook";
|
|
|
234
241
|
const isEditor = useIsHandbookEditor();
|
|
235
242
|
```
|
|
236
243
|
|
|
244
|
+
<br />
|
|
245
|
+
|
|
237
246
|
## Structure Integration
|
|
238
247
|
|
|
239
248
|
The Handbook tool displays guides, but you author them in the Structure tool. Nothing appears there until you add it. Use the `handbookStructure` helper to add a Handbook singleton editor and a Handbook Guides list, both restricted to the same editors you gave the plugin.
|
|
@@ -307,6 +316,8 @@ Only `roles` is required, since it tells the plugin which document types to cove
|
|
|
307
316
|
| `editors` | `string[]` | `undefined` | Email addresses permitted to edit Handbook documents. Unrestricted when omitted. |
|
|
308
317
|
| `undocumentedFieldMessage` | `string` | `"This field has not been documented yet. Contact your development team for guidance."` | Fallback message shown when a field has no description. |
|
|
309
318
|
|
|
319
|
+
<br />
|
|
320
|
+
|
|
310
321
|
## Exported Types
|
|
311
322
|
|
|
312
323
|
These types are exported for typing your own configuration and for querying Handbook content outside the Studio.
|
|
@@ -334,6 +345,8 @@ Content the dataset stores:
|
|
|
334
345
|
| `SanityHandbookVideo` | A video block, with its asset and caption. |
|
|
335
346
|
| `SanityHandbookLink` | A link annotation, with the web address it points to. |
|
|
336
347
|
|
|
348
|
+
<br />
|
|
349
|
+
|
|
337
350
|
## Acknowledgements
|
|
338
351
|
|
|
339
352
|
The icons in `src/icons` are derived from [Lucide](https://lucide.dev) and redrawn as standalone components, so the plugin ships its own icons without depending on the Lucide package. Icons for controls the Studio already draws, such as disclosure arrows, come from `@sanity/icons` so they match their surroundings. Lucide is distributed under the [ISC License](https://github.com/lucide-icons/lucide/blob/main/LICENSE).
|
|
@@ -342,7 +355,15 @@ The icons in `src/icons` are derived from [Lucide](https://lucide.dev) and redra
|
|
|
342
355
|
<br />
|
|
343
356
|
|
|
344
357
|
<div align="center">
|
|
345
|
-
<a href="https://driftime.com"
|
|
358
|
+
<p><strong>Built alongside <a href="https://cairn.driftime.com">Cairn</a>, a starting point for responsible web experiences.</strong></p>
|
|
359
|
+
<p>Part of a suite of Sanity Studio plugins by Driftime®</p>
|
|
360
|
+
<p><a href="https://github.com/driftime/sanity-plugin-handbook">Handbook</a> · <a href="https://github.com/driftime/sanity-plugin-icon">Icon</a></p>
|
|
361
|
+
</div>
|
|
362
|
+
|
|
363
|
+
<br />
|
|
364
|
+
|
|
365
|
+
<div align="center">
|
|
366
|
+
<a href="https://driftime.com">
|
|
346
367
|
<picture>
|
|
347
368
|
<source media="(prefers-color-scheme: dark)" srcset="https://driftime.com/driftime-github-logo-dark.svg" />
|
|
348
369
|
<source media="(prefers-color-scheme: light)" srcset="https://driftime.com/driftime-github-logo.svg" />
|