You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/lib/docs/scrapers/mdn/xslt_xpath.rb

26 lines
865 B

module Docs
class XsltXpath < Mdn
self.name = 'XSLT & XPath'
self.slug = 'xslt_xpath'
self.base_url = 'https://developer.mozilla.org/en-US/docs/Web'
self.root_path = '/XSLT'
self.initial_paths = %w(/XPath)
html_filters.push 'xslt_xpath/clean_html', 'xslt_xpath/entries', 'title'
options[:mdn_tag] = 'XSLT_Reference'
options[:root_title] = 'XSLT'
options[:only_patterns] = [/\A\/XSLT/, /\A\/XPath/]
options[:fix_urls] = ->(url) do
url.sub! 'https://developer.mozilla.org/en/XPath', "#{XsltXpath.base_url}/XPath"
url.sub! 'https://developer.mozilla.org/en/XSLT', "#{XsltXpath.base_url}/XSLT"
url.sub! 'https://developer.mozilla.org/en-US/docs/XPath', "#{XsltXpath.base_url}/XPath"
url.sub! 'https://developer.mozilla.org/en-US/docs/XSLT', "#{XsltXpath.base_url}/XSLT"
url
end
end
end