You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chrome:
- Enable Expressive Code frames: copy button on every block, filename
title bars from title= or a leading // path comment
- Add pitfall callout kind and a collapsible deep-dive directive
- Table of contents: left rail with active marker, indented normal-weight h3s
Consistency and factual fixes:
- Data: addToCart throws through markSafeError so the rendered message
matches production behavior
- Reads page: state that Solid Router's query() declares GET for you
- One session shape: getSession() from Sessions; locals.userId everywhere
- Forms: server module moved out of src/routes (a .ts there is an API
route); note inline vs exported action forms
- Debugging: EFFECT_RELAY_TEAR repair text matches the runtime message
- Quick start / Boundaries / Components: the hold on navigation is Solid's,
not Loading's; Quick start uses the updater setter form
- App structure: three rendering modes; prerender snippet shows imports
- Nested routes: typed paths for the sign-in link, sign-in route added
- Setup: App snippet aligned with the other two (paths import, Loading)
- Data fetching: query lifetime described from source, not 'on navigation'
- Testing: unpinned install commands; template package.json is the record
- Remove version-history language from concept pages
- Middleware: document both exports of virtual:file-routes
- Closing sections normalized to '## Next steps'; added to five pages with
reference links moved inline
- Link text normalized to page titles; concepts index reading order adds
Stores and Rendering and SSR
- Frontmatter: drop dead mainNavExclude and titleTemplate, drop use_cases /
tags from hand-written pages, add descriptions to 14 pages
WRITING.md: callout kinds and rules, Avoid/Prefer convention, first-use
gloss, Recap section, Next steps and Common problems headings, frontmatter
fields, no version pins, code-block filename convention.
Co-authored-by: Cursor <cursoragent@cursor.com>
@@ -53,24 +53,61 @@ See below for an example of what this would look like in raw Markdown.
53
53
|April | 4 |
54
54
```
55
55
56
-
#### Asides
56
+
#### Callouts and deep dives
57
57
58
-
Asides serve as callout boxes in Solid's documentation.
59
-
They represent a section of the document that is related to the content surrounding the aside, but not directly relevant to the page.
60
-
They work well with explaining how Solid differs from other popular frameworks, referring to other points in the documentation, or serving as a tangential note.
61
-
We ask that you use them sparingly.
58
+
A page written as one unbroken column of prose and code reads as generated.
59
+
Callouts change the register: they mark what the reader must not miss, what they can skip, and what will bite them.
60
+
Aim for two or three per Learn page, placed where the content changes kind, not where a paragraph felt long.
62
61
63
-
1. To use an aside, you must first import the correct component.
64
-
2. Use the following command in your terminal. (Remember to be in the cloned Solid repo directory.)
62
+
Write a callout as a container directive with an optional title in brackets:
65
63
66
-
3. Once you have the Aside component imported, simply follow the below example for how to add one to your document.
|`pitfall`| A tempting approach that looks right and is not. Show the wrong code, name the consequence, quote the dev warning. |
75
+
|`caution`| A constraint the reader must respect: an ordering rule, a limit, a case the runtime does not check. |
76
+
|`danger`| Data loss or a security exposure. |
77
+
|`note`| Context the paragraph needs but the flow does not: a difference from another framework, a scope statement. |
78
+
|`tip`| A shortcut or a better default the reader may not know to look for. |
79
+
|`advanced`| Content for integrators and library authors that an app developer can skip. |
80
+
|`deep-dive`| Collapsed by default. How something works under the hood, or why a rule exists. Never the only place a rule is stated. |
81
+
82
+
Rules:
83
+
84
+
- A `pitfall` needs three things: the wrong code, the observed consequence, and the fix.
85
+
Where a development diagnostic fires, quote it and link its code to the Debugging reactivity guide.
86
+
- A `deep-dive` must be skippable.
87
+
If the reader needs it to use the API, it belongs in the body.
88
+
Keep headings out of it so the page outline stays flat.
89
+
- Do not put a callout inside a callout, and do not stack two in a row.
90
+
- Callout titles are plain text; inline code in the bracket is dropped by the parser.
91
+
- Do not use a callout to restate the paragraph above it.
92
+
93
+
Tabs group alternatives the reader picks one of, such as package managers or validation libraries:
67
94
68
95
```
69
-
:::note
70
-
content here
96
+
::::tab-group[validation-library]
97
+
98
+
:::tab[Valibot]
99
+
...
100
+
:::
101
+
102
+
:::tab[Zod]
103
+
...
71
104
:::
105
+
106
+
::::
72
107
```
73
108
109
+
Tab groups that share a name select together across the site.
110
+
74
111
### Code examples
75
112
76
113
Solid's documentation contains example code, like you've seen here in this guide.
@@ -97,6 +134,11 @@ npm install
97
134
Code examples are vital to providing users with quick tips on how to use Solid.
98
135
Knowing when to use inline code versus code blocks can further the understanding of the readers and users alike.
99
136
137
+
When a block shows the contents of a file, name the file.
138
+
A first-line comment such as `// src/router.ts` is lifted into the block's title bar, or set it on the fence with `title="src/router.ts"`.
139
+
Fragments that are not a whole file get no filename.
140
+
Every block has a copy button; do not add prose telling the reader to copy.
141
+
100
142
### Images
101
143
102
144
Good documentation takes advantage of images, such as screenshots and graphics, to expand upon the written content.
@@ -123,6 +165,24 @@ Now that we've laid out how we'd like your contribution to look, we'd like to ta
123
165
Please note that, for editing purposes, **each sentence gets its own line**.
124
166
Paragraphs should have two lines between them.
125
167
168
+
### Frontmatter
169
+
170
+
Every hand-written page carries three fields:
171
+
172
+
```yaml
173
+
---
174
+
title: "Sessions and auth"
175
+
version: "2.0"
176
+
description: "Build a signed cookie session on the request event, sign users in and out from server functions, and authorize every server entry point."
177
+
---
178
+
```
179
+
180
+
`description` is one sentence, written for the search result and the `llms.txt` index: what the reader will be able to do after the page, not what the page "covers".
181
+
Do not add `titleTemplate`; the browser title is built from `title` and the site name.
182
+
`use_cases` and `tags` are emitted by the reference generator and are not used on hand-written pages.
183
+
184
+
Do not pin package versions in prose or install commands; point at the template's `package.json` for the versions known to work together.
185
+
126
186
### Headings
127
187
128
188
Headings act as the primary means of document organization.
@@ -224,15 +284,47 @@ Do not open with a definition ("A signal is a reactive primitive that...").
224
284
Definitions belong after the reader knows why they need one.
225
285
226
286
Where the page continues a sequence, say what the reader saw on the previous page and build on it.
227
-
The Quick start counter, the cart on the Reactivity and Components pages, and the product page on the Async page are the recurring examples; reuse them before inventing a new domain.
287
+
The recurring example across Learn is a storefront: the Quick start counter, then a product page, a cart, a checkout address form, an account area, and orders.
288
+
Reuse those before inventing a new domain, and do not claim a page follows one example unless it does.
228
289
229
290
### Show what happens, then explain why
230
291
231
292
Each section that introduces a behavior shows the code, states what the reader observes when it runs, and then explains the mechanism.
232
293
"Click `+` and the subtotal changes; nothing else is touched" before "JSX expressions are tracking scopes."
294
+
Every example gets that observation sentence; code followed directly by mechanism reads as a reference page.
233
295
234
296
Where a tempting wrong approach exists, show it, show what it does (including the exact development warning where there is one), and show the fix.
235
297
A section that only shows the right way leaves the reader unable to recognize the wrong way in their own code.
298
+
Mark the pair so it can be scanned:
299
+
300
+
```tsx
301
+
// Avoid: the effect copies a value it could derive
302
+
createEffect(
303
+
() =>fullName(),
304
+
(name) =>setDisplayName(name)
305
+
);
306
+
307
+
// Prefer: derive it where it is read
308
+
const displayName =createMemo(() =>fullName());
309
+
```
310
+
311
+
Then one sentence of what the `Avoid` version does when run, and the bracketed diagnostic code if one fires, linked to its section in Debugging reactivity.
312
+
A `:::pitfall` callout is the right container when the wrong version is a common habit rather than a one-off.
313
+
314
+
### Gloss a term the first time it appears
315
+
316
+
Solid has vocabulary a new reader has not met: held update, settled, owner, tracking scope, projection, boundary.
317
+
The first time a page uses one, say what it means in a clause and link the page that explains it.
318
+
"the write is held (kept back until the data it needs has arrived; see Async reactivity)".
319
+
After the first use, the bare term is fine.
320
+
One new term per section; a paragraph that introduces three is a paragraph the reader will not finish.
321
+
322
+
### Close with a recap
323
+
324
+
Before the next-steps section, list the rules the page taught as five to eight one-line bullets under `## Recap`.
325
+
Each line is a rule the reader can apply, not a heading restated: "Read signals inside JSX, a memo, or an effect's compute function" rather than "Reactivity basics".
326
+
The recap is what gets screenshotted and quoted; write it as if it were the only part of the page someone reads.
327
+
A page with fewer than four rules to recap does not need one.
236
328
237
329
### Test every example
238
330
@@ -250,18 +342,21 @@ Guides that choose between approaches need a section on what to weigh, not only
250
342
251
343
### End with the next page, not the reference
252
344
253
-
The last section of a Learn page tells the reader where to go next and why, in terms of what they are trying to do.
345
+
The last section of a Learn page is `## Next steps`: two to four links, each with a clause saying what the reader gets there in terms of what they are trying to do.
346
+
Use that heading on every page so readers and tooling can find it.
254
347
Link API references inline where the API is discussed.
255
348
Do not end a section or a page with "See the reference for details"; the reference is where the reader goes when they already understand the idea.
256
349
350
+
Troubleshooting goes under `## Common problems`, before Next steps, with each problem as an H3 in the reader's words so it appears in the page outline and can be linked.
351
+
257
352
### Vary the shape
258
353
259
354
Do not write every page as introduction, one H2 per API, conclusion.
260
355
Let the problem decide the sections: a troubleshooting section named after the symptom, a three-pass build-up, a decision list, a comparison of two versions of the same code.
261
356
Section headings should be readable as the reader's question or situation where that helps ("A value renders once and never updates"), not only as the name of the mechanism.
262
357
263
-
Do not add a closing paragraph that restates the page.
264
-
If there is nothing to say after the last section but "where to go next", say only that.
358
+
Do not add a closing paragraph that restates the page; the bulleted recap is the only summary.
359
+
If there is nothing to say after the last section but "next steps", say only that.
0 commit comments