#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
# jkingweb 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...
# jkingweb 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
# jkingweb 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?
# jkingweb 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//
# jkingweb 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] For my static site with I have a Jest test that parses the file https://github.com/aciccarello/ciccarello.me/blob/967766656981b8703307eb1ca3db9bebb73b896d/_build/tests/microformats.test.mjs
# [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
# [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
# [snarfed] [capjamesg] lol re mf_helpers get_urls, I have a couple variants of that same code, eg https://github.com/snarfed/granary/blob/09f7bc7d117bdc19635dc3b1d074914c13819834/granary/microformats2.py#L100-L149 , https://github.com/snarfed/webutil/blob/a4ba2f61c90aadaf830ac430faa57f8b2e97eeac/util.py#L333-L348