docs: ♻️ Rewrite various docs pages, add null fields everywhere they were missing, make some Note and User fields mandatory

This commit is contained in:
Jesse Wierzbinski 2025-06-07 22:54:59 +02:00
parent e6f7a27d3e
commit e9b5ccd76c
No known key found for this signature in database
31 changed files with 412 additions and 148 deletions

View file

@ -39,6 +39,13 @@ The Custom Emojis extension adds support for adding personalized emojis to feder
"content": "https://cdn.example.com/emojis/happy_face.webp",
"remote": true,
"description": "A happy emoji smiling.",
"size": null,
"hash": null,
"thumbhash": null,
"width": null,
"height": null,
"fps": null,
"duration": null
}
}
}
@ -95,7 +102,8 @@ Custom Emojis can be added to any entity with text content. The extension ID is
"content": "Hello, world :happy_face:!"
}
},
"extensions": { // [!code focus:16]
...
"extensions": { // [!code focus:23]
"pub.versia:custom_emojis": {
"emojis": [
{
@ -105,6 +113,13 @@ Custom Emojis can be added to any entity with text content. The extension ID is
"content": "https://cdn.example.com/emojis/happy_face.webp",
"remote": true,
"description": "A happy emoji smiling.",
"size": null,
"hash": null,
"thumbhash": null,
"width": null,
"height": null,
"fps": null,
"duration": null
}
}
}

View file

@ -27,7 +27,7 @@ Refer to [Note](/entities/note#entity-definition)'s `group` property for how not
Text only (`text/plain`, `text/html`, etc).
</Property>
<Property name="open" type="boolean" required={false}>
<Property name="open" type="boolean" required={true}>
Whether the group is open to all users or requires approval to join.
<Note>

View file

@ -21,6 +21,7 @@ The entity defined in this document must be inserted in the `pub.versia:interact
"content": "Hello, world :happy_face:!"
}
},
...
"extensions": { // [!code focus:9]
"pub.versia:interaction_controls": {
"reply": {

View file

@ -21,7 +21,7 @@ Extensions **must not** be designed in a way that makes them required to underst
Versia extension names are composed of two parts:
- The domain name of the extension author, in reverse order. Example: `pub.versia`
- The extension name, separated by a colon. `snake_case`. Example: `likes`
- The extension name, separated by a colon, in `snake_case`. Example: `likes`
``` {{ title: "Example Extension Name" }}
pub.versia:likes
@ -30,7 +30,7 @@ pub.versia:likes
### Custom entities
Custom entities are named in the same way, but with an additional part:
- The entity name, separated by a slash. `PascalCase`. Example: `Like`
- The entity name, separated by a slash, in `PascalCase`. Example: `Like`
``` {{ title: "Example Custom Entity Type" }}
pub.versia:likes/Like
@ -49,9 +49,7 @@ Extensions can be found in two places: an [Entity](/entities#entity-definition)'
Custom extensions to the entity.
- `key`: The extension name.
- `value`: Extension data. Can be any JSON-serializable data.
Extension data can be any JSON-serializable data.
- `value`: Extension data. Can be any JSON object, following [Versia JSON rules](/json).
</Property>
</Properties>
</Col>
@ -63,6 +61,7 @@ Extensions can be found in two places: an [Entity](/entities#entity-definition)'
"id": "ed480922-b095-4f09-9da5-c995be8f5960",
"name": null,
"description": null,
"open": true,
"extensions": { // [!code focus:100]
"com.example:gps": {
"location": {
@ -85,7 +84,7 @@ Extensions can be found in two places: an [Entity](/entities#entity-definition)'
<Col>
<Properties name="CustomEntity">
<Property name="type" type="string" required={true}>
The extension type. [Must follow naming conventions](#naming).
The extension type, [following naming conventions](#naming).
</Property>
<Property name="other">
Other properties of the custom entity. These are specific to the extension, and should be documented by the extension author.

View file

@ -29,7 +29,7 @@ Note that there is no `question` field: the question should be included in the `
<Property name="multiple_choice" type="boolean" required="true">
Whether the poll allows multiple votes to be cast for different options.
</Property>
<Property name="expires_at" type="RFC3339" typeLink="/types#rfc3339">
<Property name="expires_at" type="RFC3339" typeLink="/types#rfc-3339">
RFC 3339 timestamp of when the poll ends and no more votes can be cast. If not present, the poll does not expire.
</Property>
</Properties>
@ -49,6 +49,7 @@ Note that there is no `question` field: the question should be included in the `
"content": "What is your favourite color?"
}
},
...
"extensions": { // [!code focus:28]
"pub.versia:polls": {
"options": [

View file

@ -42,13 +42,10 @@ All properties are optional.
Audio format (e.g. `audio/mpeg`).
</Property>
<Property name="pronouns" type="{ [key: LanguageCode]: Pronoun[] }" required={false}>
An array of internationalized pronouns the user uses. Can be represented as a string or an object.
An array of internationalized pronouns the user uses.
```typescript
/* e.g. "he/him" */
type ShortPronoun = string;
interface LongPronoun {
interface Pronoun {
subject: string;
object: string;
dependent_possessive: string;
@ -56,12 +53,11 @@ All properties are optional.
reflexive: string;
}
type Pronoun = ShortPronoun | LongPronoun;
/* Example: en-US or fr */
type LanguageCode = string;
```
</Property>
<Property name="birthday" type="RFC3339" required={false} typeLink="/types#rfc3339">
<Property name="birthday" type="RFC3339" required={false} typeLink="/types#rfc-3339">
User's birthday. If year is left out or set to `0000`, implementations **SHOULD** not display the year.
</Property>
<Property name="location" type="string" required={false}>
@ -92,6 +88,14 @@ All properties are optional.
"image/png": {
"content": "https://cdn.example.com/ab5081cf-b11f-408f-92c2-7c246f290593/cat_ears.png",
"remote": true,
"description": null,
"size": null,
"hash": null,
"thumbhash": null,
"width": null,
"height": null,
"fps": null,
"duration": null
}
}
],
@ -99,23 +103,53 @@ All properties are optional.
"image/png": {
"content": "https://cdn.example.com/d8c42be1-d0f7-43ef-b4ab-5f614e1beba4/rounded_square.jpeg",
"remote": true,
"description": null,
"size": null,
"hash": null,
"thumbhash": null,
"width": null,
"height": null,
"fps": null,
"duration": null
}
},
"background": {
"image/png": {
"content": "https://cdn.example.com/6492ddcd-311e-4921-9567-41b497762b09/untitled-file-0019822.png",
"remote": true,
"description": null,
"size": null,
"hash": null,
"thumbhash": null,
"width": null,
"height": null,
"fps": null,
"duration": null
}
},
"audio": {
"audio/mpeg": {
"content": "https://cdn.example.com/4da2f0d4-4728-4819-83e4-d614e4c5bebc/michael-jackson-thriller.mp3",
"remote": true,
"description": null,
"size": null,
"hash": null,
"thumbhash": null,
"width": null,
"height": null,
"fps": null,
"duration": null
}
},
"pronouns": {
"en-us": [
"he/him",
{
"subject": "he",
"object": "him",
"dependent_possessive": "his",
"independent_possessive": "his",
"reflexive": "himself"
},
{
"subject": "they",
"object": "them",