Open gpgekko opened 9 years ago
Thanks for the suggestion. This is quite a difficult thing to implement but I agree it would be a nice enhancement. I have no time to work on it at the moment (given my long list of todos and other high-impact features), but maybe in the future.
I think this could also solve #36, #41, #71, #89 and #187.
What would make this difficult, exactly?
See my comments in https://github.com/Thibaut/devdocs/issues/524
What if, while parsing server-side, we maintained a map of old links to transformed links, and then exposed this map to other docs?
@JesseTG that would be quite complex and difficult to maintain. I agree fixing/improving this would be great, but if it comes at the cost of increased maintenance burden (I'm already maxed out) and dependencies between docs/scrapers, then I don't think it's a good trade-off.
Here’s what I’m thinking:
Entry
object.originalURL => slug
.Schema idea:
"url_mapping": {
"developer.mozilla.org": {
// ...
// note that the URL’s path and domain are lowercased for case-insensitive matching.
"/en-us/docs/web/javascript/reference/global_objects/string/endswith": "javascript/global_objects/string/endswith",
// ...
}
}
Why check the path and domain separately? by narrowing down the results to a particular domain by searching through a small set of domain names, the number of paths to check can be significantly decreased.
I think you can apply this with enabled docs, not only installed.
@Kaijiro
I think you can apply this with enabled docs, not only installed.
Good point! Fixed.
I wonder if it would be possible to intercept (either during scraping or when clicked) links to known documentation. For example, the Backbone documentation contains quite a few links to Underscore documentation pages. It would be nice if these would open within DevDocs, since both are available.
This would be an improvement for offline use, and would be a nice enhancement for online use too.