Skip to content

Commit 867e042

Browse files
committed
docs: 🐛 restore docs pages reformatted by mistake
The previous commit ran the code formatter over every MDX page. Only the user format page's profile preview section and its screenshots change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CnAiFbA6iCLzpJ2F55jPdT
1 parent c3b56ac commit 867e042

356 files changed

Lines changed: 6852 additions & 7458 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/web/content/docs/brand/pet.mdx‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Import `Pet` from core and pick a `state`. The pet scales to its box, so size it
1616
with Tailwind classes. Keep roughly a 7:8 width-to-height ratio.
1717

1818
```tsx title="welcome.tsx"
19-
import { Pet } from "@vitnode/core/components/pet/pet";
19+
import { Pet } from '@vitnode/core/components/pet/pet'
2020

21-
export const Welcome = () => <Pet className="h-44 w-40" state="hello" />;
21+
export const Welcome = () => <Pet className="h-44 w-40" state="hello" />
2222
```
2323

2424
## States
@@ -60,23 +60,23 @@ title together, not the decorative digits.
6060

6161
## Props
6262

63-
import { TypeTable } from "fumadocs-ui/components/type-table";
63+
import { TypeTable } from 'fumadocs-ui/components/type-table'
6464

6565
<TypeTable
6666
type={{
6767
state: {
68-
description: "Which pose and animation to show.",
69-
type: "PetState",
68+
description: 'Which pose and animation to show.',
69+
type: 'PetState',
7070
default: "'idle'",
7171
},
7272
label: {
7373
description:
74-
"Accessible name. Without it, the pet is decorative and hidden from screen readers.",
75-
type: "string",
74+
'Accessible name. Without it, the pet is decorative and hidden from screen readers.',
75+
type: 'string',
7676
},
7777
className: {
78-
description: "Classes for the SVG, usually its size.",
79-
type: "string",
78+
description: 'Classes for the SVG, usually its size.',
79+
type: 'string',
8080
},
8181
}}
8282
/>

‎apps/web/content/docs/content-engine/access-api.mdx‎

Lines changed: 49 additions & 51 deletions
Large diffs are not rendered by default.

‎apps/web/content/docs/content-engine/access-behavior.mdx‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ Roles are read from the database for each request, never from a cached session.
2020

2121
## Where the rules apply
2222

23-
| Path | Behavior |
24-
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
23+
| Path | Behavior |
24+
| -------------------------------------- | ---------------------------------------------------------------------------------------------- |
2525
| Public lists, detail, thread, delivery | Records the reader may not read are left out before pagination, so pages, cursors and totals never count them |
26-
| Detail of a record in a hidden scope | `404`, the same as a record that never existed |
27-
| Detail in a scope the reader may see | `403` with `{ accessRequired: true, code: "CONTENT_ACCESS_REQUIRED" }` and nothing else |
28-
| Container list and detail | Hidden containers are left out, children included; every container carries `access` flags |
29-
| Writes, edits, hide, delete, reports | Checked again on the server: a reply needs **Comment**, anything else **Read** |
26+
| Detail of a record in a hidden scope | `404`, the same as a record that never existed |
27+
| Detail in a scope the reader may see | `403` with `{ accessRequired: true, code: "CONTENT_ACCESS_REQUIRED" }` and nothing else |
28+
| Container list and detail | Hidden containers are left out, children included; every container carries `access` flags |
29+
| Writes, edits, hide, delete, reports | Checked again on the server: a reply needs **Comment**, anything else **Read** |
3030
| `GET /permissions` | Leaves out records the reader may not read; adds `canView`, `canRead`, `canComment`, `canDownloadAttachments` |
31-
| Sitemaps | Only what a guest may read, in every language |
32-
| Notifications and emails | Each recipient must be able to read the record when it is sent and every time the inbox loads |
31+
| Sitemaps | Only what a guest may read, in every language |
32+
| Notifications and emails | Each recipient must be able to read the record when it is sent and every time the inbox loads |
3333

3434
Staff permissions grant nothing here. A moderator reads a restricted forum on the public site only when an access rule lets one of their roles in; give your moderator role access explicitly. The same goes for a **root role**. Tick it in the **Access** dialog wherever it should get in. The AdminCP and ModCP are staff areas behind their own permissions, so moderators keep reviewing reports and approvals there. A pending approval follows its record to its new container when the record moves, so it reaches that container's moderators.
3535

‎apps/web/content/docs/content-engine/access-categories.mdx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ The article editor shows **Who can see this** under the categories field. It ask
9898

9999
An article needs **all** of its categories' rules. Inside one category, a member with **any** of the ticked roles gets in; across categories, the rules add up:
100100

101-
| Category A | Category B | Who can read the article |
102-
| ------------ | ---------- | ----------------------------------- |
103-
| Everyone | Everyone | Everyone |
104-
| Everyone | VIP | Members with VIP |
105-
| VIP | Staff | Members with both VIP and Staff |
106-
| VIP or Staff | Members | Signed-in members with VIP or Staff |
101+
| Category A | Category B | Who can read the article |
102+
| ------------- | ------------- | --------------------------------------- |
103+
| Everyone | Everyone | Everyone |
104+
| Everyone | VIP | Members with VIP |
105+
| VIP | Staff | Members with both VIP and Staff |
106+
| VIP or Staff | Members | Signed-in members with VIP or Staff |
107107

108108
Adding a category can only narrow who reads an article, never widen it. The article editor warns about this under **Who can see this**.
109109

‎apps/web/content/docs/content-engine/access.mdx‎

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ This guide uses the Forum plugin: the `forum.forums` collection, topics filed in
3434

3535
Each container has one rule per action. An action needs the one above it, so a role allowed to comment but not to read still cannot comment.
3636

37-
| Action | What it allows | Needs |
38-
| ------------------------ | ---------------------------------------------------------------------------- | ----- |
39-
| **View** | See that the forum exists: its name and description in lists and breadcrumbs | - |
40-
| **Read** | Open its topics, find them in search, Discover and profiles | View |
41-
| **Comment** | Reply to its topics | Read |
42-
| **Download attachments** | Download protected files attached to what the reader can read | Read |
37+
| Action | What it allows | Needs |
38+
| ------------------------ | --------------------------------------------------------------------------- | ------ |
39+
| **View** | See that the forum exists: its name and description in lists and breadcrumbs | - |
40+
| **Read** | Open its topics, find them in search, Discover and profiles | View |
41+
| **Comment** | Reply to its topics | Read |
42+
| **Download attachments** | Download protected files attached to what the reader can read | Read |
4343

4444
Each rule lets in one of three audiences: everyone (**Guests** too), **Signed-in members** only, or only members holding at least one of the ticked **Roles**, as a primary or secondary role. Root roles such as Administrator get no special pass. They are rows like any other, so untick them to keep them out. Access rules only add restrictions. Replying still needs a signed-in member and the forum's [publishing rules](/docs/content-engine/container-policies), whatever **Comment** says.
4545

@@ -89,10 +89,7 @@ export const forumContainers = defineContentContainer({
8989
`access: true` starts every action open to everyone, so nothing changes until an administrator restricts a forum. To start stricter, pass defaults instead, such as `access: { defaults: { comment: { mode: "members" } } }`.
9090

9191
<Callout type="warn">
92-
Turn access on only when every custom route of the plugin that reads topics or
93-
comments goes through the Content Engine's public services or
94-
`createContentAccess(c)`. A route that queries the table directly ignores the
95-
rules. The Forum plugin's stats and topic routes already do this.
92+
Turn access on only when every custom route of the plugin that reads topics or comments goes through the Content Engine's public services or `createContentAccess(c)`. A route that queries the table directly ignores the rules. The Forum plugin's stats and topic routes already do this.
9693
</Callout>
9794

9895
</Step>
@@ -135,11 +132,11 @@ A child can be stricter than its parent, never more open: to reach "VIP", a memb
135132

136133
With "General" left on **Inherit** beside it:
137134

138-
| Visitor | Members | General | VIP |
139-
| --------------------------- | ------- | ------- | --- |
140-
| Guest | No | No | No |
141-
| Member without the VIP role | Yes | Yes | No |
142-
| Member with the VIP role | Yes | Yes | Yes |
135+
| Visitor | Members | General | VIP |
136+
| ----------------------------- | ------- | ------- | --- |
137+
| Guest | No | No | No |
138+
| Member without the VIP role | Yes | Yes | No |
139+
| Member with the VIP role | Yes | Yes | Yes |
143140

144141
</Step>
145142

‎apps/web/content/docs/content-engine/activity-logs.mdx‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ description: How VitNode records every Content Engine write in the Activity Logs
44
icon: FileClock
55
---
66

7-
import { ImgDocs } from "@/components/fumadocs/img";
7+
import { ImgDocs } from '@/components/fumadocs/img'
88

9-
import contentPanel from "./activity-logs-content-panel.webp";
9+
import contentPanel from './activity-logs-content-panel.webp'
1010

1111
Every content type is audited out of the box, no code required. Creating,
1212
editing, deleting, duplicating, publishing, hiding, restoring, scheduling and
@@ -95,18 +95,18 @@ Auditing is on by default. Pass `audit` to `defineContentType` to keep noisy
9595
fields out of the recorded changes, or `false` to turn it off.
9696

9797
```ts title="plugins/shop/src/content/product.ts"
98-
import { defineContentType, field } from "@vitnode/core/content";
98+
import { defineContentType, field } from '@vitnode/core/content'
9999

100100
export const productContentType = defineContentType({
101-
id: "shop.product",
102-
tableName: "shop_products",
101+
id: 'shop.product',
102+
tableName: 'shop_products',
103103
fields: {
104104
name: field.text({ required: true, maxLength: 200 }),
105105
stock: field.number({ integer: true, required: true }),
106106
},
107107
// Stock moves with every order; the entry still says the product changed.
108-
audit: { excludeFields: ["stock"] }, // [!code ++]
109-
});
108+
audit: { excludeFields: ['stock'] }, // [!code ++]
109+
})
110110
```
111111

112112
| Option | Type | Default | Description |
@@ -136,20 +136,20 @@ inside `RouteMessages` with the Activity Logs messages and your plugin's
136136
content labels:
137137

138138
```tsx title="plugins/blog/src/views/admin/category-activity.tsx"
139-
import { RouteMessages } from "@vitnode/core/tanstack/i18n";
140-
import { ActivityHistory } from "@vitnode/core/views/activity-logs/activity-history";
139+
import { RouteMessages } from '@vitnode/core/tanstack/i18n'
140+
import { ActivityHistory } from '@vitnode/core/views/activity-logs/activity-history'
141141

142142
export const CategoryActivity = ({ categoryId }: { categoryId: number }) => (
143143
<RouteMessages
144-
namespaces={["core.activity_logs", "core.global", "@vitnode/blog.content"]}
144+
namespaces={['core.activity_logs', 'core.global', '@vitnode/blog.content']}
145145
>
146146
<ActivityHistory
147147
pluginId="@vitnode/blog"
148148
targetId={categoryId}
149149
targetType="blog.category"
150150
/>
151151
</RouteMessages>
152-
);
152+
)
153153
```
154154

155155
`ActivityHistory` reads `GET /admin/activity-logs/entity`, so it shows entries

‎apps/web/content/docs/content-engine/admincp.mdx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ Every mistake here, such as an unknown field or a gallery in `columns`, throws a
6464

6565
### Other `admin` options
6666

67-
| Option | Default | What it does |
68-
| ------------------ | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
67+
| Option | Default | What it does |
68+
| ------------------ | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
6969
| `path` | The id with dots as slashes | URL under `/admin/`. Lowercase segments of letters, digits and dashes; cannot start with `core` or end in `create` or `edit`. |
70-
| `titleField` | First shared text or textarea field | Names a record in toasts, dialogs and relation pickers. `null` means the type has no title. |
71-
| `colorField` | none | A shared field with a color, shown as a swatch next to the title. The blog's categories use it. |
72-
| `navigation` | `true` | Set it to `false` to keep the screen but drop its sidebar link. |
73-
| `permissionModule` | The id without the plugin part | Staff permission module name, for example `story` for `newsroom.story`. |
70+
| `titleField` | First shared text or textarea field | Names a record in toasts, dialogs and relation pickers. `null` means the type has no title. |
71+
| `colorField` | none | A shared field with a color, shown as a swatch next to the title. The blog's categories use it. |
72+
| `navigation` | `true` | Set it to `false` to keep the screen but drop its sidebar link. |
73+
| `permissionModule` | The id without the plugin part | Staff permission module name, for example `story` for `newsroom.story`. |
7474

7575
## Bulk actions
7676

‎apps/web/content/docs/content-engine/approval-notices.mdx‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ The newsroom tutorial's articles are not filed in a container, so `approval` is
4646

4747
With approval on, an edit page handles three different things. Keep them apart, or the author will think a change is live when it is not:
4848

49-
| What | Where it comes from | Readers see it |
50-
| --------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------ |
51-
| **Live values** | `record.values` from `GET /{id}/edit` and `PATCH /{id}` | Yes |
52-
| **Proposed values** | `record.approval.values`, when `approval.status` is `"pending"` and `approval.kind` is `"edit"` | No, until a moderator approves |
53-
| **A save that waits** | `PATCH /{id}` answers `200` with `approval.status: "pending"`; `values` is still the live record | No |
49+
| What | Where it comes from | Readers see it |
50+
| --- | --- | --- |
51+
| **Live values** | `record.values` from `GET /{id}/edit` and `PATCH /{id}` | Yes |
52+
| **Proposed values** | `record.approval.values`, when `approval.status` is `"pending"` and `approval.kind` is `"edit"` | No, until a moderator approves |
53+
| **A save that waits** | `PATCH /{id}` answers `200` with `approval.status: "pending"`; `values` is still the live record | No |
5454

5555
<Steps>
5656

@@ -247,10 +247,7 @@ The forum keeps the notice labels under `topics.approval` and the toast under `t
247247
"title": "Sent for approval",
248248
"desc": "A moderator will review your changes. Readers see the published version until then."
249249
},
250-
"success": {
251-
"title": "Topic saved",
252-
"desc": "\"{title}\" is up to date."
253-
}
250+
"success": { "title": "Topic saved", "desc": "\"{title}\" is up to date." }
254251
}
255252
}
256253
}

0 commit comments

Comments
 (0)