Post about threading in Atom

This commit is contained in:
~lucidiot 2021-03-26 19:29:16 +01:00
parent 05250033d6
commit dd838deaa8
1 changed files with 27 additions and 0 deletions

View File

@ -301,5 +301,32 @@
<p>This module was only proposed for RSS 1.0, but most feed readers barely make any distinction between RSS 1.0 and 2.0, so if a feed reader ever supported this module, you could probably use it safely in RSS 2.0 too.</p>
]]></description>
</item>
<item>
<title>Replying to other people in Atom feeds</title>
<pubDate>Fri, 26 Mar 2021 19:05:18 +0100</pubDate>
<guid isPermaLink="false">atom-threading</guid>
<category domain="https://envs.net/~lucidiot/rsrsss/">Tip</category>
<link>https://tools.ietf.org/html/rfc4685</link>
<description><![CDATA[
<p>A continuation of yesterday's post on replies in RSS feeds, due to a simple question: how about Atom?</p>
<p>Turns out <a href="https://tools.ietf.org/html/rfc4685" target="_blank">RFC 4685</a> defines an XML namespace one can use to define replies. It is rather similar to yesterday's mod_annotation.</p>
<p>To use this namespace, you will need to first add the namespace to your feed: <code>xmlns:thr="http://purl.org/syndication/thread/1.0"</code>. You then have access to two new elements and two new attributes, and the spec also defines a new <code>rel</code> value:</p>
<ul>
<li><code>&lt;thr:in-reply-to&gt;</code> to indicate what you are replying to using the ID indicated in the <code>&lt;id&gt;</code> tag;</li>
<li><code>&lt;link rel="replies"&gt;</code> to point to a page where some, or all, known replies to a post are listed;</li>
<li><code>thr:updated</code> to add on the above link the last date when the page was updated;</li>
<li><code>thr:count</code> to add on the above link the number of known replies listed in the linked page;</li>
<li><code>&lt;thr:total&gt;</code> to indicate the <strong>total</strong> number of known replies, as the linked replies pages might only contain a portion of them.</li>
</ul>
<p>None of those are required. You can repeat the <code>&lt;link rel="replies" /&gt;</code> as many times as you might need, if you have multiple pages. The metadata given by the <code>&lt;thr:total&gt;</code> element and the <code>thr:count</code> and <code>thr:updated</count> attributes is non-authoritative, which means it does not have to be exact.</p>
<p>If you are using <code>&lt;thr:in-reply-to&gt;</code>, it is recommended to also include the post's link in a <code>&lt;link rel="related"&gt;</code> to allow a graceful fallback for feed readers that might not support the threading extensions.</p>
<p><a href="https://tools.itef.org/html/rfc4685" target="_blank">The RFC</a> includes a bunch of examples that should be enough to get you started should you ever want to try using this namespace.</p>
<h2>Some other formats</h2>
<p>Before I start writing posts on threading for just every single syndication format, here is some info for two formats I have experimented with in <a href="https://tilde.town/~lucidiot/itsb/" target="_blank">ITSB</a>:</p>
<p><a href="https://jsonfeed.org/version/1.1" target="_blank">JSON Feed</a> does not have support for threading in its spec, but you could just make your own extension for that. It does not use JSON-LD either, which would have allowed for a similar extension system as XML; but after experiencing the complexity of JSON-LD first hand at my day job and facing the numerous interoperability issues that causes, I can definitely understand that they wouldn't want to.</p>
<p><a href="https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa768139(v=vs.85)" target="_blank">Channel Definition Format</a> allows for nested channels, so you could at least create a structured representation of a thread as a tree if you, the original author of the post, knew about all the replies. You cannot, however, specify that you are replying to something yourself. The format does support XML namespace extensions, so you could use <code>thr</code> or mod_annotation.</p>
]]></description>
</item>
</channel>
</rss>