#microformats 2018-07-31

2018-07-31 UTC
tantek__ joined the channel
#
jmac
So at risk of tooting my own horn, I would like to politely petition to the relevant authorities to have Web::Microformats2 for Perl linked from somewhere in an official Microformats.* page, if even from http://microformats.org/wiki/microformats2#Development_parsers for the present. To its credit I can claim its passing the official MF2 tests, and its powering at least one public website's Webmention functionality.
#
KartikPrabhu
jmac: you could login to the wiki and add it no?
#
jmac
I... don't know?
#
KartikPrabhu
you could try it is a wiki after all
#
jmac
Oh look an account creation page.
#
jmac
FWIW, http://microformats.org/wiki/index.php?title=Special:UserLogin&type=signup&returnto=microformats2 displays an old-skool recaptcha bearing the message "reCAPTCHA V1 IS SHUTDOWN"
#
Loqi
microformats community
#
jmac
Too bad, I was really looking forward to clicking on which squares had street signs y'all
#
tantek
jmac, edit it to put <nowiki> ... </nowiki> around any links you add and the edit should go through without a captcha
#
jmac
And it doesn't let me create an account with no recaptcha code. :(
#
tantek
oh it should - try any two words :)
#
aaronpk
should I try to go disable that plugin?
#
tantek
I think disabling may be worse
#
tantek
due to history of the wiki being a spam target
vivus joined the channel
#
tantek
so replace/update yes, but just disable is likely a bad idea
vivus left the channel
#
jmac
tantek: I can type whatever and get only "Incorrect or missing confirmation code", alas
#
aaronpk
edited /User:Aaronpk (+1) "update url"
(view diff)
#
aaronpk
oh huh do I have magic url adding privileges?
#
jmac
Sorrryyyy I didn't mean to be the bearer of bad captcha news on a monday nite
#
aaronpk
eh it's been happening fora while
#
tantek
aaronpk yes you do
#
tantek
hmm for a while people were still able to create accounts
#
tantek
not sure when that stopped working
#
jmac
You all have my sympathy, wikispam is just the worst, and I've had to deal with my share of it as well
#
aaronpk
😱 that recaptcha plugin makes an HTTP request from scratch
#
aaronpk
I guess they didn't want to assume curl was installed
#
jmac
But anyway... so I know what I might like to aim for, what sorts of metrics would qualify my MF2 library to advance from "in development" to join the "production ready" bunch? (I mean, *I* will declare it 1.0 at some point in the future, but that don't mean nuthin)
#
tantek
jmac I think passing the tests (as you're working on), *plus* some number of other people using it in their sites would make it "production ready"
#
jmac
nods
#
tantek
we can also change labels to something more objective like passing n%+ of tests or something
#
tantek
change or add labels
#
jmac
Oh, I have conquered the cold machine logic of the tests. Now comes the true challenge, the soft and squishy uncertainly of other people using this thing.
#
tantek
jmac, even using it yourself, e.g. to parse webmentions from others, would be a good start on that!
#
jmac
Oh heck yeah, I'm doing that already
#
jmac
I've been eatin this alpo since april
#
tantek
😂 nice work
#
jmac
If I can manage to successfully merge the experimental branch of my blogging platform (which does have a small but extant userbase) into master, and then actually getting people to use the Webmention features that it introduces, that'll be that
#
jmac
Anyway, thanks... I'll ask again about all that once I do have some buy-in
#
tantek
jmac++ for selfdogfooding!
#
Loqi
jmac has 7 karma in this channel (17 overall)
#
tantek
ok folks I want to come up with labels for the microformats2-parsing issues to help indicate their current state (where they're stuck), and help with triaging / processing them once we have consensus / implementations etc.
#
tantek
see and review http://microformats.org/wiki/microformats2-parsing#change_control for the stages than an issue needs to go through
#
Loqi
[Tantek Çelik] microformats2 parsing specification
#
tantek
all brainstorming on issue labels welcome. going to transit a bit. will check logs to see what's been proposed!
#
gregorlove
edited /microformats2 (+183) "/* Development parsers */ +Perl, metacpan and github links"
(view diff)
#
gRegorLove
jmac: Let me know if I need to change that^
#
jmac
gRegorLove: That looks great. Thank you very much!
[snarfed] joined the channel
#
gRegorLove
I'm going through microformats/tests results with php-mf2. Raised a backcompat question:
#
gRegorLove
Should h-event backcompat have a rule for 'attendee'? I guess that was a vevent property. the mf2 test indicates it should be parsed as p-attendee. http://microformats.org/wiki/h-event#Backward_Compatibility
#
Loqi
[Tantek Çelik] h-event is a simple, open format for events on the web. h-event is often used with both event listings and individual event pages. h-event is one of several open microformat draft standards suitable for embedding data in HTML. h-event is the microfor...
[cleverdevil], GWG-, klez, [manton], gRegorLove, Phae, [matpacker], KartikPrabhu, [xavierroy] and [chrisaldrich] joined the channel
#
@michaelfavia
↩️ I totally see what you mean but didn't we try that with RDF and microformats too? I mean I'm game for the ride just like I was the first time None of the companies wanted to join though so it was just us out there linking our little islands together.
(twitter.com/_/status/1024186722744246272)
KevinMarks joined the channel
#
@kevinmarks
↩️ @michaelfavia @outlandishjosh Sounds like http://indieweb.org (which does use microformats and RSS, along with http and html)
(twitter.com/_/status/1024203502703259648)
[kevinmarks], KevinMarks, [jgmac1106], [xavierroy], Garbee, Toffee and [grantcodes] joined the channel
#
@JmacDotOrg
My #Perl library for Microformats2 parsing is now listed on http://microformats.org/wiki/microformats2#Development_parsers; thanks for the add, @gRegorLove! Hope to have it listed as production-ready someday. That means getting my experimental Webmention-capable Plerd branch merged into master, and that is Not Today.
(twitter.com/_/status/1024274266324459520)
[tantek], [snarfed], [jgmac1106], indy, nitot, TallTed and tantek__ joined the channel
#
tantek__
!tell gregorlove yes that is likely. file an issue for adding p-attendee to h-event?
#
Loqi
Ok, I'll tell them that when I see them next
[kevinmarks], [cleverdevil] and [snarfed] joined the channel
#
tantek__
ok ufs.cc is up again
#
tantek__
!tell gregorlove you might find this convenient now: http://ufs.cc/w/mf2p
#
Loqi
Ok, I'll tell them that when I see them next
tantek, KevinMarks, [miklb], nitot, jgmac1106_, jgmac1106, jackjamieson and snarfed joined the channel
#
snarfed
ok sknebel i've merged my two outstanding mf2py PRs
#
snarfed
do we want to merge https://github.com/microformats/mf2py/pull/114 too? or are we worried about a performance hit?
#
Loqi
[sknebel] #114 Fix #108: replace copy.deepcopy
[metbril] and snarfed joined the channel
#
Loqi
gRegorLove: tantek__ left you a message 1 hour, 34 minutes ago: yes that is likely. file an issue for adding p-attendee to h-event?
#
Loqi
gRegorLove: tantek__ left you a message 1 hour, 21 minutes ago: you might find this convenient now: http://ufs.cc/w/mf2p
#
Loqi
[gRegorLove] #4 Add backcompat for attendee property
Evo, snarfed, tantek__, [chrisaldrich], jgmac1106 and chrisaldrich joined the channel
#
sknebel
snarfed: we want to do *something* there, since the current code crashes in some cases. so either make the decision to go back to modifying the input, not creating a copy, or fix that copying code (the PR needs extending for that tho, since I missed some cases...)
ibnesayeed, dbryant, [snarfed], 17SAAJIW3, Evo, snarfed and [kevinmarks] joined the channel
#
snarfed
so sknebel for https://github.com/microformats/mf2py/pull/114 , i'm inclined to go back to modifying the input, at least for now, to get the 1.1.2 release out, and then we can try again if we want. what do you think?
#
Loqi
[sknebel] #114 Fix #108: replace copy.deepcopy
ibnesayeed joined the channel
#
KartikPrabhu
snarfed: if you go that route it would be good to add this warning in the docs
#
snarfed
KartikPrabhu: sure!
#
snarfed
oh KartikPrabhu while you're here, could you see if you can add me to https://test.pypi.org/project/mf2py/ ?
#
KartikPrabhu
what's your pypi?
#
snarfed
snarfed
#
KartikPrabhu
done added to test pypi as owner
#
snarfed
thank you
#
sknebel
we also still don't have an elegant idea for giving the user the option to copy or not, right?
#
snarfed
not yet, other than the obvious, kwarg to parse()
#
snarfed
and since we want to get other recent bug fixes out, i figured we'd just wait on this, so we can keep thinking about it after a release
#
KartikPrabhu
there is another place where copy is used for backcompat parsing https://github.com/microformats/mf2py/blob/master/mf2py/backcompat.py#L43
#
KartikPrabhu
this makes a copy of the backcompat html so no "modified" html shows up in e-* parsing
#
sknebel
oh, right
#
sknebel
so that could potentially crash too
#
Loqi
[singpolyma] #101 Some weird results
#
KartikPrabhu
sknebel: yes I think one can test that by having some <svg> xlink:href example in a mf1 html
#
sknebel
okay,so the copy thing needs fixing
#
sknebel
I'll give it a go now, adding support for namespaces shouldn't be soo bad
#
sknebel
and add it there
#
KartikPrabhu
sknebel: you can use my site as a test since it has the embedded logo and other svgs
#
sknebel
yeah, and I have your code sample
#
KartikPrabhu
right now I can't send webmentions to myself because of that :P
#
KartikPrabhu
made a temporary patch for my hfeed2atom
KevinMarks joined the channel
#
sknebel
so I'd say I give fixing that PR another go right now
#
KartikPrabhu
what is the actual problem there?
#
KartikPrabhu
I would have thought "xlink:href" would just be a dictionary key
jackjamieson joined the channel
#
sknebel
they use a custom object type for that it seems
#
KartikPrabhu
oh! so it tries to make "xlink:href" into a python property
#
KartikPrabhu
does this also happen with lxml then?
#
sknebel
they don't use the string "xlink:href" as the dictionary key, they use a special NamespaceDAttribute object as key
#
sknebel
totally independent of the parser
#
KartikPrabhu
dang! ok I'll leave you to it since you know more about this
#
sknebel
soo tempted to just monkeypatch the class so I don't have to replicate copying code, but that feels dirty too
#
sknebel
really should afterwards try and get upstream to add this stuff
#
KartikPrabhu
it is all monkeypatch now until the bs4 people fix it
#
sknebel
ohh fun, they have custom objects for special attribute values too
#
KartikPrabhu
"special"?
#
sknebel
some meta tags
#
sknebel
meta charset, meta content
#
KartikPrabhu
i guess that is why BS is easy to use until something breaks
#
[kevinmarks]
BS is from a different time
#
[kevinmarks]
though unpicking it would be hard
#
[kevinmarks]
there are multiple generations of html parsing
#
[kevinmarks]
originally we had SGML parser
#
[kevinmarks]
then XML was the thing
#
[kevinmarks]
but it would choke a lot
#
[kevinmarks]
so BeautifulSoup came along
#
[kevinmarks]
then, post WhatWG we had HTML5lib
#
[kevinmarks]
so we have a messy stack of coexisting parsers
#
[kevinmarks]
and HTML5lib has the worts documentation of any Python library
[jgmac1106] joined the channel
#
sknebel
and is fairly slow
[pfefferle] and snarfed joined the channel
#
sknebel
snarfed: pushed update to PR
[Vanessa], snarfed and tantek joined the channel
#
snarfed
ok sknebel here's a PR to temporarily revert the deepcopy: https://github.com/microformats/mf2py/pull/121 , if we want
#
Loqi
[snarfed] #121 Revert "make a deepcopy of BS document to avoid making changes to original. add tests"
#
snarfed
we can undo it and keep working on it after the 1.1.2 release
[chrisaldrich] joined the channel
#
sknebel
I think my updated PR now catches all the cases, the other weird objects all copy fine
chrisaldrich, dbryant, myravery and jackjamieson joined the channel
#
sknebel
snarfed: am I missing a case, or does your "revert" actually fix the problem entirely too?
#
KartikPrabhu
see the line highlighted it makes a copy of a tag
#
KartikPrabhu
which will still fail the xlink:href case
#
sknebel
no, copy survives that
#
sknebel
what I totally missed in our earlier discussion, when you proposed copy first
#
sknebel
is that we do not need a general copy
#
sknebel
as long as we are careful to only modify the copied tree in safe ways it doesn't matter it's not actually a functional copy
#
sknebel
question is if it qualifies
#
KartikPrabhu
is confused
KevinMarks joined the channel
#
Loqi
[kartikprabhu] @sknebel I ma not sure that the `copy` function is actually broken on `Tag`. Here is an example that works outside mf2py ```python import copy from bs4 import BeautifulSoup doc = '''<article class="hentry"></article>''' soup = BeautifulSoup(...
#
sknebel
where I then said: "but that only works because you replace the list"
#
KartikPrabhu
oh I see. so the revert will still modify the BS doc
#
sknebel
but since we never return the tree to the user, it's competely fine for us to just ... always replace the lists
#
sknebel
our copy isn't a complete copy, and if we handle it wrong, we will accidentially modify the source tree
#
sknebel
but we control how we handle it, so as long as we do it right...
#
KartikPrabhu
sounds confusing
#
sknebel
I feel kinda stupid I got focussed so much on doing a perfect copy when it might not be needed
#
snarfed
sorry, back
#
snarfed
sknebel: hmm, maybe that's all true? can we add new tests to the revert to confirm it?
#
snarfed
if you have those tests, feel free to pull my PR into a branch and try them
#
sknebel
maybe, will look into that tomorrow. (getting kinda late here)
#
snarfed
sknebel: np! thanks for working on this today!
#
snarfed
i suspect the revert will have better performance, so if we can find some tests and convince ourselves it fixes the problem, we may want to go with it
#
snarfed
not urgent
dougbeal|mb1, KevinMarks, [jgmac1106], snarfed, Evo and tantek joined the channel; snarfed left the channel