Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRoot cause of MDN documentation issues #1219
Open
Comments
|
Maybe this will solve #1127 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I spent a bunch of time today and yesterday tracing this down. I'm not sure how to proceed with a fix, so posting what I've found so far to see how best to solve the issue.
Current Behavior
Attempting to generate documentation using any of the MDN scrapers (e.g.
thor docs:generate html --debug,thor docs:generate css --debug) throws an error:View stack trace
Root Cause
The error is a bit misleading, but here's what I found after digging deep into the weeds:
base_urltohttps://developer.mozilla.org/en-US/docs/Web/HTML.Docs::Mdn) sets two params.https://developer.mozilla.org/en-US/docs/Web/HTML?raw=1¯os=1being crawled.https://wiki.developer.mozilla.org/en-US/docs/Web/HTML?raw=1¯os=1.effective_urlwhich will fail in theprocess_response?method on line 58 oflib/docs/core/scraper.rb(which itself callsprocess_url?and fails on line 63).The failure is in the comparison of
base_url(https://developer.mozilla.org/…) with the response'seffective_url(https://wiki.developer.mozilla.org/…).Solutions
https://developer.mozilla.org is the canonical reference and should still be linked from the footer of scraped pages, etc. There's good reason to continue scraping pages from https://wiki.developer.mozilla.org with the two URL params (see https://wiki.developer.mozilla.org/en-US/docs/Web/HTML?raw=1¯os=1, for example).
So, I'm not sure what a solution might be here. It'd be great to get this resolved, though. The MDN documentation on devdocs.io is increasingly out of date. I'm happy to help out with some guidance and ideas.
Thanks for your time and for making and maintaining this awesome tool!