From d3a2d84a4040f6580cec00894afb05176c8e11a6 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Tue, 27 Aug 2024 22:53:26 +0200 Subject: [PATCH] refactor: :fire: Move Custom Emojis Structure to same page as extension --- app/changelog/page.mdx | 2 +- app/extensions/custom-emojis/page.mdx | 40 ++++++++++++++++++++-- app/structures/emoji/page.mdx | 48 --------------------------- components/Navigation.tsx | 1 - 4 files changed, 39 insertions(+), 52 deletions(-) delete mode 100644 app/structures/emoji/page.mdx diff --git a/app/changelog/page.mdx b/app/changelog/page.mdx index 1f9874f..72ecd94 100644 --- a/app/changelog/page.mdx +++ b/app/changelog/page.mdx @@ -23,7 +23,7 @@ This page lists changes since Working Draft 03. {{ className: 'lead' }} - Added shared inboxes. - Added `remote` field to [ContentFormat](/structures/content-format). - Switched to [ThumbHash](https://evanw.github.io/thumbhash/) from [BlurHash](https://blurha.sh/). -- Added identification characters to [Custom Emojis](/structures/emoji). +- Added identification characters to [Custom Emojis](/extensions/custom-emoji). - Added `manually_approves_followers` to [Users](/entities/user). - Removed `visibility` from [Notes](/entities/note). - Made `subject` optional in [Notes](/entities/note). diff --git a/app/extensions/custom-emojis/page.mdx b/app/extensions/custom-emojis/page.mdx index 867a166..cf491ed 100644 --- a/app/extensions/custom-emojis/page.mdx +++ b/app/extensions/custom-emojis/page.mdx @@ -7,6 +7,42 @@ export const metadata = { The Custom Emojis extension adds support for adding personalized emojis to federated data. {{ className: 'lead' }} +## Structure Definition + + + + + + Emoji name, surrounded by identification characters (for example, colons: `:happy_face:`). + + Name must match the regex `^[a-zA-Z0-9_-]+$`. + + Identification characters must not match the name regex (must not be alphanumeric/underscore/hyphen). There may only be two identification characters, one at the beginning and one at the end. + + + Emoji content. Must be an image format (`image/*`). + + + + + + + ```jsonc {{ 'title': 'Example Emoji' }} + { + "name": ":happy_face:", + "content": { + "image/webp": { + "content": "https://cdn.example.com/emojis/happy_face.webp", + "remote": true, + "description": "A happy emoji smiling.", + } + } + } + ``` + + + + ## Rendering To render custom emojis, clients **should** perform the following steps: @@ -37,8 +73,8 @@ Custom Emojis can be added to any entity with text content. The extension ID is - - [Custom emojis](/structures/emoji) to be added to the note. + + [Custom emojis](/extensions/custom-emoji#structure-definition) to be added to the note. diff --git a/app/structures/emoji/page.mdx b/app/structures/emoji/page.mdx deleted file mode 100644 index 078c8cf..0000000 --- a/app/structures/emoji/page.mdx +++ /dev/null @@ -1,48 +0,0 @@ -export const metadata = { - title: 'Emoji', - description: 'Definition of the Emoji structure', -} - -# Custom Emoji - - - This structure is part of the [Custom Emojis](/extensions/custom-emojis) extension. As such, it is not part of the core Versia specification. - - If you are not implementing the Custom Emojis extension, you can ignore this structure. - - -## Entity Definition - - - - - - Emoji name, surrounded by identification characters (for example, colons: `:happy_face:`). - - Name must match the regex `^[a-zA-Z0-9_-]+$`. - - Identification characters must not match the name regex (must not be alphanumeric/underscore/hyphen). There may only be two identification characters, one at the beginning and one at the end. - - - Emoji content. Must be an image format (`image/*`). - - - - - - - ```jsonc {{ 'title': 'Example Emoji' }} - { - "name": ":happy_face:", - "content": { - "image/webp": { - "content": "https://cdn.example.com/emojis/happy_face.webp", - "remote": true, - "description": "A happy emoji smiling.", - } - } - } - ``` - - - \ No newline at end of file diff --git a/components/Navigation.tsx b/components/Navigation.tsx index b5e7e24..77b279e 100644 --- a/components/Navigation.tsx +++ b/components/Navigation.tsx @@ -268,7 +268,6 @@ export const navigation: NavGroup[] = [ links: [ { title: "ContentFormat", href: "/structures/content-format" }, { title: "Collection", href: "/structures/collection" }, - { title: "Custom Emoji", href: "/structures/emoji" }, ], }, {