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
export default defineConfig({
title: "Lysand Documentation",
description: "Documentation for Lysand, a new federated protocol",
srcDir: 'docs',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Specification', link: '/spec' },
],
title: "Lysand Documentation",
description: "Documentation for Lysand, a new federated protocol",
srcDir: "docs",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: "Home", link: "/" },
{ text: "Specification", link: "/spec" },
],
sidebar: [
{
text: 'Spec Details',
items: [
{ text: 'Spec', link: '/spec' },
]
},
{
text: "Structures",
items: [
{ text: "Content Format", link: '/structures/content-format' },
{ text: "Custom Emoji", link: '/structures/custom-emoji' },
{ text: "Collection", link: '/structures/collection' },
]
},
{
text: "Cryptography",
items: [
{ text: "Keys", link: "/cryptography/keys" },
{ text: "Signing", link: "/cryptography/signing" },
]
},
{
text: "Objects",
link: "/objects",
items: [
{
text: "Publications", link: "/objects/publications", items: [
{ text: "Note", link: "/objects/note" },
{ text: "Patch", link: "/objects/patch" },
]
},
{
text: "Actors", link: "/objects/actors", items: [
{ text: "User", link: "/objects/user" },
]
},
{
text: "Actions", link: "/objects/actions", items: [
{ text: "Like", link: "/objects/like" },
{ text: "Dislike", link: "/objects/dislike" },
{ text: "Follow", link: "/objects/follow" },
{ text: "FollowAccept", link: "/objects/follow-accept" },
{ text: "FollowReject", link: "/objects/follow-reject" },
{ text: "Announce", link: "/objects/announce" },
{ text: "Undo", link: "/objects/undo" },
]
},
{ text: "Server Metadata", link: "/objects/server-metadata" }
]
},
{
text: "Federation",
items: [
{ text: "Endpoints", link: "/federation/endpoints" },
{ text: "User Discovery", link: "/federation/user-discovery" },
{ text: "Server Actors", link: "/federation/server-actor" },
]
},
{
text: "Extensions",
link: "/extensions",
items: [
{ text: "Custom Emojis", link: "/extensions/custom-emojis" },
{ text: "Reactions", link: "/extensions/reactions" },
{ text: "Polls", link: "/extensions/polls" },
{ text: "Is Cat", link: "/extensions/is-cat" },
{ text: "Server Endorsements", link: "/extensions/server-endorsement" },
{ text: "Events", link: "/extensions/events" },
{ text: "Reports", link: "/extensions/reports" },
{ text: "Vanity", link: "/extensions/vanity" },
]
}
],
sidebar: [
{
text: "Spec Details",
items: [{ text: "Spec", link: "/spec" }],
},
{
text: "Structures",
items: [
{
text: "Content Format",
link: "/structures/content-format",
},
{ text: "Custom Emoji", link: "/structures/custom-emoji" },
{ text: "Collection", link: "/structures/collection" },
],
},
{
text: "Groups",
link: "/groups",
},
{
text: "Cryptography",
items: [
{ text: "Keys", link: "/cryptography/keys" },
{ text: "Signing", link: "/cryptography/signing" },
],
},
{
text: "Objects",
link: "/objects",
items: [
{
text: "Publications",
link: "/objects/publications",
items: [
{ text: "Note", link: "/objects/note" },
{ text: "Patch", link: "/objects/patch" },
],
},
{
text: "Actors",
link: "/objects/actors",
items: [{ text: "User", link: "/objects/user" }],
},
{
text: "Actions",
link: "/objects/actions",
items: [
{ text: "Like", link: "/objects/like" },
{ text: "Dislike", link: "/objects/dislike" },
{ text: "Follow", link: "/objects/follow" },
{
text: "FollowAccept",
link: "/objects/follow-accept",
},
{
text: "FollowReject",
link: "/objects/follow-reject",
},
{ text: "Announce", link: "/objects/announce" },
{ text: "Undo", link: "/objects/undo" },
],
},
{
text: "Server Metadata",
link: "/objects/server-metadata",
},
],
},
{
text: "Federation",
items: [
{ text: "Endpoints", link: "/federation/endpoints" },
{
text: "User Discovery",
link: "/federation/user-discovery",
},
{ text: "Server Actors", link: "/federation/server-actor" },
],
},
{
text: "Extensions",
link: "/extensions",
items: [
{
text: "Custom Emojis",
link: "/extensions/custom-emojis",
},
{
text: "Microblogging",
link: "/extensions/microblogging",
},
{ text: "Reactions", link: "/extensions/reactions" },
{ text: "Polls", link: "/extensions/polls" },
{ text: "Is Cat", link: "/extensions/is-cat" },
{
text: "Server Endorsements",
link: "/extensions/server-endorsement",
},
{ text: "Events", link: "/extensions/events" },
{ text: "Reports", link: "/extensions/reports" },
{ text: "Vanity", link: "/extensions/vanity" },
],
},
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/lysand-org/' }
],
search: {
provider: "local",
socialLinks: [
{ icon: "github", link: "https://github.com/lysand-org/" },
],
search: {
provider: "local",
},
editLink: {
pattern: "https://github.com/lysand-org/docs/edit/main/docs/:path",
},
logo: "/logo.png",
},
editLink: {
pattern: "https://github.com/lysand-org/docs/edit/main/docs/:path"
},
logo: "/logo.png",
},
lastUpdated: true,
cleanUrls: true,
titleTemplate: ":title · Lysand 2.0 Docs",
head: [
['link', { rel: 'icon', href: '/favicon.png', type: 'image/png' }]
],
lang: 'en-US',
})
lastUpdated: true,
cleanUrls: true,
titleTemplate: ":title · Lysand 2.0 Docs",
head: [["link", { rel: "icon", href: "/favicon.png", type: "image/png" }]],
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]
>
> 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.
@ -35,7 +35,7 @@ Here's an example of an `Announce` action:
| :----- | :----- | :------- |
| author | String | Yes |
URI of the [Actor](../objects/actors) who initiated the action.
URI of the [Actor](./actors) who initiated the action.
#### Object
@ -43,9 +43,9 @@ URI of the [Actor](../objects/actors) who initiated the action.
| :----- | :----- | :------- |
| 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/):
@ -57,8 +57,8 @@ Furthermore, users should be notified when their notes are announced by other us
## Types
```typescript
interface Announce extends Entity {
type: "Announce";
interface Announce extends Extension {
extension_type: "org.lysand:microblogging/Announce";
author: 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

@ -1,10 +1,12 @@
{
"scripts": {
"docs:dev": "vitepress dev",
"docs:build": "vitepress build",
"docs:preview": "vitepress preview"
},
"devDependencies": {
"vitepress": "^1.1.0"
}
}
"scripts": {
"docs:dev": "vitepress dev",
"docs:build": "vitepress build",
"docs:preview": "vitepress preview"
},
"devDependencies": {
"@biomejs/biome": "^1.7.1",
"vitepress": "^1.1.0"
},
"trustedDependencies": ["@biomejs/biome"]
}