docs: Add new Groups system

This commit is contained in:
Jesse Wierzbinski 2024-04-22 13:55:10 -10:00
parent 9e0969f332
commit e14cc85890
No known key found for this signature in database
6 changed files with 237 additions and 117 deletions

View file

@ -1,108 +1,137 @@
import { defineConfig } from 'vitepress' import { defineConfig } from "vitepress";
// https://vitepress.dev/reference/site-config // https://vitepress.dev/reference/site-config
export default defineConfig({ export default defineConfig({
title: "Lysand Documentation", title: "Lysand Documentation",
description: "Documentation for Lysand, a new federated protocol", description: "Documentation for Lysand, a new federated protocol",
srcDir: 'docs', srcDir: "docs",
themeConfig: { themeConfig: {
// https://vitepress.dev/reference/default-theme-config // https://vitepress.dev/reference/default-theme-config
nav: [ nav: [
{ text: 'Home', link: '/' }, { text: "Home", link: "/" },
{ text: 'Specification', link: '/spec' }, { text: "Specification", link: "/spec" },
], ],
sidebar: [ sidebar: [
{ {
text: 'Spec Details', text: "Spec Details",
items: [ items: [{ text: "Spec", link: "/spec" }],
{ text: 'Spec', link: '/spec' },
]
}, },
{ {
text: "Structures", text: "Structures",
items: [ items: [
{ text: "Content Format", link: '/structures/content-format' }, {
{ text: "Custom Emoji", link: '/structures/custom-emoji' }, text: "Content Format",
{ text: "Collection", link: '/structures/collection' }, link: "/structures/content-format",
] },
{ text: "Custom Emoji", link: "/structures/custom-emoji" },
{ text: "Collection", link: "/structures/collection" },
],
},
{
text: "Groups",
link: "/groups",
}, },
{ {
text: "Cryptography", text: "Cryptography",
items: [ items: [
{ text: "Keys", link: "/cryptography/keys" }, { text: "Keys", link: "/cryptography/keys" },
{ text: "Signing", link: "/cryptography/signing" }, { text: "Signing", link: "/cryptography/signing" },
] ],
}, },
{ {
text: "Objects", text: "Objects",
link: "/objects", link: "/objects",
items: [ items: [
{ {
text: "Publications", link: "/objects/publications", items: [ text: "Publications",
link: "/objects/publications",
items: [
{ text: "Note", link: "/objects/note" }, { text: "Note", link: "/objects/note" },
{ text: "Patch", link: "/objects/patch" }, { text: "Patch", link: "/objects/patch" },
] ],
}, },
{ {
text: "Actors", link: "/objects/actors", items: [ text: "Actors",
{ text: "User", link: "/objects/user" }, link: "/objects/actors",
] items: [{ text: "User", link: "/objects/user" }],
}, },
{ {
text: "Actions", link: "/objects/actions", items: [ text: "Actions",
link: "/objects/actions",
items: [
{ text: "Like", link: "/objects/like" }, { text: "Like", link: "/objects/like" },
{ text: "Dislike", link: "/objects/dislike" }, { text: "Dislike", link: "/objects/dislike" },
{ text: "Follow", link: "/objects/follow" }, { text: "Follow", link: "/objects/follow" },
{ text: "FollowAccept", link: "/objects/follow-accept" }, {
{ text: "FollowReject", link: "/objects/follow-reject" }, text: "FollowAccept",
link: "/objects/follow-accept",
},
{
text: "FollowReject",
link: "/objects/follow-reject",
},
{ text: "Announce", link: "/objects/announce" }, { text: "Announce", link: "/objects/announce" },
{ text: "Undo", link: "/objects/undo" }, { text: "Undo", link: "/objects/undo" },
] ],
}, },
{ text: "Server Metadata", link: "/objects/server-metadata" } {
] text: "Server Metadata",
link: "/objects/server-metadata",
},
],
}, },
{ {
text: "Federation", text: "Federation",
items: [ items: [
{ text: "Endpoints", link: "/federation/endpoints" }, { text: "Endpoints", link: "/federation/endpoints" },
{ text: "User Discovery", link: "/federation/user-discovery" }, {
text: "User Discovery",
link: "/federation/user-discovery",
},
{ text: "Server Actors", link: "/federation/server-actor" }, { text: "Server Actors", link: "/federation/server-actor" },
] ],
}, },
{ {
text: "Extensions", text: "Extensions",
link: "/extensions", link: "/extensions",
items: [ items: [
{ text: "Custom Emojis", link: "/extensions/custom-emojis" }, {
text: "Custom Emojis",
link: "/extensions/custom-emojis",
},
{
text: "Microblogging",
link: "/extensions/microblogging",
},
{ text: "Reactions", link: "/extensions/reactions" }, { text: "Reactions", link: "/extensions/reactions" },
{ text: "Polls", link: "/extensions/polls" }, { text: "Polls", link: "/extensions/polls" },
{ text: "Is Cat", link: "/extensions/is-cat" }, { text: "Is Cat", link: "/extensions/is-cat" },
{ text: "Server Endorsements", link: "/extensions/server-endorsement" }, {
text: "Server Endorsements",
link: "/extensions/server-endorsement",
},
{ text: "Events", link: "/extensions/events" }, { text: "Events", link: "/extensions/events" },
{ text: "Reports", link: "/extensions/reports" }, { text: "Reports", link: "/extensions/reports" },
{ text: "Vanity", link: "/extensions/vanity" }, { text: "Vanity", link: "/extensions/vanity" },
] ],
} },
], ],
socialLinks: [ socialLinks: [
{ icon: 'github', link: 'https://github.com/lysand-org/' } { icon: "github", link: "https://github.com/lysand-org/" },
], ],
search: { search: {
provider: "local", provider: "local",
}, },
editLink: { editLink: {
pattern: "https://github.com/lysand-org/docs/edit/main/docs/:path" pattern: "https://github.com/lysand-org/docs/edit/main/docs/:path",
}, },
logo: "/logo.png", logo: "/logo.png",
}, },
lastUpdated: true, lastUpdated: true,
cleanUrls: true, cleanUrls: true,
titleTemplate: ":title · Lysand 2.0 Docs", titleTemplate: ":title · Lysand 2.0 Docs",
head: [ head: [["link", { rel: "icon", href: "/favicon.png", type: "image/png" }]],
['link', { rel: 'icon', href: '/favicon.png', type: 'image/png' }] lang: "en-US",
], });
lang: 'en-US',
})

20
biome.json Normal file
View file

@ -0,0 +1,20 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
"organizeImports": {
"enabled": true,
"ignore": ["node_modules", "dist", "cache"]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
},
"ignore": ["node_modules", "dist", "cache"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 4,
"ignore": ["node_modules", "dist", "cache"]
}
}

BIN
bun.lockb

Binary file not shown.

View file

@ -2,7 +2,7 @@
> [!WARNING] > [!WARNING]
> >
> Before Lysand 3.0, microblogging was directly integrated into the core spec. As of Lysand 3.0, microblogging has been moved to an extension, as part of a larger effort to modularization. This document describes the new microblogging extension. > Before Lysand 3.0, microblogging was directly integrated into the core spec. As of Lysand 3.0, microblogging has been moved to an extension, as part of a larger modularization effort. This document describes the new microblogging extension.
The Microblogging extension allows users to perform certain tasks related to microblogging, such as "boosting" (reposting) posts. The Microblogging extension allows users to perform certain tasks related to microblogging, such as "boosting" (reposting) posts.
@ -35,7 +35,7 @@ Here's an example of an `Announce` action:
| :----- | :----- | :------- | | :----- | :----- | :------- |
| author | String | Yes | | author | String | Yes |
URI of the [Actor](../objects/actors) who initiated the action. URI of the [Actor](./actors) who initiated the action.
#### Object #### Object
@ -43,9 +43,9 @@ URI of the [Actor](../objects/actors) who initiated the action.
| :----- | :----- | :------- | | :----- | :----- | :------- |
| object | String | Yes | | object | String | Yes |
URI of the object being announced. Must be of type [Note](../objects/note) URI of the object being announced. Must be of type [Note](./note)
### Implementation #### Implementation
When a [Note](../objects/note) object is announced, the client **SHOULD** display the original note with an indicator that it has been announced. The client **SHOULD** also display the number of times the note has been announced, such as a number next to a small icon like such on [Mastodon](https://joinmastodon.org/): When a [Note](../objects/note) object is announced, the client **SHOULD** display the original note with an indicator that it has been announced. The client **SHOULD** also display the number of times the note has been announced, such as a number next to a small icon like such on [Mastodon](https://joinmastodon.org/):
@ -57,8 +57,8 @@ Furthermore, users should be notified when their notes are announced by other us
## Types ## Types
```typescript ```typescript
interface Announce extends Entity { interface Announce extends Extension {
type: "Announce"; extension_type: "org.lysand:microblogging/Announce";
author: string; author: string;
object: string; object: string;
} }

69
docs/groups.md Normal file
View file

@ -0,0 +1,69 @@
# Groups
Groups are a way to organize the visibility of objects on the server. Groups can be thought of as something similar to a Matrix room or a Discord channel, while also being similar to a Mastodon list.
> [!NOTE]
> Groups replace the old "visibility" system for Notes, which was designed for a microblogging context. Groups are more flexible and can be used for any application.
>
> Notes can still use visibility in cases where groups are not needed with the `followers` and `public` group URIs.
# Group Entity
The group entity encapsulates the details of a group. It adheres to the following structure:
```json5
{
"type": "Group",
"id": "ed480922-b095-4f09-9da5-c995be8f5960",
"uri": "https://example.com/groups/ed480922-b095-4f09-9da5-c995be8f5960",
"name": {
"text/html": {
"content": "The <strong>Woozy</strong> fan club"
}
},
"description": {
"text/plain": {
"content": "A group for fans of the Woozy emoji."
}
},
"members": "https://example.com/groups/ed480922-b095-4f09-9da5-c995be8f5960/members",
}
```
## Fields
### Name
| Name | Type | Required |
| :--- | :------------ | :------- |
| name | ContentFormat | No |
The name of the group. This field is optional. Can contain custom emojis, like most other text fields.
### Description
| Name | Type | Required |
| :---------- | :------------ | :------- |
| description | ContentFormat | No |
A description of the group. This field is optional. Can contain custom emojis, like most other text fields.
### Members
| Name | Type | Required |
| :------ | :----- | :------- |
| members | String | Yes |
The URI of the group's members list. This field is required. Resolves to a [Collection](./structures/collection) of [User](./objects/user) objects.
## Implementation
`Note` objects can be posted to groups by setting the `group` field to the URI of the group. If there is no `group` field, the note is posted to whoever is mentioned in the `to` field.
Other values for `group` are:
- `public` for public notes, which can be seen by anyone.
- `followers` for notes that can be seen by the author's followers only.
If the `group` field is empty, and nobody is mentioned in the `to` field, the note is only visible to the author.
--> To finish

View file

@ -5,6 +5,8 @@
"docs:preview": "vitepress preview" "docs:preview": "vitepress preview"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "^1.7.1",
"vitepress": "^1.1.0" "vitepress": "^1.1.0"
} },
"trustedDependencies": ["@biomejs/biome"]
} }