mirror of
https://github.com/supabase/supabase.git
synced 2026-12-03 23:18:57 +00:00
## Problem [#53996](https://github.com/supabase/supabase/pull/53996) passed an author review, two agent readers, and a full agent review, and still needed [#54013](https://github.com/supabase/supabase/pull/54013) to fix it. The new section repeated three sections of the same page, described worker-pool internals that a reader can't configure, and left the Functions architecture guide saying the opposite. `review-the-docs` and the style guide already named repeated facts. The rule didn't hold, for these reasons: - The Content review listed problems as examples ("they aren't the full list"), and its checklist asked only that "each problem is reported". A light review and a full one produced the same report. - No rule gave content problems a severity, and core rule 6 called style notes suggestions. - No rule covered internals the reader can't act on, or a statement on another page that says the opposite. - The review had no claim check of its own. `write-the-docs` has an accuracy pass, but a review runs on its own and can't count on the author having used that skill. `test-the-docs` runs only snippets. Tedd's own review skills filled these gaps with stricter copies of the rules, so people, Tedd, and CodeRabbit reviewed against different rules. Closes [DOCS-1806](https://linear.app/supabase/issue/DOCS-1806/the-docs-review-checks-each-claim-and-gives-each-new-sentence-a) ## Solution **The Content review in `review-the-docs` asks for a verdict on each item.** Each new and changed sentence gets a verdict, and so does the sentence right after each change. Each of these problems is a blocker: - A repeated fact - A disagreement with the docs, searched for in `apps/docs/content/` and `apps/kb/src/content/` by the behavior's terms. The published page can be the wrong one, so the Fact check decides which sentence is true, and the change fixes the wrong one - Mechanism the reader can't act on - Detail that only fits one reporter's case. The fix for one error, or an answer that depends on the reader's stack, belongs in `/kb`, per the `/docs` and `/kb` split in `write-the-docs` - An unanswered follow-up question A change longer than the ask needs is a note, because no style guide rule covers it. The review also gives a verdict on each new section's place, each new example's pattern, and each new link. The style pass counts the words of each long sentence with a script, gives a verdict on each style guide rule that applies to the changed lines, and checks the page's template and WORD_LIST. The done criterion lists each verdict, so a skipped item shows. **A new Fact check gives each claim a verdict.** Each claim gets one verdict: ran (a row in a `test-the-docs` verification report), traced to the source at the version the page uses, or unverified. When a change has more than 20 claims, or a claim needs a repo that the reviewer can't read, the review asks the user before it continues. Each path an instruction names is its own claim. A wrong claim is a blocker, and an unverified claim is a note to the author. Code runs only through `test-the-docs`, so the tutorial and example reviews ask to build example apps there, not in the reviewer's checkout. Before a wrong claim is made more exact, the review checks whether the reader needs it at all. **The `write-the-docs` accuracy pass checks that the reader needs a claim.** Its old step 3 said to add an exception the code has, or narrow the sentence, which pushed #53996 toward more internals. A new step 2 cuts a claim about mechanism the reader can't use, instead of making it more exact. An exception goes in only when it changes what the reader sees or does. The skill stays self-contained: it runs whether or not a review follows. **The style guide holds the rules the review applies.** New rules: "Document what the reader can use", "Answer the reader's next question", "Name what a command changes", "Model an example on the page's other examples", and "Put text under the heading for its topic". "Cut repeated points" now says to link to a fact that another section or page states. Required text, such as the standard SQL snippet, doesn't count as a repeat, and neither does a one-sentence term explanation or a warning that the task needs. "Link selectively" now covers two sections that send the reader to each other. The review links to each rule instead of restating it. **CodeRabbit reviews docs content against the style guide.** `.coderabbit.yaml` applies each top-level file in `apps/docs/style-guide/`, but not the templates, to `apps/docs/content/**/*.mdx` as code guidelines, so a new rule file is picked up without a config change. **Stale references.** `ask-the-docs`'s `app-map.md` and `write-the-docs` no longer point at `content/troubleshooting/`, which #52339 removed. ## Review instructions 1. Read the Content review and Fact check in `review-the-docs/SKILL.md`. 2. Check that each blocker links to a rule in `apps/docs/style-guide/`. A fresh agent ran an earlier version of the Content review and Fact check on #53996's merge commit, without seeing #54013. It requested changes and reported the problems that #54013 fixed: - The CPU cap and rotation across workers, as mechanism the reader can't act on - The same reuse fact stated four times in the section, and "runs once per worker" repeated from a later section - `guides/functions/architecture.mdx` saying "A new V8 isolate is spun up for each invocation" and "each run is stateless" It also traced each claim to `supabase/edge-runtime@v1.79.2`, and found a repeated link, a 26-word sentence, and two unverified claims. Its internals finding has a caveat: the new style guide example comes from this same case. After the review suggestions, a second fresh agent ran the current Content review and Fact check on the same commit. It found the same three problems, as blockers. It listed 17 claims, under the 20 at which the Fact check asks before it continues, so it checked each one. It reported the repeats inside the section as notes, not blockers. ## Checklist - [ ] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide) --------- Co-authored-by: Nik Richers <nik@validmind.ai> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Nik Richers <nrichers@gmail.com>
623 lines
24 KiB
Markdown
623 lines
24 KiB
Markdown
# Choose your components
|
|
|
|
Once you know what kind of information you have, this is the catalog of forms it can
|
|
take. Each entry leads with when the component is warranted, then its syntax.
|
|
|
|
"Component" means the MDX components the docs app provides, such as `<Admonition>` and
|
|
`<Tabs>`. "Element" means a plain Markdown construct, such as a list or a heading.
|
|
|
|
| If you're deciding | Read |
|
|
| -------------------------------------------------------- | --------------------------------------------- |
|
|
| Which form the information should take | [Choosing a component](#choosing-a-component) |
|
|
| How to handle admonitions, emphasis, headings, and lists | [Text](#text) |
|
|
| How to write steps, code, and tabs | [Steps and code](#steps-and-code) |
|
|
| How to show structured data or a diagram | [Data and diagrams](#data-and-diagrams) |
|
|
| How to add an image or a video | [Media](#media) |
|
|
| How to link out or list related pages | [Navigation](#navigation) |
|
|
| Which constructs to leave out | [Don't use these](#dont-use-these) |
|
|
|
|
## Choosing a component
|
|
|
|
Start from the information type, per [`03-page-structure.md`](./03-page-structure.md).
|
|
|
|
| You have | Reach for |
|
|
| ------------------------------------------------- | -------------------------------------------------- |
|
|
| Actions the reader performs in order | A [procedure](#procedures) |
|
|
| A stage-by-stage explanation | Prose, or a when/then [table](#tables) |
|
|
| The parts of something | A [table](#tables) or a [diagram](#diagrams) |
|
|
| A warning or a rule the reader must not miss | An [admonition](#admonitions) |
|
|
| A definition or an idea | Prose, a [list](#lists), or a [diagram](#diagrams) |
|
|
| Alternative instructions per platform or language | [Tabs](#tabs) |
|
|
| A curated set of links on an index page | A [content listing](#content-listings) |
|
|
|
|
When a phrase fits more than one category, pick the most specific one.
|
|
|
|
## Text
|
|
|
|
### Admonitions
|
|
|
|
#### Use an admonition for information a reader might otherwise miss
|
|
|
|
Reach for one when missing the information would change the outcome of the task. Use
|
|
one to separate helpful but optional guidance from the main flow. Don't
|
|
use one for information that belongs in the main explanation or procedure. They
|
|
highlight important information and get less effective when overused, so don't stack
|
|
them or use them as decoration.
|
|
|
|
#### Begin every admonition with its impact and purpose: the "so what."
|
|
|
|
Use the first sentence to tell the reader why the information matters: what could
|
|
happen, what changes, or what benefit they gain. Add background or instructions after
|
|
the impact is clear.
|
|
|
|
- **Recommended**: `Deleting this project permanently removes its database and backups. Export any data that you want to keep before you continue.`
|
|
- **Not recommended**: `Before you continue, there are a few things that you should know about project deletion.`
|
|
|
|
#### Don't restate an admonition in the body text
|
|
|
|
An admonition and the paragraph next to it should cover distinct points. A risk stated
|
|
twice reads as an editing mistake and trains readers to skip the box.
|
|
|
|
Choose the `type` that matches the severity:
|
|
|
|
| Type | Use for |
|
|
| ------------- | ------------------------------------------------------------------- |
|
|
| `danger` | Data loss, exposed data, or another severe, hard-to-reverse outcome |
|
|
| `deprecation` | A deprecated feature or behavior |
|
|
| `caution` | Bugs, failed operations, or unexpected results, short of `danger` |
|
|
| `note` | A prerequisite, constraint, or clarification that carries no risk |
|
|
|
|
For `danger` and `caution`, state the consequence first, then how to avoid it. For
|
|
`deprecation`, state how the change affects the reader, then the migration path. When a
|
|
note is essential to completing a step, put it in the procedure instead of an
|
|
admonition.
|
|
|
|
Structure an admonition with these props:
|
|
|
|
- `title` (optional): a short callout title. Don't put Markdown or HTML headings
|
|
inside an admonition. If the content needs a heading to structure the page, move the
|
|
heading and its section outside the admonition.
|
|
- `children`: rich body content such as paragraphs, lists, links, and code.
|
|
- `actions` (optional): standalone calls to action, kept separate from the body.
|
|
Contextual links and interactive examples stay in the body when they're part of the
|
|
explanation.
|
|
|
|
```mdx
|
|
<Admonition type="note" title="Optional title" actions={<Button>Continue</Button>}>
|
|
|
|
Your content here
|
|
|
|
</Admonition>
|
|
```
|
|
|
|
### Emphasis
|
|
|
|
#### Use bold, italics, and code for distinct purposes
|
|
|
|
Don't use them interchangeably or to add visual emphasis alone.
|
|
|
|
| Format | Use for |
|
|
| --------- | --------------------------------------------------------------- |
|
|
| **Bold** | A UI label, a term the reader must not miss, or an inline label |
|
|
| _Italics_ | A new term on first definition, or a title |
|
|
| `Code` | Anything typed, copied, or read literally by the system |
|
|
|
|
Bold covers the controls a reader interacts with, such as buttons, menu items, and
|
|
field names: `Click **Save**.` It also marks a term they can't afford to skip, as in
|
|
`**Never** commit your service role key.` The third case is the label opening a
|
|
paragraph or list item, as in `**Recommended**:`.
|
|
|
|
Use italics sparingly, and never for a UI label or for general emphasis. A title set in
|
|
italics by convention, such as a book or a third-party product, is the other case.
|
|
|
|
Code covers filenames, paths, commands, flags, environment variables, function and
|
|
parameter names, configuration keys, and literal values.
|
|
|
|
A command name is `code`, not **bold**, even though the reader also interacts with it.
|
|
|
|
Don't format for emphasis beyond these three. Screen readers announce text
|
|
modifications, so a sentence carrying several kinds of formatting is read aloud with the
|
|
formatting narrated between the words.
|
|
|
|
#### Name a control by its label
|
|
|
|
An icon has no accessible name a reader can match against what you wrote. Write `Click
|
|
**Notifications**` rather than `Click the bell icon`.
|
|
|
|
### Headings
|
|
|
|
#### Format headings in sentence case
|
|
|
|
Capitalize the first word and any proper nouns, and lowercase everything else: `Set up
|
|
authentication` rather than `Set Up Authentication`.
|
|
|
|
A heading can't carry meaning on its own. See
|
|
[`01-voice-and-tone.md`](./01-voice-and-tone.md).
|
|
|
|
Headings are also anchor targets. Other pages, `apps/www`, and Studio all deep-link into
|
|
guide anchors, so renaming a heading breaks those links. Moving a section or changing
|
|
its level preserves the anchor; only renaming breaks it.
|
|
|
|
### Lists
|
|
|
|
#### Choose the list type by whether order matters
|
|
|
|
Use an ordered list for steps taken in sequence, and an unordered list when order
|
|
doesn't matter. Use Arabic numerals (`1`, `2`, `3`) for ordered lists and dashes (`-`)
|
|
for unordered lists.
|
|
|
|
#### Point forward to a list with _the following_
|
|
|
|
When a sentence refers to a list but another sentence sits between it and the list, use
|
|
_the following_. _These_ reads as pointing back at something already on the page, so the
|
|
reader can't tell which items it means. When the referring sentence is directly before
|
|
the list, either word works.
|
|
|
|
- **Recommended**: `To open Supabase Studio, start from either of the following tabs. Each one opens a different page in Supabase:`
|
|
- **Recommended**: `Start from either of these tabs:`
|
|
- **Not recommended**: `To open Supabase Studio, start from either of these tabs. Each one opens a different page in Supabase:`
|
|
|
|
#### Prefer a paragraph to a single-item list
|
|
|
|
A list of one signals content that was meant to grow and didn't. Exceptions: layout
|
|
consistency across sibling sections, or an item that needs the visual separation.
|
|
|
|
#### Don't nest lists more than two deep
|
|
|
|
```md
|
|
1. List item
|
|
2. List item
|
|
1. List item
|
|
2. List item
|
|
3. List item
|
|
- List item
|
|
- List item
|
|
<!-- DON'T ADD ANOTHER LEVEL OF NESTING -->
|
|
- Overly nested list item
|
|
```
|
|
|
|
### Don't use these
|
|
|
|
#### Blockquotes
|
|
|
|
Use an admonition when the content needs emphasis, or prose when it doesn't.
|
|
|
|
#### Footnotes
|
|
|
|
Put the information in the sentence, or in a linked section when it's substantial enough
|
|
to need one.
|
|
|
|
#### Expandable content
|
|
|
|
For optional detail
|
|
the reader can skip, such as a long walkthrough or reference table, use an HTML native
|
|
`<details>` element with a `<summary>`. Don't hide content the reader needs to finish
|
|
the task.
|
|
|
|
```mdx
|
|
<details>
|
|
<summary>Install Postgres and psql</summary>
|
|
|
|
Content goes here, separated from the tags by blank lines.
|
|
|
|
</details>
|
|
```
|
|
|
|
## Steps and code
|
|
|
|
### Procedures
|
|
|
|
#### Use a procedure when a human or an agent must perform actions to reach an outcome
|
|
|
|
The format makes that expectation explicit.
|
|
|
|
Write sequential actions as an ordered list. **Begin each step with an imperative verb,
|
|
or with a short location phrase followed by one, and include one action or a closely
|
|
related set of actions per step.** When a step says where to act, put the location
|
|
first. Give the reader enough context to know where to act.
|
|
|
|
- **Recommended**: `Next to Supabase, click **Manage**, then click **Open in Supabase**.`
|
|
- **Not recommended**: `Click **Manage** next to Supabase, then click **Open in Supabase**.`
|
|
|
|
For how many steps to present at once and when to split a procedure into phases, see
|
|
chunking in [`03-page-structure.md`](./03-page-structure.md).
|
|
|
|
An apparent one-step procedure can become two steps when there's a real orientation
|
|
action:
|
|
|
|
1. Open a terminal in your project directory.
|
|
2. Run `supabase start`.
|
|
|
|
The first step establishes the operating context for both readers and agents. Don't add
|
|
a redundant orientation step to a genuinely atomic instruction. Write `Click **Save**.`
|
|
rather than adding `Locate the **Save** button` as a separate step.
|
|
|
|
#### Pair Dashboard steps with a terminal option
|
|
|
|
Agents can't use the Dashboard. For any change a reader makes there, also give a terminal
|
|
path, such as `psql`, the Supabase CLI, or the Management API. Put paths with separate
|
|
steps in [tabs](#tabs).
|
|
|
|
#### Name what a command changes
|
|
|
|
When a command changes something beyond its stated purpose, say so in the step. For
|
|
example, `supabase db reset` also deletes the data in the local database.
|
|
|
|
#### For every "run the following SQL" step
|
|
|
|
Paste this standard snippet before the SQL block:
|
|
|
|
```mdx
|
|
Run the following SQL using the [SQL Editor](/dashboard/project/_/sql) in the Supabase Dashboard or with `psql` over a direct connection. To connect with `psql`, see [Direct connection](/docs/guides/database/connecting-to-postgres#direct-connection).
|
|
```
|
|
|
|
### Code blocks
|
|
|
|
#### Model an example on the page's other examples
|
|
|
|
A new example, such as a code block or a table, uses the names, setup, and length of
|
|
the page's other examples, unless they break another rule in this guide. When the page
|
|
has none, follow the closest examples in the docs. Show the general rule that the text
|
|
teaches, not one reader's case.
|
|
|
|
#### Keep code lines short so the reader doesn't scroll
|
|
|
|
Split long shell commands with `\`.
|
|
|
|
JavaScript and TypeScript in code blocks are formatted by Prettier, and your pull
|
|
request is blocked from merging if the Prettier check fails. Run `pnpm format` from the
|
|
repository root, or set up automatic formatting in your editor.
|
|
|
|
#### Prefer lowercase for SQL
|
|
|
|
Write `select * from table` rather than `SELECT * FROM table`.
|
|
|
|
#### Write a placeholder in uppercase with a `YOUR_` prefix
|
|
|
|
Name the value the reader replaces, in `YOUR_UPPER_SNAKE_CASE`: `YOUR_TABLE`,
|
|
`YOUR_PROJECT_REF`. Skip angle and square brackets, which break shell, JSX, and SQL.
|
|
Say what to replace in the step that first uses it. For the project URL and keys, use
|
|
[`ProjectConfigVariables`](#show-the-readers-project-url-and-keys-with-projectconfigvariables)
|
|
instead.
|
|
|
|
- **Recommended**: `alter table YOUR_TABLE enable row level security;`
|
|
- **Not recommended**: `alter table <your-table> enable row level security;`
|
|
|
|
Optionally specify a filename after the language specifier:
|
|
|
|
````md
|
|
```ts environment.ts
|
|
|
|
```
|
|
````
|
|
|
|
Optionally highlight lines with `mark=${lineNumber}`:
|
|
|
|
````md
|
|
```js mark=12:13
|
|
|
|
```
|
|
````
|
|
|
|
#### Pull code from a source file with `$CodeSample`
|
|
|
|
Use `<$CodeSample />` to show code from a real file rather than a copy that can drift.
|
|
Paths are relative to the `examples` directory unless you use an external GitHub source:
|
|
|
|
```mdx
|
|
<$CodeSample
|
|
path="/relative/path/from/examples/directory.ts"
|
|
lines={[[1, 3], [5, -1]]}
|
|
meta="name=display/path.ts"
|
|
/>
|
|
```
|
|
|
|
For props (`convertToJs`, external repos, allowlists), see the JSDoc on
|
|
[`CodeSample.ts`](../features/directives/CodeSample.ts).
|
|
|
|
#### Group related files with `$CodeTabs`
|
|
|
|
Wrap two or more code blocks in `<$CodeTabs>` to show them as tabs:
|
|
|
|
````mdx
|
|
<$CodeTabs>
|
|
|
|
```js name=a.js
|
|
console.log('Hello, world!')
|
|
```
|
|
|
|
```js name=b.js
|
|
console.log('Goodbye, world!')
|
|
```
|
|
|
|
</$CodeTabs>
|
|
````
|
|
|
|
#### Make JavaScript and TypeScript compile so type hints show
|
|
|
|
JavaScript and TypeScript code blocks show type hints on hover. The whole block must
|
|
compile, so undefined variables or missing imports turn the hints off. Put setup code
|
|
above a `// ---cut---` line. The reader doesn't see it:
|
|
|
|
````mdx
|
|
```js
|
|
import { createClient } from '@supabase/supabase-js'
|
|
|
|
const supabase = createClient('https://example.supabase.co', 'publishable-key')
|
|
|
|
// ---cut---
|
|
const result = supabase.auth.signInWithPassword({
|
|
email: 'test@example.com',
|
|
password: 'test1234',
|
|
})
|
|
```
|
|
````
|
|
|
|
#### Show the reader's project URL and keys with `ProjectConfigVariables`
|
|
|
|
When a step needs the reader's project URL or API key, use `ProjectConfigVariables`. A
|
|
signed-in reader sees their own values:
|
|
|
|
```mdx
|
|
<ProjectConfigVariables variable="url" />
|
|
<ProjectConfigVariables variable="publishable" />
|
|
```
|
|
|
|
### Tabs
|
|
|
|
#### Use tabs for alternative instructions across platforms or languages
|
|
|
|
The same task, done differently depending on the reader's stack. Don't use tabs for
|
|
sequential content or to hide information the reader needs either way.
|
|
|
|
The optional `queryGroup` prop lets a reader link directly to a tab, such as
|
|
`/docs/my-page?packagemanager=npm`.
|
|
|
|
```mdx
|
|
<Tabs scrollable size="small" type="underlined" defaultActiveId="npm" queryGroup="packagemanager">
|
|
<TabPanel id="npm" label="npm">
|
|
|
|
// ...
|
|
|
|
</TabPanel>
|
|
<TabPanel id="yarn" label="Yarn">
|
|
|
|
// ...
|
|
|
|
</TabPanel>
|
|
</Tabs>
|
|
```
|
|
|
|
## Data and diagrams
|
|
|
|
### Tables
|
|
|
|
#### Use a table when each row shares the same set of attributes
|
|
|
|
A part and its description, a type and when to use it, an if and a then. A table with
|
|
one populated column is a list.
|
|
|
|
Keep cells short. When a cell needs more than a sentence or two, the content probably
|
|
belongs in prose with the table reduced to a summary.
|
|
|
|
#### Introduce a table in the sentence before it
|
|
|
|
Not every screen reader announces that a table is coming. A reader can land in the first
|
|
cell with no idea what the rows hold.
|
|
|
|
#### Don't merge cells
|
|
|
|
A merged cell breaks the row-and-column relationship a screen reader uses to read a
|
|
table, so the reader loses track of which heading applies. If the content needs merged
|
|
cells, it needs two tables.
|
|
|
|
### Diagrams
|
|
|
|
#### Use a diagram to support the prose
|
|
|
|
A rendered diagram reaches fewer readers than the sentence next to it, so the text near
|
|
it has to carry the takeaway on its own. A reader using a screen reader, a reader on a
|
|
slow connection, and an agent reading the markdown export all depend on that sentence.
|
|
|
|
#### Every diagram needs `accTitle` and `accDescr`
|
|
|
|
Mermaid renders them into the SVG as `<title>` and `aria-labelledby`, which is what a
|
|
screen reader announces. Without them the diagram is an unlabeled graphic. `accTitle` is
|
|
one line naming what the diagram shows; `accDescr` describes the content, and takes a
|
|
braced block when it runs past one line. See the [Mermaid accessibility
|
|
options](https://mermaid.js.org/config/accessibility.html).
|
|
|
|
Write a fenced code block with `mermaid` as the language. The MDX renderer routes these
|
|
through the shared `Mermaid` component, so theming follows light and dark mode
|
|
automatically. For the full syntax, see the [Mermaid diagram
|
|
reference](https://mermaid.js.org/intro/syntax-reference.html).
|
|
|
|
````mdx
|
|
```mermaid
|
|
sequenceDiagram accTitle: Sign-in token exchange accDescr { A user clicks Sign in. The
|
|
browser requests authorization from Supabase, and Supabase returns a token to the
|
|
browser. }
|
|
|
|
participant User participant Browser participant Supabase
|
|
|
|
User->>Browser: Clicks "Sign in" Browser->>Supabase: Request authorization
|
|
Supabase->>Browser: Return token
|
|
```
|
|
````
|
|
|
|
- Put a standard Mermaid keyword, such as `sequenceDiagram`, `flowchart`, or
|
|
`erDiagram`, on the first line. `flowchart` accepts a direction such as `LR` or `TD`.
|
|
- Write `accDescr` for someone who can't see the diagram. Name the nodes and the
|
|
relationships between them. Restating the title tells that reader nothing.
|
|
- Keep each diagram focused on a single flow or concept. Split a dense diagram into
|
|
smaller ones.
|
|
- Wrap node labels containing special characters in double quotes, including `*`, `/`,
|
|
spaces, and punctuation: `A["content/**/*.md"]`.
|
|
- Don't hardcode colors. The component themes the diagram for both modes.
|
|
|
|
A diagram whose content can't survive being described in `accDescr` and the surrounding
|
|
prose is carrying too much. Split it, or replace it with a table.
|
|
|
|
## Media
|
|
|
|
### Images
|
|
|
|
#### Use an image when the reader needs to recognize something on screen
|
|
|
|
A dashboard control that's hard to describe in words is the usual case. Upload images to
|
|
`apps/docs/public/img`.
|
|
|
|
Use `.svg` for vector illustrations and `.png` for screenshots and other non-vector
|
|
graphics. Supported browsers receive `.webp` versions automatically.
|
|
|
|
#### Redact sensitive information
|
|
|
|
Remove API keys and any other secret visible in a screenshot before you upload it.
|
|
|
|
#### Write alt text that describes the image
|
|
|
|
A topic name is what the nearby heading already says. Describe what a reader who can't
|
|
see it would need: the labeled parts, the relationships between them, and any values it
|
|
carries.
|
|
|
|
#### Every image needs an `alt` attribute
|
|
|
|
Give a decorative image an empty one, `alt=""`, so a screen reader skips it rather than
|
|
reading a filename.
|
|
|
|
#### Never put new information only in an image
|
|
|
|
Whatever the image shows has to also exist in the text, because a reader who can't see
|
|
it has no other source.
|
|
|
|
#### Don't use an image of text, code, or terminal output
|
|
|
|
Use real text, which can be read aloud, searched, copied, and translated.
|
|
|
|
### Videos
|
|
|
|
#### Include a video as a table of contents video
|
|
|
|
Don't place a video in the main text. Define it in the page frontmatter:
|
|
|
|
```yaml
|
|
---
|
|
tocVideo: 'rzglqRdZUQE'
|
|
---
|
|
```
|
|
|
|
## Navigation
|
|
|
|
### Links
|
|
|
|
#### Link selectively
|
|
|
|
Every link is a decision the reader has to make, so a page dense with them costs more
|
|
attention than it saves. When a term needs one sentence of explanation, write the
|
|
sentence instead of sending the reader away. Link the same destination once per page,
|
|
unless the page is long enough that a reader is unlikely to have seen the first one.
|
|
|
|
Don't let two sections each send the reader to the other for the answer. A
|
|
cross-reference between two halves of a split section is fine, as long as each half
|
|
gives its own part.
|
|
|
|
#### Write link text that describes the destination
|
|
|
|
Use the target's title, or a phrase that names what the reader gets. The text has to
|
|
make sense read on its own, because assistive technology can list every link on a page
|
|
out of context.
|
|
|
|
- **Recommended**: `For more information about policies, see [Row Level Security](/docs/guides/database/postgres/row-level-security).`
|
|
- **Not recommended**: `For more information about policies, [click here](/docs/guides/database/postgres/row-level-security).`
|
|
- **Not recommended**: `See [this guide](/docs/guides/database/postgres/row-level-security).`
|
|
|
|
#### Put the identifying words first, and keep the text short
|
|
|
|
Use the shortest span that still describes the destination: `see the [reference
|
|
section](/link)` rather than `[see the reference section](/link)`.
|
|
|
|
#### Never use a bare URL as link text
|
|
|
|
Name the thing instead.
|
|
|
|
- **Recommended**: `[HTTP/1.1 RFC](https://www.rfc-editor.org/rfc/rfc2616)`
|
|
- **Not recommended**: `[https://www.rfc-editor.org/rfc/rfc2616](https://www.rfc-editor.org/rfc/rfc2616)`
|
|
|
|
#### Introduce a link
|
|
|
|
Introduce a link so the reader always knows where the link goes and why it's relevant.
|
|
|
|
| Write | When |
|
|
| -------------------------------------------- | -------------------------------------------------------------- |
|
|
| `See [Title].` | The sentence before already says why the link matters |
|
|
| `For more information, see [Title].` | The title says what the reader gets, and `See` reads as abrupt |
|
|
| `For more information about X, see [Title].` | The title alone doesn't say why the link matters here |
|
|
|
|
- **Recommended**: ``The `anon` role handles requests from users who aren't signed in. See [Postgres roles](/docs/guides/database/postgres/roles).``
|
|
- **Recommended**: `For more information about policies, see [Row Level Security](/docs/guides/database/postgres/row-level-security).`
|
|
- **Not recommended**: `For more information about Row Level Security, see [Row Level Security](/docs/guides/database/postgres/row-level-security).`
|
|
|
|
#### Keep sentence punctuation outside the link
|
|
|
|
Write `see [Test your code](/link).` rather than `see [Test your code.](/link)`.
|
|
|
|
#### Say when a link does something the reader won't expect
|
|
|
|
A download, a new tab, or a jump within the page should be named in the link text or the
|
|
sentence around it.
|
|
|
|
#### Say when a link leaves Supabase docs
|
|
|
|
Name the destination in the sentence rather than relying on an icon: `refer to the Postgres
|
|
documentation on [row security
|
|
policies](https://www.postgresql.org/docs/current/ddl-rowsecurity.html)`.
|
|
|
|
#### Don't include the `https://supabase.com` origin
|
|
|
|
For pages on `supabase.com`, link with a path. Use a `/docs/...` path for a page in
|
|
Supabase docs, such as `[getting started](/docs/guides/getting-started)`. Use a
|
|
site-root path for a page outside docs, such as `[open the Supabase
|
|
Dashboard](/dashboard)`.
|
|
|
|
#### Link to a section with its anchor
|
|
|
|
Within a page, name the section: `see the [Links](#links) section of this document`.
|
|
Across pages, append the anchor to the path:
|
|
`[Chunking](./03-page-structure.md#chunking)`. Anchors come from heading text, so
|
|
renaming a heading breaks every link to it. See [Headings](#headings).
|
|
|
|
For when to cross-reference a section rather than repeat it, see [Navigation and
|
|
glue](./03-page-structure.md#navigation-and-glue).
|
|
|
|
### Partials
|
|
|
|
#### Reuse shared content with `$Partial`
|
|
|
|
If you copy the same content across files, put it in
|
|
[`apps/docs/content/_partials`](../content/_partials) and include it with `$Partial`:
|
|
|
|
```mdx
|
|
<$Partial path="path/to/file.mdx" variables={{ "substitute": "this" }} />
|
|
```
|
|
|
|
In the partial, write `{{ .substitute }}` where the value goes. Only string replacement
|
|
is supported. For anything more complex, make a custom component.
|
|
|
|
### Content listings
|
|
|
|
#### Use a content listing on an overview or index page
|
|
|
|
A content listing holds a curated set of links, such as "Get started", "Next steps",
|
|
"Examples", or "Resources". Place the component inline in the guide MDX:
|
|
|
|
```mdx
|
|
<ContentListings id="storage-get-started" />
|
|
```
|
|
|
|
Use a partial only when the block is reused or gated with `$Show` at the partial level.
|
|
For an individual item that depends on a feature flag, set `feature` on the item rather
|
|
than wrapping the whole listing.
|
|
|
|
For the data file, ID uniqueness rules, and the test command, see
|
|
[CONTRIBUTING.md](../CONTRIBUTING.md).
|