#microformats 2023-07-07

2023-07-07 UTC
#
[aciccarello]
[KevinMarks] I actually have tests to check that my RSS is valid. The over escaping was valid but I didn't intend for my links and other html to be rendered as plain text.
#
[aciccarello]
I should add some OGP tests
#
j​kingweb
What does "OGP" mean?
#
gRegor
Open Graph Protocol, https://ogp.me/
#
[aciccarello]
That reminds me. I've been wanting to play around with metaformats parsing...
#
j​kingweb
I've started writing what I hope will function more or less as a set of unit tests. Basically, test one feature at a time (as much as is practical, anyway) in a given file, make sure that each microformat is unique in some way in the output (to aid in finding missing entries in the output), and avoid using any names from actual vocabularies, to emphasize that Microformats2 is fully generic. Dates will make this a bit tricky, b
#
j​kingweb
Early going, still, but should give an idea. PHP, Python, Go, and JS all fail these somewhere (Ruby isn't online and I don't have it set up on this machine).
btrem joined the channel
#
vladimyr
How do you do testing? Manually copy snippets into that textarea on lang.microformats.io?
#
j​kingweb
For now. I'm also testing my own implementation locally.
#
vladimyr
Asking because it might be useful to provide a script that would spun simple http server (via python or node) with selected snippet, curl online microformats checker, compare it to expected output and shut down the server
#
vladimyr
To get publicly reachable IP you could do utilize something like https://nip.io/
#
vladimyr
s/do//
#
j​kingweb
Possibly more useful would be a Docker container (or whatever) with CLIs for multiple parsers which all get run and compared.
#
vladimyr
More useful for sure but also heavier and harder to set up
nicknickname, Loqi__ and eitilt joined the channel
#
[aciccarello]
Why does the metaformats spec specifically exclude parsing the meta tags if there is a root class name on the <html> element specifically?
eitilt1, eitilt, [jeremycherfas], [manton], [jamietanna], gRegor, [mattl] and [Nabil_Maynard] joined the channel
#
[tantek]
so you can override invisible data with visible data
#
[tantek]
and parse normal mf2 properties instead of meta backcompat twitter cards or OGP or whatever
#
[aciccarello]
But why the <html> element specifically? Why not only use the meta tags if there is no h-* element on the page?
#
[aciccarello]
If I understand the spec, it already puts the h-entry at the bottom of the list of entries on the page.
#
[tantek]
because if you as the author are putting microformats markup on the entire document (hence starting with the <html> element) then you as the author as saying I know what I'm doing, I'm using mf2 for everything, anything left in meta elements is for backcompat with proprietary/legacy services only
#
[tantek]
to avoid having any "noise" contributed by meta elements
#
capjamesg
Wow haha.
#
capjamesg
We haven't done a good job of advertising it.
#
capjamesg
[snarfed] Do you think this function should be in mf2py?
#
capjamesg
If so, we'll enhance the docs. Otherwise, we'll remove.
#
sknebel
keep id say
#
[snarfed]
agreed! yes ideally with tests and docs