diff --git a/docs/_entities/embed.md b/docs/_entities/embed.md new file mode 100644 index 0000000..b9307af --- /dev/null +++ b/docs/_entities/embed.md @@ -0,0 +1,69 @@ +--- +title: Embed +--- + +This entity represents the embed information about an URL that should be +embedded, it is nested in a [StatusMessage][status_message]. To embed a URL +means to keep an embedded representation or a preview of a third party +resource referenced by the URL inside the status message. + +* If this entity is present, the receiving server should only embed the included +`url` and not search for other URLs to embed. +* If the included `url` is a +trusted oEmbed provider, the server should query the oEmbed data. +* If `title`, `description` or `image` are missing, the server should query the +information from the URL (oEmbed or OpenGraph). +* If `nothing` is `true` the server should not embed any URLs. + +A link to the embedded resource should also be included in the `text` of the +[StatusMessage][status_message] for accessibility reasons, otherwise it could +happen that some people don't see the link, for example when this entity isn't +implemented or where no embeds are supported at all. However, it is possible +that the link in the `text` and the `url` here are different, because some sites +have different URLs in `og:url` as requested. + +## Optional Properties + +All properties are optional, but either `url` is required or `nothing` must be `true`. + +| Property | Type (Length) | Description | +| ------------- | ------------------------ | ------------------------------------- | +| `url` | [URL][url] (65535) | The URL that should be embedded. | +| `title` | [String][string] (255) | The title of the embedded URL. | +| `description` | [String][string] (65535) | The description of the embedded URL. | +| `image` | [URL][url] (65535) | The image of the embedded URL. | +| `nothing` | [Boolean][boolean] | `true` if nothing should be embedded. | + +## Example + +### Only `url` + +~~~xml + + https://example.org/ + +~~~ + +### With metadata + +~~~xml + + https://example.org/ + Example Website + This is an example! + https://example.org/example.png + +~~~ + +### With `nothing` + +~~~xml + + true + +~~~ + +[string]: {{ site.baseurl }}/federation/types.html#string +[url]: {{ site.baseurl }}/federation/types.html#url +[boolean]: {{ site.baseurl }}/federation/types.html#url +[status_message]: {{ site.baseurl }}/entities/status_message.html diff --git a/docs/_entities/status_message.md b/docs/_entities/status_message.md index 6bb1fb7..3e2f8b2 100644 --- a/docs/_entities/status_message.md +++ b/docs/_entities/status_message.md @@ -24,6 +24,7 @@ This entity represents a reshare of a status message. It inherits from [Post][po | `photo` | [Photo][photo]s | ✔ | The attached Photos of the status message, the `status_message_guid` and the `author` need to match the status message. | | `poll` | [Poll][poll] | ✘ | The attached Poll of the status message. | | `event` | [Event][event] | ✘ | The attached Event of the status message. | +| `embed` | [Embed][embed] | ✔ | The Embed information of an URL that should be embedded in the status message. | ## Examples @@ -47,12 +48,12 @@ This entity represents a reshare of a status message. It inherits from [Post][po c3893bf029e7013487753131731751e9 2016-07-11T22:50:18Z I am a very interesting status update + true
Vienna, Austria
48.208174 16.373819
- true ~~~ @@ -64,6 +65,7 @@ This entity represents a reshare of a status message. It inherits from [Post][po e05828d029e7013487753131731751e9 2016-07-11T22:52:56Z I am a very interesting status update + true 0788070029e8013487753131731751e9 alice@example.org @@ -86,7 +88,6 @@ This entity represents a reshare of a status message. It inherits from [Post][po 480 800 - true ~~~ @@ -99,6 +100,7 @@ This entity represents a reshare of a status message. It inherits from [Post][po 378473f029e9013487753131731751e9 2016-07-11T23:00:42Z I am a very interesting status update + true 2a22d6c029e9013487753131731751e9 Select an answer @@ -115,7 +117,24 @@ This entity represents a reshare of a status message. It inherits from [Post][po Maybe + +~~~ + +### With [Embed][embed] + +~~~xml + + alice@example.org + 378473f029e9013487753131731751e9 + 2016-07-11T23:00:42Z + I am a very interesting status update true + + https://example.org/ + Example Website + This is an example! + https://example.org/example.png + ~~~ @@ -128,6 +147,7 @@ This entity represents a reshare of a status message. It inherits from [Post][po 2016-07-11T23:02:24Z mobile i am a very interesting status update + true 0788070029e8013487753131731751e9 alice@example.org @@ -171,7 +191,12 @@ This entity represents a reshare of a status message. It inherits from [Post][po Maybe - true + + https://example.org/ + Example Website + This is an example! + https://example.org/example.png + ~~~ @@ -186,3 +211,4 @@ This entity represents a reshare of a status message. It inherits from [Post][po [photo]: {{ site.baseurl }}/entities/photo.html [poll]: {{ site.baseurl }}/entities/poll.html [event]: {{ site.baseurl }}/entities/event.html +[embed]: {{ site.baseurl }}/entities/embed.html