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
Copy file name to clipboardExpand all lines: docs/README.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,4 @@
1
1
## Migration note
2
-
3
2
We are in the process of moving from the `spacetimedb-docs` repo to the `docs` subdirectory of [SpacetimeDB](https://github.com/clockworklabs/SpacetimeDB). **Any new changes should be made there**. The `spacetimedb-docs` repo will only be updated on release. Apologies in advance for any sharp edges while the migration is in progress.
> NOTE! If you make a change to `nav.ts` you will have to run `npm run build` to generate a new `docs/nav.js` file.
39
38
40
39
#### CLI Reference Section
41
-
42
40
1. Run `cargo run --features markdown-docs -p spacetimedb-cli > cli-reference.md`
43
-
2. Run `pnpm format` to ensure proper formatting. We currently don't properly render markdown backticks and bolding that are inside of headers, so we have the two replacements defined in `tools/markdown-fix.mjs` to make them look okay.
41
+
42
+
We currently don't properly render markdown backticks and bolding that are inside of headers, so do these two manual replacements to make them look okay (these have only been tested on Linux):
43
+
```bash
44
+
sed -i'' -E 's!^(##) `(.*)`$!\1 \2!' docs/cli-reference.md
45
+
sed -i'' -E 's!^(######) \*\*(.*)\*\*$!\1 <b>\2</b>!' docs/cli-reference.md
@@ -69,15 +69,15 @@ Call missing features "current limitations" and bugs "known issues."
69
69
70
70
Be up-front about what isn't implemented right now.It's better for our users to be told up front that something is broken or not done yet than for them to expect it to work and to be surprised when it doesn't.
71
71
72
-
Don't make promises, even weak ones, about what we plan to doin the future, within tutorials or reference documents.Statements about the future belong in a separate "roadmap" or "future plans" document.Our idea of "soon" is often very different from our users', and our priorities shift rapidly and frequently enough that statements about our future plans rarely end up being accurate.
72
+
Don't make promises, even weak ones, about what we plan to doin the future, within tutorials or reference documents.Statements about the future belong in a separate "roadmap" or "future plans" document.Our idea of "soon" is often very different from our users', and our priorities shift rapidly and frequently enough that statements about our future plans rarely end up being accurate.
73
73
74
74
If your document needs to describe a feature that isn't implemented yet, either rewrite to not depend on that feature, or just say that it's a "current limitation" without elaborating further.Include a workaround if there is one.
75
75
76
76
### Menu items and paths
77
77
78
78
When describing GUI elements and menu items, like the **UnityRegistry** tab, use bolded text to draw attention to any phrases that will appear in the actual UI.Readers will see this bolded text in the documentation and look for it on their screen.Where applicable, include a short description of the type or category of element, like "tab" above, or the **File** menu.This category should not be bolded, since it is not a word the reader can expect to find on their screen.
79
79
80
-
When describing a chain of accesses through menus and submenus, use the **->** thin arrow (that's `->`, a hyphen followed by a greater-than sign) as a separator, like **File->Quit** or **Window->PackageManager**.List the top-level menu first, and proceed left-to-right until you reach the option you want the user to interact with.Include all nested submenus, like **Foo->Bar->Baz->Quux**.Bold the whole sequence, including the arrows.
80
+
When describing a chain of accesses through menus and submenus, use the **->** thin arrow (that's `->`, a hyphen followed by a greater-than sign) as a separator, like **File->Quit** or **Window->PackageManager**.List the top-level menu first, and proceed left-to-right until you reach the option you want the user to interact with.Include all nested submenus, like **Foo->Bar->Baz->Quux**.Bold the whole sequence, including the arrows.
81
81
82
82
It's generally not necessary or desirable to tell users where to look for the top-level menu.You may be tempted to write something like, "Open the **File** menu in the upper left, and navigate **File->Exportas->ExportasPDF**." Do not include "in the upper left" unless you are absolutely confident that the menu will be located there on any combination of OS, version, desktop environment, window manager, theming configuration &c.Even within a single system, UI designers are known to move graphical elements around during updates, making statements like "upper left" obsolete and stale.We can generally trust our readers to be familiar with their own systems and the software they use, and none of our documents involve introducing readers to new GUI software. (E.g. the Unity tutorial is targeted at introducing SpacetimeDB to people who already know Unity.) "Open the **File** menu and navigate **File->Exportas->ExportasPDF**" is sufficient.
83
83
@@ -103,29 +103,28 @@ A client does NOT "connect to the module". A client **connects to the database**
103
103
Thisdistinctionissubtlebutimportant.Peopleknowwhatdatabasesare, andweshouldreinforcethatSpacetimeDBisadatabase."Module"isaquirkybitofvocabularyweuse to refer to collections of stored procedures.ARUNNINGAPPLICATIONISNOTCALLEDAMODULE.
104
104
105
105
Other key vocabulary:
106
-
107
106
- (SpacetimeDB) **Host**: the application that hosts **databases**.It is multi-tenant and can host many **databases** at once.
108
107
-**Client**: any application that connects to a **database**.
109
108
-**End user**: anybody using a **client**.
110
109
-**Database developer**: the person who maintains a **database**.
111
-
-DONOT refer to database developers as "users" in documentation.
112
-
Sometimes we colloquially refer to them as "our users" internally,
113
-
but it is clearer to use the term "database developers" in public.
110
+
-DONOT refer to database developers as "users" in documentation.
111
+
Sometimes we colloquially refer to them as "our users" internally,
112
+
but it is clearer to use the term "database developers" in public.
114
113
-**Table**:A set of typed, labeled **rows**.Each row stores data for a number of **columns**.Used to store data in a **database**.
115
114
-**Column**: you know what this is.
116
115
-**Row**: you know what this is.
117
-
-DONOT refer to rows as "tuples", because the term overlaps confusingly with "tuple types" in module languages.
118
-
We reserve the word "tuple" to refer to elements of these types.
116
+
-DONOT refer to rows as "tuples", because the term overlaps confusingly with "tuple types" in module languages.
117
+
We reserve the word "tuple" to refer to elements of these types.
119
118
-**Reducer**:A stored procedure that can be called remotely in order to update a **database**.
120
-
-Confusingly, reducers do not actually "reduce" data in the sense of querying and compressing it to return a result.
121
-
But it is too late to change it.C'est la vie.
119
+
-Confusingly, reducers do not actually "reduce" data in the sense of querying and compressing it to return a result.
120
+
But it is too late to change it.C'est la vie.
122
121
-**Connection**: a connection between a **client** and a **database**.Receives an **Address**.A single connection may open multiple **subscriptions**.
123
122
-**Subscription**: an active query that mirrors data from the database to a **client**.
124
123
-**Address**: identifier for an active connection.
125
124
-**Identity**:A combination of an issuing OpenIDConnect provider and an IdentityToken issued by that provider.Globally unique and public.
126
-
-Technically, "Identity" should be called "Identifier", but it is too late to change it.
127
-
-A particular **end user** may have multiple Identities issued by different providers.
128
-
-Each**database** also has an **Identity**.
125
+
-Technically, "Identity" should be called "Identifier", but it is too late to change it.
126
+
-A particular **end user** may have multiple Identities issued by different providers.
127
+
-Each**database** also has an **Identity**.
129
128
130
129
## Reference pages
131
130
@@ -145,19 +144,19 @@ Use the declarative voice when describing how code works or what it does. [For e
145
144
>
146
145
> An `ArrayList` can support multiple readers concurrently, as long as the collection is not modified.To guarantee the thread safety of the `ArrayList`, all operations must be done through the wrapper returned by the `Synchronized(IList)` method.
147
146
148
-
#### _Usually_ don't refer to the reader
147
+
#### *Usually* don't refer to the reader
149
148
150
149
Use second-person pronouns (i.e. "you") sparingly to draw attention to actions the reader should take to work around bugs or avoid footguns.Often these advisories should be pulled out into note, warning or quote-blocks. [For example](https://learn.microsoft.com/en-us/dotnet/api/system.collections.arraylist?view=net-8.0):
151
150
152
151
> Enumerating through a collection is intrinsically not a thread-safe procedure.Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception.To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads.
153
152
154
-
#### _Usually_ don't refer to "we" or "us"
153
+
#### *Usually* don't refer to "we" or "us"
155
154
156
155
Use first-person pronouns sparingly to draw attention to non-technical information like design advice.Alwaysuse the first-person plural (i.e. "we" or "us") and never the singular (i.e. "I" or "me").Often these should be accompanied by marker words like "recommend," "advise," "encourage" or "discourage." [For example](https://learn.microsoft.com/en-us/dotnet/api/system.collections.arraylist?view=net-8.0):
157
156
158
157
> We don't recommend that you use the `ArrayList` class for new development.Instead, we recommend that you use the generic `List<T>` class.
159
158
160
-
#### _Usually_AvoidPassiveVoice
159
+
#### *Usually*AvoidPassiveVoice
161
160
162
161
Use active voice rather than passive voice to avoid ambiguity regarding who is doing the action.Active voice directly attributes actions to the subject, making sentences easier to understand.For example:
163
162
@@ -169,15 +168,14 @@ The second example is more straightforward and clarifies who is performing the a
169
168
However, passive voice may be appropriate in certain contexts where the actor is either unknown or irrelevant.In these cases, the emphasis is placed on the action or result rather than the subject performing it.For example:
170
169
171
170
- "The `Dispose` method is called automatically when the object is garbage collected."
172
-
173
171
### Tables and links
174
172
175
173
Each reference page should have one or more two-column tables, where the left column are namespace-qualified names or signatures, and the right column are one-sentence descriptions.Headers are optional.If the table contains multiple different kinds of items (e.g. types and functions), the left column should include the kind as a suffix. [For example](https://learn.microsoft.com/en-us/dotnet/api/?view=net-8.0):
> | `Microsoft.CSharp.RuntimeBinder` Namespace|Provides classes and interfaces that support interoperation between DynamicLanguageRuntime and C#.|
180
-
> | `Microsoft.VisualBasic` Namespace|Contains types that support the VisualBasicRuntimeinVisualBasic.|
178
+
> | `Microsoft.VisualBasic` Namespace|Contains types that support the VisualBasicRuntimeinVisualBasic.|
181
179
182
180
The names should be code-formatted, and should be links to a page or section for that definition.The short descriptions should be the same as are used at the start of the linked page or section (see below).
183
181
@@ -209,7 +207,7 @@ When writing a section for an individual definition, start with any metadata tha
209
207
> [...]
210
208
> Implements the IList interface using an array whose size is dynamically increased as required.
211
209
212
-
Next, add a triple-backtick code block that contains just the declaration or signature of the variable, function or method you're describing.
210
+
Next, add a triple-backtick code block that contains just the declaration or signature of the variable, function or method you're describing.
213
211
214
212
What, specifically, counts as the declaration or signature is somewhat context-dependent.A good general rule is that it's everything in the source code to the left of the equals sign `=` or curly braces `{}`.You can edit this to remove implementation details (e.g. superclasses that users aren't supposed to see), or to add information that would be helpful but isn't in the source (e.g.trait bounds on generic parameters of types which aren't required to instantiate the type, but which most methods require, like `Eq+Hash` for `HashMap`). [For example](https://learn.microsoft.com/en-us/dotnet/api/system.collections.arraylist?view=net-8.0):
215
213
@@ -221,7 +219,7 @@ If necessary, this should be followed by one or more paragraphs of more in-depth
221
219
222
220
#### Examples
223
221
224
-
Next, within a subheader named "Examples," include a code block with examples.
222
+
Next, within a subheader named "Examples," include a code block with examples.
225
223
226
224
To the extent possible, this code block should be freestanding.If it depends on external definitions that aren't included in the standard library or are not otherwise automatically accessible, add a note so that users know what they need to supply themselves (e.g. that the `mod module_bindings;` referstothe `quickstart-chat` module).Donotbeafraidtopastethesame"header"or"prelude"code (e.g.atabledeclaration) intoawholebunchofcodeblocks, buttrytoavoidmakingeasy-to-missminoreditstosuch"header"code.
227
225
@@ -263,7 +261,7 @@ Add comments to this code block which describe what it does. In particular, if t
263
261
> Count: 3
264
262
> Capacity: 4
265
263
> Values: Hello World !
266
-
>
264
+
>
267
265
> */
268
266
> ```
269
267
@@ -355,7 +353,7 @@ Include even uninteresting code, like imports! You can rush through these withou
0 commit comments