Skip to content

Commit 4cca832

Browse files
committed
Reverted top level .md changes
1 parent 8783cbc commit 4cca832

File tree

3 files changed

+448
-496
lines changed

3 files changed

+448
-496
lines changed

docs/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
## Migration note
2-
32
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.
43

54
## SpacetimeDB Documentation
@@ -38,9 +37,13 @@ git push -u origin a-branch-name-that-describes-my-change
3837
> 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.
3938
4039
#### CLI Reference Section
41-
4240
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
46+
```
4447

4548
### Checking Links
4649

docs/STYLE.md

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ concrete situation.
3838

3939
For example:
4040

41-
> To find rows in a table _table_ with a given value in a `#[unique]` or `#[primary_key]` column, do:
41+
> To find rows in a table *table* with a given value in a `#[unique]` or `#[primary_key]` column, do:
4242
>
4343
> ```rust
4444
> ctx.db.{table}().{column}().find({value})
4545
> ```
4646
>
47-
> where _column_ is the name of the unique column and _value_ is the value you're looking for in that column.
47+
> where *column* is the name of the unique column and *value* is the value you're looking for in that column.
4848
> For example:
4949
>
5050
> ```rust
@@ -69,15 +69,15 @@ Call missing features "current limitations" and bugs "known issues."
6969
7070
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.
7171
72-
Don't make promises, even weak ones, about what we plan to do in 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 do in 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.
7373
7474
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.
7575
7676
### Menu items and paths
7777
7878
When describing GUI elements and menu items, like the **Unity Registry** 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.
7979
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 -> Package Manager**. 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 -> Package Manager**. 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.
8181
8282
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 -> Export as -> Export as PDF**." 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 -> Export as -> Export as PDF**" is sufficient.
8383
@@ -103,29 +103,28 @@ A client does NOT "connect to the module". A client **connects to the database**
103103
This distinction is subtle but important. People know what databases are, and we should reinforce that SpacetimeDB is a database. "Module" is a quirky bit of vocabulary we use to refer to collections of stored procedures. A RUNNING APPLICATION IS NOT CALLED A MODULE.
104104
105105
Other key vocabulary:
106-
107106
- (SpacetimeDB) **Host**: the application that hosts **databases**. It is multi-tenant and can host many **databases** at once.
108107
- **Client**: any application that connects to a **database**.
109108
- **End user**: anybody using a **client**.
110109
- **Database developer**: the person who maintains a **database**.
111-
- DO NOT 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+
- DO NOT 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.
114113
- **Table**: A set of typed, labeled **rows**. Each row stores data for a number of **columns**. Used to store data in a **database**.
115114
- **Column**: you know what this is.
116115
- **Row**: you know what this is.
117-
- DO NOT 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+
- DO NOT 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.
119118
- **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.
122121
- **Connection**: a connection between a **client** and a **database**. Receives an **Address**. A single connection may open multiple **subscriptions**.
123122
- **Subscription**: an active query that mirrors data from the database to a **client**.
124123
- **Address**: identifier for an active connection.
125124
- **Identity**: A combination of an issuing OpenID Connect provider and an Identity Token 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**.
129128
130129
## Reference pages
131130
@@ -145,19 +144,19 @@ Use the declarative voice when describing how code works or what it does. [For e
145144
>
146145
> 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.
147146
148-
#### _Usually_ don't refer to the reader
147+
#### *Usually* don't refer to the reader
149148
150149
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):
151150
152151
> 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.
153152
154-
#### _Usually_ don't refer to "we" or "us"
153+
#### *Usually* don't refer to "we" or "us"
155154
156155
Use first-person pronouns sparingly to draw attention to non-technical information like design advice. Always use 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):
157156
158157
> We don't recommend that you use the `ArrayList` class for new development. Instead, we recommend that you use the generic `List<T>` class.
159158
160-
#### _Usually_ Avoid Passive Voice
159+
#### *Usually* Avoid Passive Voice
161160
162161
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:
163162
@@ -169,15 +168,14 @@ The second example is more straightforward and clarifies who is performing the a
169168
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:
170169
171170
- "The `Dispose` method is called automatically when the object is garbage collected."
172-
173171
### Tables and links
174172
175173
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):
176174
177-
> | Name | Description |
178-
> | ------------------------------------------ | ---------------------------------------------------------------------------------------------------- |
175+
> | Name | Description |
176+
> |-|-|
179177
> | `Microsoft.CSharp.RuntimeBinder` Namespace | Provides classes and interfaces that support interoperation between Dynamic Language Runtime and C#. |
180-
> | `Microsoft.VisualBasic` Namespace | Contains types that support the Visual Basic Runtime in Visual Basic. |
178+
> | `Microsoft.VisualBasic` Namespace | Contains types that support the Visual Basic Runtime in Visual Basic. |
181179
182180
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).
183181
@@ -209,7 +207,7 @@ When writing a section for an individual definition, start with any metadata tha
209207
> [...]
210208
> Implements the IList interface using an array whose size is dynamically increased as required.
211209
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.
213211
214212
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):
215213
@@ -221,7 +219,7 @@ If necessary, this should be followed by one or more paragraphs of more in-depth
221219
222220
#### Examples
223221
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.
225223
226224
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;` refers to the `quickstart-chat` module). Do not be afraid to paste the same "header" or "prelude" code (e.g. a table declaration) into a whole bunch of code blocks, but try to avoid making easy-to-miss minor edits to such "header" code.
227225
@@ -263,7 +261,7 @@ Add comments to this code block which describe what it does. In particular, if t
263261
> Count: 3
264262
> Capacity: 4
265263
> Values: Hello World !
266-
>
264+
>
267265
> */
268266
> ```
269267
@@ -355,7 +353,7 @@ Include even uninteresting code, like imports! You can rush through these withou
355353
> use spacetimedb::{table, reducer, Table, ReducerContext, Identity, Timestamp};
356354
> ```
357355
358-
For code that _is_ interesting, after the code block, add a description of what the code does. Usually this will be pretty succinct, as the code should hopefully be pretty clear on its own.
356+
For code that *is* interesting, after the code block, add a description of what the code does. Usually this will be pretty succinct, as the code should hopefully be pretty clear on its own.
359357
360358
### Words for telling the user to write code
361359

0 commit comments

Comments
 (0)