#microformats 2014-06-11

2014-06-11 UTC
robmorrissey, iSRAELiWORK, caseorganic, tantek, elux, KartikPrabhu, eschnou, brianloveswords, iwaim, pfefferle, krendil, waterbaby999, tobiastom, charl_, chiui, encolpe, barnabywalters, Phae, ChiefRA, Atamido_, lmjabreu_, twisted`, tobyink_, philipashlock, TallTed and pfefferle_ joined the channel
#
aaronpk
I'm curious where the decision to have every mf2 property be an array came from
#
aaronpk
as in when parsing any properties, there can always be multiple values
#
barnabywalters
aaronpk: what’s the other option?
#
aaronpk
i dunno, there are a number of other ways it could work
#
aaronpk
like, if there's only one value then it is returned as a value rather than array
#
aaronpk
or maybe the spec for different data type dictates some properties must be single-value
#
aaronpk
or maybe pluralized property names become arrays :P
#
barnabywalters
aaronpk: eh, all overcomplications for the parsing level
#
aaronpk
like I said, I'm curious where the decision came from :)
#
barnabywalters
those sort of optimisations typically rely on vocab knowledge
#
barnabywalters
which mf2 parsers explicitly don’t have
caseorganic joined the channel
#
aaronpk
i'm considering porting php-mf2 to ruby
#
barnabywalters
aaronpk: is G5 really that confusing?
#
aaronpk
it's not that it's confusing, it's just hard-coded much of the vocab
#
aaronpk
so you don't get back the JSON the same way you do with the PHP one
#
aaronpk
i mean it's not like it has an h-card class
#
barnabywalters
looks like it has what could be a really great optimisation layer, if it was separated from the parsing stage
#
aaronpk
but there's definitely some magic going on with "card.names" and "card.name" both accessing the "p-name" property
philipashlock joined the channel
#
tantek
aaronpk - a lot of that is answered in the latter sections in /microformats2
#
tantek
let me see if I can dig up the FAQs
#
barnabywalters
aaronpk: doesn’t G5’s Collection.to_hash method give you canonical mf2 JSON? https://github.com/G5/microformats2/blob/master/lib/microformats2/collection.rb#L43
#
aaronpk
hmm will have to check...
#
barnabywalters
it looks like it should
#
aaronpk
oh hey! it does
#
aaronpk
thank goodness
#
tantek
doesn't find that particular FAQ, sets out to write one.
#
barnabywalters
aaronpk: currently sending a pull request to the readme
#
aaronpk
nice thanks
robmorrissey joined the channel
#
aaronpk
that was fast!
#
barnabywalters
merged! that was quick
#
aaronpk
if I get used to the fancy accessors in the G5 gem I might have to go make the same interface for the PHP one
#
barnabywalters
aaronpk: do it! the more tools there are for optimising use of the canonical structures the better
caseorganic, philipashlock, KartikPrabhu, eschnou, pfefferle, iwaim, tantek, tantek_, krendil, aaronpk_, reidab, tommorris, encolpe, dwayhs, dwayhs_, JohnBeales, JohnBeal_, robmorrissey and dwayhs__ joined the channel