#microformats 2020-11-21

2020-11-21 UTC
mauz555, bitwinery, jeremycherfas, Sajesajama, [jgmac1106], JonathanNeal_ and [Raphael_Luckom] joined the channel
#
[Raphael_Luckom]
I'm working on a set of JSON formats to define things like blog posts, etc. Since I know I'll want to express them in HTML, I'm thinking that I can use the microformat structures I see in http://microformats.org/wiki/Main_Page . So far so good. But one of the things that I'd like to represent is a flexible list of other things--blog posts, reviews, comments, images, anything. Has there been conversation around defining a kind of
#
[Raphael_Luckom]
container microformat like that?
#
Loqi
microformats.org
#
aaronpk
Sounds like h-feed?
#
aaronpk
Also sounds like it'd be worth reusing the microformats JSON for these instead of making up something new. Check out the different post types on the IndieWeb wiki too for some examples
#
[Raphael_Luckom]
right, that's what I was planning
#
[Raphael_Luckom]
I'm still thinking through how my use case is the same as / different from the microformats use case. I'm basically taking part of the hugo model (write in markdown, transpile to html) and migrating it to an object store (for me, S3 bucket, but that's not relevant). I want to store each thing in an "author friendly" format, and register events such that whenever I update one of the things changes, it's re-transpiled and published. So
#
[Raphael_Luckom]
some of my challenges are identical to microformat use cases (how to turn a blog post into HTML) but some seem a little different (like how to show that the "next post" link on a blog post depends on what's next in the context of a list stored elsewhere)
#
[Raphael_Luckom]
s/i update one of the things changes/one of the things changes
[grantcodes], [chrisaldrich] and [arush] joined the channel
#
[Raphael_Luckom]
It seems like there's an implicit subset / superset relationship that some microformats have to others--for instance, `h-item` seems to be a subset of `h-entry` . Have there been conversations about whether to make certain hierarchies like that explicit between formats?
#
aaronpk
oh h-item is part of a review
#
aaronpk
not sure why you're saying it's a subset of h-entry?
#
[Raphael_Luckom]
I'll describe how I got to that conclusion, but I accept your point.
#
[Raphael_Luckom]
1. I want an `h-entry` to include an image. That seems fine, I can put an `img` tag in the content, no conflict there
#
[Raphael_Luckom]
2. But I also want the image to be reference-able as it's own thing (with arbitrary metadata associated with the image), and I want the `h-entry` to be able to refer to that thing.
#
[Raphael_Luckom]
3. I happened to get to the page for `h-item` (https://microformats.org/wiki/h-item) before I got to the description of `h-item` on the main microformats page. That page says "*h-item* is a simple, open format for publishing details about arbitrary items." It specifies that h-item is usually used in reviews, etc, but doesn't foreclose the possibility that it might be used on its own. This suggests that `h-item` might represent any
#
[Raphael_Luckom]
countable noun, of which "an image" or "a blogpost" might equally be members. Since the `h-item` vocabulary includes `p-name`, `u-photo`, and `u-url`, and since those are all either canonical or proposed attributes of `h-entry`, I drew the conclusion that `h-entry` is a specialization of `h-item`
#
Loqi
Tantek Çelik
#
nolith
How can I make a simple `h-card` for a shop? Will it be enough to have the shop name tagged with `p-name p-org`?
#
Zegnat
Sounds like enough to me, Loqi
#
Zegnat
[Raphael_Luckom]: there is not really a generic container in mf2, true. Because it is mostly about semantics. Though there have been a lot of discussions about media objects for the thing you mention. E.g. people who want to bind licenses to photos, or add information about videos.
[chrisaldrich] joined the channel
#
[chrisaldrich]
[Raphael_Luckom] GWG has done some work with microformats and helps on the JSON Feed spec, so he may have some personal or even published notes on mappings between the two. He's also worked on a parser that looks at all of them (and a few others).
#
[Raphael_Luckom]
cool! I'm pretty deep in a rabbit hole of trying to understand the boundaries of what constitutes "semantics" which is making me ask a lot of questions about what my goals are, so I'm sure any related work would be helpful.
#
[chrisaldrich]
The one thing to keep in mind is to make sure that whatever you're doing actually has a useful/valuable consuming case somewhere. Otherwise you're putting in a lot of work for nothing in return.
#
[chrisaldrich]
Example, if nothing will consume an h-item within an h-entry (or something else) there's little value in having it. Similarly for schema, JSON-LD, etc.
#
[Raphael_Luckom]
yeah...one way to describe what I'm after is to ask "to what extent can microformats be used as the model in an MVC or MVA pattern" which is both the use case (the application needs a way to categorize things) and a motivation for questions like "is inheritance a relationship that microformats can have to each other"
ethan and [KevinMarks] joined the channel
#
[KevinMarks]
We don't really think about inheritance, but we try to reuse field names
#
[KevinMarks]
It's more about composability than inheritance
#
jacky
which is more handy in this case than it seems
#
[KevinMarks]
Also, the prev/next links should show up in the rels and rel-urls structures
#
[KevinMarks]
(for a page)
#
[KevinMarks]
You can add arbitrary properties to the html page. What's lost in the parsed version is where they were parsed from - you don't know if it was a u-url or a p-url.
#
[KevinMarks]
In practice if you're generating a page from the json with a template, you will be making those decisions, but there are cases where it may be a nested structure or a string - eg an h-card for organisation in an h-card for a person.
#
[Raphael_Luckom]
Could you elaborate on "generating a page from the json with a template"? In that scenario, would you expect that the JSON from which the page was generated was strictly equal to one of the JSON schemas on the microformats wiki, or that it would be some application specific thing and either the template or renderer would include decisions about the mapping to mf2-in-html?
#
GWG
I help on the WordPress jsonfeed plugin, not so much the spec
#
[KevinMarks]
That depends on the use case - if its your own site you should know the structure you expect; it's a bit trickier if, say, you're showing posts that webmentioned you.
#
[Raphael_Luckom]
cool, that makes sense. The sense that I am getting is that the microformats are primarily relevant in public contexts where the reader may not be known to the author, and don't offer any particular benefit as an internal representation within an application
#
[KevinMarks]
well, they are used for internal representation in micropub
#
[KevinMarks]
If you wanted to use them to replace the TOML or whatever in Hugo, that could work
#
[KevinMarks]
I can then take those and put them into other templates
#
[Raphael_Luckom]
replacing that toml is part of what I'm after, but my project introduces the weird goal that "rendering" should be a per-entity action. When I run hugo locally, it constructs the list page by looking through all the posts and comparing dates and whether they are drafts. I'm thinking about having a system where an update to a post, or the addition of a new post, triggers a rerender of just the specific things that need to be rendered
#
[KevinMarks]
The challenge is that addition of a new post will cascade through the taxonomies and post lists that it is in, and if they're paginated, change every page as posts move down the order, so you may en dup rendering a lot of the site
#
[Raphael_Luckom]
right. The advantage of that independent-render property is that it allows the post itself to have a canonical location that doesn't depend on the structure or markup of the site, while the site defines views and groupings of things. I think that I can handle the cascading-rerender issue by deciding that only the first page (or first n pages) of any list is rendered as a static resource, with subsequent pages generated on request. In
#
[Raphael_Luckom]
most cases there should only be one page.
[tantek] and [jgmac1106] joined the channel