devdocs icon indicating copy to clipboard operation
devdocs copied to clipboard

Add external_urls filter

Open MasterEnoc opened this issue 3 years ago • 1 comments

This a tiny filter whose purpose is replace urls found in <a> tags for relative URLs pointing to devdocs documentation. This is done manually, each author or maintainer should add (if needed) options[:external_url] filter option to the scraper.

This is not done server-side as discussed in #234 but it gives an option to avoid links of external documentation when it is available in devdocs.

This commit already implements this filter in the backbone.rb file.

MasterEnoc avatar Mar 05 '21 22:03 MasterEnoc

Code improved by your suggestions @simon04.

Reading the js of devdocs I found that each link ('a' tag) is verified if it is part of devdocs or not before send me to the page that it is pointing, if the link is part of devdocs it will make an xhr request and it will show me content retrieved by the xhr request, this behaviour works if the link is part of the same documentation or if the link is from a documentation that is enabled, if not it will show me an error. I changed this behaviour, if a link is part of devdocs but it is from a different doc it will send to devdocs reloading the page rather than make an xhr request.

MasterEnoc avatar Mar 19 '21 06:03 MasterEnoc