#microformats 2019-01-12

2019-01-12 UTC
nitot, tantek, [tantek], eduardm, mickael, barpthewire and [jgmac1106] joined the channel
#
@modernserf
fuck i think i've become the 'microformats' guy
(twitter.com/_/status/1084129140612190208)
#
@rektide
↩️ @modernserf i want to do rdfa or microformats at work. it would be such an improvement for our customers.
(twitter.com/_/status/1084135796221886466)
#
KartikPrabhu
wonders how rdfa/microformats benefits "customers"
#
@jalbertbowdenii
↩️ @jedschmidt @veltman @modernserf more like demanding the restaurant use a standard format when publishing. microformats is ideal.
(twitter.com/_/status/1084169945771061249)
[kevinmarks] joined the channel
#
[kevinmarks]
His original point was about enabling user style sheets https://twitter.com/modernserf/status/1084079691923968000?s=19
#
[kevinmarks]
Those react classes are crazy. Reminds me of GWT
#
@modernserf
↩️ Not _all_ data attributes, _specific_ data attributes. Or specific classes (eg microformats), or other attributes that don't have existing meanings, or...
(twitter.com/_/status/1084180692043485184)
#
@jalbertbowdenii
↩️ @zachleat @jedschmidt microformats do this and you can chain versions, covering the spectrum.
(twitter.com/_/status/1084189715862048769)
[cleverdevil], ichoquo0Aigh9ie and cjwillcock joined the channel
#
cjwillcock
good morning - so I have cause to be working with the microformats tests.
#
cjwillcock
I found a few of the .json files have properties in a different order than I expect.
#
cjwillcock
Also that the array format doesn't seem to match what I normally expect. e.g. from using jq on cli.
#
cjwillcock
I was wondering if implementers use the tests as is, or if they are processed by everyone before being useful
#
cjwillcock
I thought that as I am working with those tests, and modifying some of them anyway, I could do that in a way that they can be PRs
#
aaronpk
IIRC the ordering of json properties is not signficant
#
aaronpk
got any examples of what you mean by the array format?
#
cjwillcock
sure, it's arrays with only a single item, e.g.: "geo": ["51.526421;-0.081067"], found in https://github.com/microformats/tests/blob/master/tests/microformats-v2/h-adr/geo.json
#
cjwillcock
i expect the line-break & indent, regardless of number of items in there
#
sknebel
are you doing stuff with the json as a string?
#
sknebel
don't do that. parse it and work with the data structures
#
cjwillcock
I'm using the tests (the .json) in golden testing - so my output should match byte-for-byte with my golden tests
#
sknebel
json is really not the format to do that with
#
cjwillcock
also, doing TDD - so I'm doing the JSON first
#
cjwillcock
in fact, I was simply doing var_dumps
#
cjwillcock
but as all those tests already exists, it's easier to stick with the JSON files -- other than it's not quite a match - which led to ^^^
#
cjwillcock
(working in php)
#
aaronpk
no, json is not meant to be tested byte for byte
#
aaronpk
you should be json-parsing the tests and comparing the data structures
#
Loqi
agreed.
#
cjwillcock
the tests are .phpt - so they match expected output with runtime output of the php binary
#
cjwillcock
it's really easy to var_dump($parse); and copy/paste from the test's .json into the --EXPECT-- section
#
cjwillcock
but I feel that silliness of specifying property order in JSON
#
cjwillcock
no need for PRs -- and I'll look at how load and decode json for comparing works out for the next tests I'm doing
nitot joined the channel
#
Zegnat
cjwillcock, for some inspiration, I specifically decode the JSON and did my own little thing to make sure the JSONs would be comparible. See: https://github.com/microformats/php-mf2/pull/163/files
#
Zegnat
http://microformats.org/wiki/microformats2-json should do a good job of describing what to expect of the JSON, it also links to 2 separate implementations of JSON validation you could use to check their validity. But there are no rules on whitespace for the parser output. Neither are there any rules for symbols that need unicode escapes, so parsers may be different from tests there as well. That’s all “flavour”
#
cjwillcock
ack! In all this time I have not found _that_ page on the wiki
#
cjwillcock
thank you (and aaronpk and sknebel too)
#
Zegnat
It is probably a page that very few other wiki pages link to. Compared to things like the parsing spec, it is also a much more recently created page
#
cjwillcock
that microformats2 object now has a second optional member, id
#
sknebel
also doesn't cover alt-text yet
#
sknebel
(neither do the tests...)
#
sknebel
(so really: don't trust the test repo 100%)
#
cjwillcock
sounds like that's the opportunity I have for PRs (eventually)