#microformats 2019-02-13

2019-02-13 UTC
[jgmac1106], KartikPrabhu, tantek and [davidmead] joined the channel
#
[davidmead]
i noticed `h-cite` is being used as a wrapper for the album title and artist in Known Listen plugin. is that a correct use? doesn’t feel like it
#
[jgmac1106]
Known uses h-cite for almost any link
#
[jgmac1106]
you are citing the title MTML rules suggest <cite> used just for title maybe same process was applied?
KartikPrabhu joined the channel
#
[jgmac1106]
HTML sorry
#
[jgmac1106]
In a blockquote <cite> only goes around the title of a link
#
[jgmac1106]
so in this context h-cite may make sense for an album title http://microformats.org/wiki/h-cite
nitot joined the channel
#
cjwillcock
!tell sknebel test page for php-native-mf2: https://mf2.w6k.ca/
#
Loqi
Ok, I'll tell them that when I see them next
[tantek] joined the channel
#
[tantek]
h-cite can potentially be used for any type of media reference
#
[tantek]
book, movie, album, magazine, newspaper, blog post, tweet etc.
#
[tantek]
it's only worth using IMO if there is some consuming use-case. otherwise you could be publishing a nonsense h-cite and never know it
#
aaronpk
cjwillcock: i just tried https://aaronparecki.com and it turns up a bunch of h-items which aren't anywhere on the page!
#
aaronpk
also noticed some funny stuff happening with date values, including a bunch of extra properties, is that documented somewhere?
#
cjwillcock
hello - I tried similar earlier today. That is a fragment of my being confused about implementing hReview
#
cjwillcock
you do have an 'item' class on various things near top-of-page
#
aaronpk
hm yes, but those aren't inside any mf1 backcompat classes
#
cjwillcock
and there are obviously some things that should be done here before consider this a release-candidate
#
aaronpk
the backcompat rules are pretty strict on when they should apply
#
cjwillcock
I'm not confused about that, but I do value your feedback. It is simply that this is not uncovered by a test in the microformats-test-suite
#
cjwillcock
and also, I did the mf2bench release, not the mf2parser release yesterday (or day before) :)
#
aaronpk
interesting, i guess i'm not surprised the tests are missing false positive cases
#
cjwillcock
also, I don't believe the mf-test-suite is missing something
#
cjwillcock
this is simply a minimum
#
cjwillcock
good start anyway
#
cjwillcock
as regards the date, those are DateFormate objects, with added value properties
#
cjwillcock
I took some liberties
#
aaronpk
i suppose technically a consumer should be able to use the "value" string there, but I doubt anyone's code is prepared for that
#
cjwillcock
that date stuff may need to be hidden behind an option to make this useful for others, but for my immediate use, I wanted the familiar PHP built-in Dates
#
aaronpk
ooh just noticed the new "id" property
#
aaronpk
PHP does a fine job of re-creating the object using new DateTime("2018-12-13T14:54:29-05:00"), so i'm not sure why you'd need it broken out like that
#
cjwillcock
i think you misunderstand -- that is a json_encode(new DateTime('...'))
#
cjwillcock
I didn't do anything to it
#
aaronpk
right, but i can't think of any reason you'd need that in order to re-create the date in PHP
#
aaronpk
also how does that pass the mf2 tests? I thought all the tests include string values for date properties
#
cjwillcock
with 'heavy modification by CJW' -- this is the only liberty I took with the tests
#
cjwillcock
consider - this JSON is not the in-memory representation that will be used by an implementing application
#
cjwillcock
the implementor will already have the Date object, from the property
#
aaronpk
oh interesting, that's not how the other parsers work
#
aaronpk
they return string values for everything
#
cjwillcock
nope, it's not
#
cjwillcock
but why, right?
#
aaronpk
this was one of the reasons the original ruby library was so frustrating to work with
#
cjwillcock
certainly, I haven't done the json_encode part yet
#
cjwillcock
in there, I planned to removed the artifacts that we are discussing
#
cjwillcock
however, this may be a nice 'hidden' feature for you (and others), given the Date is already allocated
#
cjwillcock
you helped me arrive to that perspective, discussing the JSON as being a bad form to use for those golden tests
#
cjwillcock
so I stopped being restricted by what was in the JSON format, and just went with what was going to make working with this easier/faster down the way
#
aaronpk
i'd have to think through some of my code to figure out if it would actually be easier to use this way
#
cjwillcock
I do implement the MF2 parsing rules for dates, IIRC, and those are currently showing as values
#
cjwillcock
hence I could easily include a parser option to use the normal style
#
aaronpk
my inclination is it's not, because i rarely actually use the parsed mf2 tree directly. for example most of my code is actually using XRay, where XRay is the one that uses the output of this parser. I also often serialize things as JSON to stash on disk or in a database, and I want that to "just work"
#
cjwillcock
I'm quite happy to make 'good enough for Aaron' my next milestone :D
#
cjwillcock
must run, but appreciate convo - to be continued
#
aaronpk
good work so far tho!
#
cjwillcock
thank you!
[davidmead] joined the channel
#
[davidmead]
Tantek so every link could be marked up h-cite in that case? What would be a "nonsense h-cite"?
#
[tantek]
If there’s nothing consuming it, any markup is likely nonsense
#
[tantek]
Keep asking yourself, why are you doing the work? If you don’t have a very concrete answer with direct user benefits then you’re likely wasting your time better spent on something with actual user benefits
#
[tantek]
Also no one likes bloated markup
#
[davidmead]
true. that’s why i asked. guess i should also check in #known just in case something is consuming it internally, or it’s needed for POSSE etc.
[eddie] joined the channel
#
Loqi
Ok, I'll tell them that when I see them next
#
cjwillcock
!tell aaronpk I updated https://mf2.w6k.ca - both issues we discussed are fixed (false-positive backcompat items; experimental properties on dt)
#
cjwillcock
I think the ship has sailed on this 'unreleased' thing - but need the weekend ahead to make a 0.1.0 release
#
aaronpk
wow that was fast!
#
aaronpk
cjwillcock++
#
Loqi
cjwillcock has 3 karma in this channel over the last year (12 in all channels)
#
cjwillcock
thanks!
#
cjwillcock
it was like 10 lines of code, and 35 tests
#
cjwillcock
I blame the government lol
#
cjwillcock
most of those tests I touched started failing with the switch to PHP-7.3 (IIRC). A different representation of timezones started appearing in the output there. Better left as an experiment / left out for now.
nitot, ichoquo0Aigh9ie, [kevinmarks], KartikPrabhu, [eddie], mickael and [pfefferle] joined the channel
#
Zegnat
cjwillcock: I have actually wondered for a while if I would enjoy a mf2 parser that gave me DateTime objects etc back instead of strings. My conclusion was yes, but I didn’t need it enough to go and write a new parser.
#
Zegnat
Another thing I have thought about adding is a reference to the DOMElement of an object/property. Because sometimes I want to jump into the HTML.
#
Zegnat
I guess the thought difference is between parsers that parse into a language-native structure vs parse into mf2 JSON (http://microformats.org/wiki/microformats2-json). Most of the current parsers stick very close to the JSON
#
KartikPrabhu
all that sounds language specific. mf2 parsing output is independent of the progamming language
#
KartikPrabhu
I suppose in any language you could write a parser that outputted the language specific objects
#
Zegnat
Yeah, that is what I meant, KartikPrabhu :) It may not always make sense in a language/project to have a JSON document to work on. But those are businesslogic choices.
#
Zegnat
For parsers that do give the option to output a JSON document, it is nice if they follow the mf2 JSON standard, of course
#
KartikPrabhu
I guess you should write an algorithm for how to parse in such a way
#
KartikPrabhu
e.g. is the DOMElement reference only given for a h-* or for everything etc...
[jeremycherfas] joined the channel
#
Zegnat
I would have separate classes for objects and properties, and I could see both having a method pointing at their DOMElement. Not sure it is worth writing that all out though, as it is likely to be language specific anyway
#
sknebel
That's something I'm looking to enable with the mf2py changes too. Not include by default, but make it easy to do
#
Loqi
sknebel: cjwillcock left you a message 7 hours, 8 minutes ago: test page for php-native-mf2: https://mf2.w6k.ca/
#
sknebel
cjwillcock: cool, thanks
mickael and KartikPrabhu joined the channel
#
@t
15 years ago @KevinMarks & I introduced #microformats @oreillymedia ETech 2004 real world semantics, before #RDFa #microdata etc., with <15k #HTMLFirst+inline #CSS+#JS: http://tantek.com/presentations/2004etech/realworldsemanticspres.html (faster than JS-only) Previously: https://twitter.com/t/status/433494367601717248 ... http://tantek.com/t4z01
(twitter.com/_/status/1095617106819850240)
nitot, [tantek], [jgmac1106], [adam], mickael, koddsson and [Rose] joined the channel
#
sknebel
Can't use GitHub right now, do mentioning here before I forget
#
sknebel
It seems like php-mf2 adds values twice if a property class name is doubled like class="u-photo u-photo"
#
Zegnat
Oh interesting
[Vincent] and [kevinmarks] joined the channel
#
[kevinmarks]
It's a really good idea to represent time zone as utc+offset rather than name. Store the tz name as an extra if you like.
[eddie] joined the channel
#
@Scoundrel666
adafruit: RT t: 15 years ago KevinMarks & I introduced #microformats oreillymedia ETech 2004 real world semantics, before #RDFa #microdata etc., with <15k #HTMLFirst+inline #CSS+#JS: http://tantek.com/presentations/2004etech/realworldsemanticspres.html (faster than JS-only) Previously: … http://tantek.com/t4z01
(twitter.com/_/status/1095704385789796352)
nitot, jackjamieson, mickael and [kevinmarks] joined the channel
#
[kevinmarks]
DateTime objects in languages often make different timezone choices that you might hope
[jgmac1106], barpthewire, nitot, [grantcodes], [eddie], [cleverdevil], [pfefferle], [Rose], KartikPrabhu, [kevinmarks], [asuh], [schmarty], [tantek], eddiehinkle and tantek joined the channel
#
[jgmac1106]
though [tantek] looking at MDN docs good to see Mf1 should do a session at an IWC updating IWC to mf2 PR might not be accepted but good to have on file