in-reply-to

From IndieWeb
(Redirected from u-in-reply-to)
Jump to: navigation, search


in-reply-to is a microformat for use where a post is a reply to another post. The reply post should hyperlink to the other post with u-in-reply-to. Often linked inside the reply-context of a reply post.

in-reply-to supersedes the legacy rel-in-reply-to. For more information, see rel-values.

Additionally:

  • The microformats2 class name u-in-reply-to should also be placed on such hyperlinks from reply posts to the posts that they're a reply to.
  • The microformats2 u-in-reply-to h-cite classnames can also be used to embed a reply-context with more detail than just a URL

How to consume in-reply-to

Summary: collect an ordered list of unique in-reply-to URLs by checking and adding from:

  1. the first h-entry for "in-reply-to" URLs (including embedded)
  2. the rel collection for "in-reply-to" URLs

algorithm

Given a URL of a post, to determine the URL(s) it’s in-reply-to:

  • Let in-reply-to-urls be an empty list
  • Parse the post's HTML for microformats2. If there are any h-entries, get the first one
    • If the h-entry has an in-reply-to property, for each item in its array of values:
      • If the item is a string, append it to in-reply-to-urls if not already there
      • If the item is an embedded microformat, check if it has a url property. If it does, append the first url property value to in-reply-to-urls if not already there
      • Otherwise ignore the item
    • If the post's rel collection has an "in-reply-to" entry, append each URL value in that entry to in-reply-to-urls if not already there
  • in-reply-to-urls is now a list of all the URLs the parsed URL is in-reply-to

You may use a different algorithm if it produces exactly the same results. E.g. you could skip checking "if not already there" conditions, and instead at the end perform a step of "* Remove duplicate values from in-reply-to-urls" - as long as you removed latter duplicates, and kept first occurrences in the list.

Contents

Usage Examples

  • tantek uses u-in-reply-to along with h-cite to mark-up reply notes. E.g. [1]

FAQ

Must an in-reply-to link be inside an h-entry

Q: Does an in-reply-to link have to be inside an h-entry?

A: No. An in-reply-to link can be anywhere on the page using rel-in-reply-to, which then makes that page represent a reply to the destination of that link. The first h-entry, if any, then represents specifically the reply content and author, which may or may not actually contain the in-reply-to link.

Why would an in-reply-to be outside an h-entry

Q: Why would a page have a rel-in-reply-to outside an h-entry?

A: A simple rel=in-reply-to hyperlink is easier for publishers to publish simple permalink reply pages and thus we want to allow that. They may later add h-entry markup for the contents of their comment and authorship, which may not actually contain the link at all.

In the broader blogosphere, comments on posts rarely actually include the URL of the post they're commenting on, thus you can't depend on the in-reply-to being inside the h-entry (or certainly not inside the content) of such a reply post.

Research

See:

For the research and development of the u-in-reply-to property and rel=in-reply-to.

See Also

Personal tools
Namespaces
Variants
Actions
Recent & Upcoming
Resources
Toolbox