#microformats 2020-05-12

2020-05-12 UTC
[chrisaldrich], [benatwork], [KevinMarks], [prtksxna], [snarfed] and [jgarber] joined the channel
#
[jgarber]
Here’s an issue wherein I lay out the weirdness with `rel-urls` from our earlier conversation: https://github.com/microformats/microformats2-parsing/issues/50
#
Loqi
[jgarber623] #50 `rel-urls` Parsing Issues
[tantek] joined the channel
#
[tantek]
will take a closer look at this in the light of day
gRegorLove_ joined the channel
#
[jgarber]
[tantek] Thanks! Just posted a follow up comment as well with an additional example.
#
[jgarber]
[gRegorLove] Thanks for the comment on the issue, too. :thumbsup::skin-tone-2:
KartikPrabhu, gRegorLove_ and [aimee] joined the channel
#
[aimee]
Thanks [jgarber] for the rel issue - I found this very ambiguous while implementing a parser this weekend
#
[aimee]
This is also where I say that I finished a JavaScript parser yesterday... https://github.com/aimee-gm/microformats-parser
#
Loqi
[aimee-gm] microformats-parser: A JavaScript microformats parser
#
[aimee]
I say “finished” - I got it to the point where the test suite passed (v1, v2 and mixed) and published to npm
[LewisCowles], gRegorLove_, [jgmac1106], KartikPrabhu, [prtksxna] and [jgarber] joined the channel
#
[jgarber]
[aimee] Congratulations! That’s awesome.
#
[jgarber]
I’ve taken a slightly different tact with an opinionated v2-only parser, written in Ruby: https://github.com/jgarber623/micromicro
#
Loqi
[jgarber623] micromicro: A Ruby gem for extracting microformats2-encoded data from HTML documents.
#
cjw6k
congratulations jgarber, on the first release of your new parser!
#
[jgarber]
cjw6k: Thanks! It’s very rough around the edges. Feedback and ideas are definitely welcome and appreciated.
[LewisCowles], [tw2113], KartikPrabhu and [tantek] joined the channel
#
[tantek]
[aimee]++ amazing! Do you have a blog post about it?
#
Loqi
[aimee] has 3 karma over the last year
[prtksxna] joined the channel
#
cjw6k
whoa two new parsers - congratulations aimee!
[jgarber] joined the channel
#
[jgarber]
[aimee] Are you looking for any feedback or help on your new parser?
cal joined the channel
#
[jgarber]
I’m looking at a part of the microformats2 parsing specification regarding child elements where those child elements have both a property class and a root class name.
#
[jgarber]
I can’t find a test case for this in the test suite and can’t conceive of a use case where an `e-*` property also has a root class name.
#
[jgarber]
In that case, a parser adds the element as a hash `{ }` and follows the rules for populating that hash with the addition of a `value` key.
#
[jgarber]
> else if it’s an `e-*` property element, re-use its { } structure with existing `value:` inside.
#
[jgarber]
My question is, are there any examples that match this case?
[KevinMarks] joined the channel
#
[KevinMarks]
Was adactio's book proposal a bit like that?
[tw2113] and KartikPrabhu joined the channel
#
[jgarber]
[KevinMarks] Would that be this post? https://adactio.com/journal/16803
#
Loqi
[Jeremy Keith] Reading
#
[jgarber]
Would this be a contrived example?
#
[jgarber]
```<div class="h-entry">
#
[jgarber]
<div class="e-content h-card">
#
[jgarber]
<p class="p-name">Jason Garber</p>
#
[jgarber]
</div>```
#
sknebel
Could see it with a h-cite where you want to preserve the hypertext content
#
[KevinMarks]
Though usually you'd want to add author and url to h-cite
#
[KevinMarks]
Maybe if you're citing something with no link?
#
[jgarber]
I’m mostly curious what the expected JSON output of something like the above would be (since there doesn’t seem to be a test covering this).
#
[jgarber]
I think I know the answer, but want to validate that.
#
sknebel
True. Don't know a really convincing example right now. For q test, maybe just use clearly made up names to avoid confusion
#
sknebel
[jgarber]: propose a test and we'll see if others and other parsers agree?
#
[jgarber]
The microformats.io parsers seem to agree on output but it doesn’t square with my interpretation of the spec. 😭
#
[jgarber]
"properties": {
#
[jgarber]
"type": ["h-entry"],
#
[jgarber]
"content": [
#
[jgarber]
"properties": {
#
[jgarber]
"type": ["h-card"],
#
[jgarber]
"name": ["Jason Garber"]
#
[jgarber]
"html": "<p class=\"p-name\">Jason Garber</p>",
#
[jgarber]
"value": "Jason Garber"
gRegorLove_ joined the channel
#
[jgarber]
My interpretation for setting the value of the `properties > content > value` key:
#
[jgarber]
> else if it’s an `e-*` property element, re-use its { } structure with existing `value:` inside.
#
[jgarber]
…would wrap the `value` and `html` keys from the above JSON:
#
[jgarber]
"type": ["h-entry"],
#
[jgarber]
"properties": {
#
[jgarber]
"content": [
#
[jgarber]
"type": ["h-card"],
#
[jgarber]
"properties": {
#
[jgarber]
"name": ["Jason Garber"]
#
[jgarber]
"value": {
#
[jgarber]
"html": "<p class=\"p-name\">Jason Garber</p>",
#
[jgarber]
Oh, so apparently this is briefly documented here: http://microformats.org/wiki/microformats2-json
#
[jgarber]
…on a page I didn’t know existed. 🤦‍♂️
#
sknebel
[jgarber]: I meant on github :D but yes, I'd agree with your reading
#
sknebel
that microformats2-json page was an attempt by Zegnat to document it for e.g. micropub implementers if I remember right
#
[jgarber]
oh goodness
#
[jgarber]
So… which is authoritative? 😂
#
sknebel
the spec
#
sknebel
says so at the top of the -json page :D
#
[jgarber]
So it does!
#
sknebel
and actually, after re-reading the spec I'm not sure about which interpretation the spec means anymore...
#
sknebel
I guess it's useful if value is always a string
#
sknebel
but this is clearly an edge case we don't actually use in practice
#
[jgarber]
The spec (to me) reads as `"value": { "html": "…", "value": "…" }`, but that microformats2-json wiki page documents the behavior exhibited by existing parsers of flattening `"html": "…", "value": "…"` .
#
sknebel
I think the "reuse" is meant to refer to the new {} opened
#
sknebel
but I agree that should be clearer
KartikPrabhu joined the channel
#
[KevinMarks]
Html is escaped?
#
[jgarber]
Looks like I pulled that from the python.microformats.io parser result
#
[jgarber]
Which escapes `html` , I suppose.
#
Zegnat
I wasn}t around, but I see my name, u-oh. What up?
#
[jgarber]
Currently sorting through nested objects in JSON output, specifically around handling `e-*` properties.
#
Zegnat
wsa microformats2-json helpful or not? Haha!
#
[jgarber]
It is! I just had no idea it existed before today.
#
[jgarber]
It squares parsing specification ambiguity/murkiness with existing parser behavior.
#
[jgarber]
…but lacks (by design, I suppose) the authority of the parsing specification. 😄
#
Zegnat
Yep, very much by design
#
Zegnat
It is there to make the JSON format possibly more clear. So people can graps just the JSON format without having to read how a parser comes to that result
#
Zegnat
Just like the JSON Schema and the object Validator linked in the See Also section of that page
#
Zegnat
Not sure what edge case there is for nested e-* objects though..?
#
[jgarber]
The delta between my interpretation of the parsing specification with regards to determining the `value` key’s value vs. existing parser implementations and what’s documented on the microformats2-json wiki page.
#
[jgarber]
I’m happy to put a pin in this one. Between the parsing spec, the microformats2-json wiki page, and existing implementations, there’s enough consensus for me.
#
[jgarber]
Now I’ve got a bug to fix. 😄
#
Zegnat
I may have written the json page based on the parsers. Could still be the parsers are wrong, hehe.
#
[jgarber]
But they’re all equally wrong which is… consensus!
#
sknebel
[jgarber]: if you can come up with a good rewording of that section so that you'd have understood it as the parsers do, an editorial change there might make sense
#
Zegnat
I should have an actual output example of the e-* property on the -json page, maybe.
#
Zegnat
Writing documentation is hard. So many notes on that document about already outdated sections
#
Zegnat
Hi Loqi, do you work again?
#
Zegnat
Loqi: ping
#
sknebel
documentation++ ?
#
Loqi
documentation has 1 karma in this channel over the last year (3 in all channels)
[aimee] joined the channel
#
[aimee]
[tantek] no blog post yet, that’s something for the weekend perhaps. Was just happy to get it released
#
[aimee]
[jgarber] yes and yes to feedback and help!
#
[aimee]
Also congratulations on your parser too [jgarber]. I originally went down the route of being opinionated to v2 but realised that v1 was a challenge so I did it 🤦‍♀️
#
sknebel
[jgarber]++ [aimee]++
#
Loqi
[jgarber] has 2 karma in this channel over the last year (6 in all channels)
#
Loqi
[aimee] has 4 karma over the last year
#
sknebel
we need to see that we get them added to microformats.io
#
[aimee]
Also thank you for your help already [jgarber]
#
[aimee]
[jgarber]++
#
Loqi
[jgarber] has 3 karma in this channel over the last year (7 in all channels)
#
[jgarber]
[aimee] Thanks! 😄
[LewisCowles], [tim038] and [Sadik_Shahadu] joined the channel
#
[jgarber]
New issue on GitHub for that `e-*` property conversation from earlier today: https://github.com/microformats/microformats2-parsing/issues/51
#
Loqi
[jgarber623] #51 Parser output for elements with property class and root class names?
gRegorLove_ joined the channel
#
gRegorLove_
[aimee]++ for the new parser, awesome!
#
Loqi
[aimee] has 5 karma over the last year
[grantcodes] joined the channel