#microformats 2018-11-18

2018-11-18 UTC
[grantcodes] and [jgmac1106] joined the channel
#
@jgmac1106
After adding an h-feed I can see how much more appealing it is then having to maintain an xml file for rss. I will still do both, but a couple extra properties on some html classes and Boom! Readers could parse my microformats (https://quickthoughts.jgregorymcverry.com/s/2kawT9)
(twitter.com/_/status/1063963151861989376)
[jgmac1106], [eddie], [tantek], tantek, cheim, globbot, gRegorLove, barpthewire, jgmac1106, [kevinmarks] and [cleverdevil] joined the channel
#
sknebel
... why does php-mf2 have a composer.lock that's older than composer.json?
[tantek] joined the channel
#
aaronpk
that's odd
jgmac1106 and [kevinmarks] joined the channel
#
aaronpk
do we have open parser bugs for all the parsers that are doing the VCP pattern differently right now?
#
Loqi
WordCamp Riverside
#
Loqi
WordCamp Riverside
#
Loqi
WordCamp Riverside
#
aaronpk
the start dates returned are: 2018-11-03 (python) 2018-11-03 10:00-0800 (php) 2018-11-03 10:00:00 (ruby)
#
aaronpk
end dates are: 11:00-8:00 (python) 11:00-8:00-0800 (php) 2018-11-18 11:00:00 (ruby)
#
aaronpk
they are all wrong in different ways
#
sknebel
php gets the start date right, python the end
[jgmac1106] joined the channel
#
aaronpk
is that markup not correct to trigger the implied date on the dt-end?
#
sknebel
no, since dt-end isn't VCP
#
aaronpk
ugh I dont understand that pattern apparently
#
aaronpk
also it seems weird that it uses a class name that isn't prefixed like the rest of the mf2 class names
#
sknebel
ah, problem with your example: the tz doesn't have a leading zero
#
sknebel
try +08:00
#
aaronpk
oh wow
#
sknebel
wait, no
#
sknebel
that's not required
#
aaronpk
it's about 50/50 as to whether the 0 is there on all the indieweb wiki events
#
sknebel
but that might be what trips some parsers up
#
aaronpk
ok that helped
#
sknebel
yep, that's pythons problem, bug in mf2py
#
sknebel
which is why it produces the wrong start dt
#
aaronpk
now: python: start 2018-11-03 end 2018-11-03 11:00-08:00 php: start 2018-11-03 10:00-0800 end 2018-11-03 11:00-0800 ruby: start 2018-11-03 10:00:00 end 2018-11-03 11:00-08:00
#
sknebel
what helped?
#
aaronpk
adding the 0
#
sknebel
python is doing something completely stupid then it seems
#
sknebel
(implying dates outside VCP is a an open parsing issue I think if you want to weigh in on that)
#
sknebel
should probably be resolved, as evidenced by the fact that the parsers already *do* imply it despite it not being in the spec
#
Loqi
[sknebel] #8 imply dates also outside vcp?
[eddie] joined the channel
#
sknebel
aaronpk: did you add the 0 in both places?
#
sknebel
cause python finds the time in both for me with that change
#
aaronpk
oh no I didn't see the first one
#
sknebel
found the bug, fixing it in python
#
sknebel
everyone: if we could decide on something regarding #8 that'd be nice
[Csongor] joined the channel
#
sknebel
PR for mf2py submitted
#
sknebel
gRegorLove: interesting with the XML page. can you test if the non-html5 parser handles them?
#
sknebel
if yes, maybe it'd be easy to fallback to that if the fancy one doesn't like the page?
nitot, j12t_, j12t, [tantek], KartikPrabhu, [jgmac1106], tantek and [Vincent] joined the channel
#
[Vincent]
hello all. I have a question. I’m a bit confused. What is the difference between u-category and p-category?
#
Zegnat
Semantically: nothing. The prefix is a parser directive. u- (URL) tells it to take the value for category from a href attribute, src attribute, etc. While p- (plain text) tells it to take the value from the element’s innertext, or sometimes title attribute (e.g. for abbr elements).
#
aaronpk
this needs to be its own wiki page ^^
#
Zegnat
I feel like we have had this question a couple of times in this last month? With a few pretty good answers given in chat?
#
Zegnat
I am off for the night. Maybe I’ll try collate some of those answers during tomorrow’s commute :)
#
Zegnat
I kinda expect the answer to be clear from http://microformats.org/wiki/microformats2-prefixes but it really isn’t
#
Loqi
microformats 2 prefix conventions
#
aaronpk
I also can never find that link
#
[Vincent]
thanks that would be helpful. I keep seeing examples using these both interchangeably and I thought I was missing something.
#
aaronpk
this is also a really weird sentence to introduce these: "In particular - derived from the real world examples of existing proven microformats"
tantek_ joined the channel
#
sknebel
!tell gRegorLove some basic sleughting: at least the masterminds parser actually does parse XML, it just is nice and proper and attaches a namespace to the DOMNodes, so the XPaths don't find the elements
#
Loqi
Ok, I'll tell them that when I see them next
#
[Vincent]
sounds auto-generated
#
gRegorLove
Makes sense, sknebel
#
Loqi
gRegorLove: sknebel left you a message 10 minutes ago: some basic sleughting: at least the masterminds parser actually does parse XML, it just is nice and proper and attaches a namespace to the DOMNodes, so the XPaths don't find the elements
#
sknebel
seems like you can't have the DOMDocument loadHtml use a namespace though, so I can't think of an obvious way of supporting both cases
#
gRegorLove
Yeah, seems tricky. I wasn't thinking we'd add it necessarily, unless it was easy. /mf2p does say "follow the HTML parsing rules"
#
gRegorLove
Another question is whether we leave the other parsers as-is or "fix" them
#
gRegorLove
Or update /mf2p as another option
nitot joined the channel
#
[Vincent]
If I specified a u-category and a p-category. Which would win out? Or is that up to the vendor?
#
KartikPrabhu
both will be parsed
#
KartikPrabhu
there isn't any vendor
#
[Vincent]
Sry by vendor I meant the other end doing the parsing
#
[Vincent]
Cool that’s helpful thanks
#
KartikPrabhu
you can try out the parsers here https://microformats.io/#parsers
#
gRegorLove
The parser would return both
#
[Vincent]
KartikPrabhu++
#
Loqi
KartikPrabhu has 30 karma in this channel over the last year (61 in all channels)
#
[Vincent]
gRegorLove++
#
Loqi
gRegorLove has 29 karma in this channel over the last year (116 in all channels)
#
[Vincent]
cheers!
#
[Vincent]
Zegnat++
#
Loqi
Zegnat has 20 karma in this channel over the last year (168 in all channels)
#
[Vincent]
for before!
#
gRegorLove
So it depends what you want for your consumer, really. If you want URLs as the categories, use u-category on links.
#
gRegorLove
I think that's more common. On my site I don't yet have pages for tags, so I use p-category to just return the category names
#
[Vincent]
My pages return tags, but I didn’t realise the difference between p-category and u-category till a little earlier. I was considering adding both, so I could lazy syndicate to Indienews. But I might actually just swap it all out to u-category
#
[Vincent]
semantically that would make more sense as well I guess!
#
gRegorLove
Gotcha. Yeah, if you already have links to tag pages, I'd add u-category to those.
#
aaronpk
wait, I don't think i've seen people do that
#
aaronpk
as far as h-entry is concerned, category values are strings unless they are person-tags
#
gRegorLove
aaronpk, somewhere I think it's documented if you find a url as a category attribute, use the trailing segment as the plaintext tag name
#
aaronpk
I don't think any of my code does that as a consumer
#
sknebel
that's rel=tag backcompat from m1
#
sknebel
" rel=tag - parse as p-category. While not a class name nor typical microformats property, rel=tag was the typical way to tag an hentry. Thus parsers should look for rel=tag hyperlinks inside an hentry, and take the last path segment of their "href" value as a value for a p-category property. "
#
aaronpk
sknebel++
#
Loqi
sknebel has 19 karma in this channel over the last year (85 in all channels)
#
gRegorLove
sknebel: I wasn't sure. https://html.spec.whatwg.org/multipage/parsing.html#parsing refers separately to HTML parser and XML parser, but I didn't go in-depth in that document
#
gRegorLove
Agreed it makes sense not to hinder the other parsers
#
sknebel
given that the parsed structure is actually there in PHP too I'd have argued for adding it if it's easy to do, but can't think of an elegant solution right now, at least with my rudimentary knowledge of the PHP stuff
#
gRegorLove
[Vincent], they're right, sorry I gave some incorrect information. https://indieweb.org/tags#How_to_markup is a good guide and https://indieweb.org/person-tag documents the u-category usage for person tags.
#
gRegorLove
http://microformats.org/wiki/h-entry shows p-category too, so that's all in agreement
#
Loqi
[Tantek Çelik] h-entry is a simple, open format for episodic or datestamped content on the web. h-entry is often used with content intended to be syndicated, e.g. blog posts. h-entry is one of several open microformat standards suitable for embedding data in HTML. ...
#
gRegorLove
sknebel, Maybe Zegnat will have some ideas :) Sounds like it would only work if you had masterminds html5 installed though
#
sknebel
possibly, haven't dug into the side of the stuff build into PHP as much (although I guess one could switch that to XML parsing mode and see what happens?). not really a priority, was mostly curious if all the HTML5 parsers actually do something with it, which I hadn't quite suspected
#
[Vincent]
[gRegorLove] no worries I’ll take a look thanks
nitot and mblaney joined the channel
[tantek] joined the channel