Fix mdn scrapers

- xslt_xpath had an error with redirection.
pull/1514/head
Enoc 4 years ago
parent 9a297edc84
commit 3cf987da8b

@ -6,13 +6,14 @@ module Docs
name.remove! 'XPath.'
name.remove! 'XSLT.'
name.remove! 'Axes.'
name.prepend 'xsl:' if slug =~ /\AXSLT\/[a-z]/
name.remove! 'Element.'
name.prepend 'xsl:' if slug =~ /XSLT\/Element/
name << '()' if name.gsub!('Functions.', '')
name
end
def get_type
if slug =~ /\AXSLT\/[a-z]/
if slug =~ /XSLT\/Element/
'XSLT Elements'
elsif slug.start_with?('XPath/Axes')
'XPath Axes'

@ -4,7 +4,7 @@ module Docs
self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/CSS'
self.root_path = '/Reference'
html_filters.push 'css/clean_html', 'css/entries', 'title'
html_filters.push 'css/clean_html', 'css/entries'
options[:root_title] = 'CSS'

@ -4,7 +4,7 @@ module Docs
self.name = 'DOM'
self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/API'
html_filters.push 'dom/clean_html', 'dom/entries', 'title'
html_filters.push 'dom/clean_html', 'dom/entries'
options[:root_title] = 'DOM'

@ -6,7 +6,7 @@ module Docs
self.name = 'JavaScript'
self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference'
html_filters.push 'javascript/clean_html', 'javascript/entries', 'title'
html_filters.push 'javascript/clean_html', 'javascript/entries'
options[:root_title] = 'JavaScript'

@ -6,7 +6,7 @@ module Docs
self.name = 'SVG'
self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/SVG'
html_filters.push 'svg/clean_html', 'svg/entries', 'title'
html_filters.push 'svg/clean_html', 'svg/entries'
options[:root_title] = 'SVG'

@ -6,15 +6,11 @@ module Docs
self.root_path = '/XSLT'
self.initial_paths = %w(/XPath)
html_filters.push 'xslt_xpath/clean_html', 'xslt_xpath/entries', 'title'
html_filters.push 'xslt_xpath/clean_html', 'xslt_xpath/entries'
options[:root_title] = 'XSLT'
options[:only_patterns] = [/\A\/XSLT/, /\A\/XPath/]
options[:fix_urls] = ->(url) do
url.sub! 'https://developer.mozilla.org/en-US/docs/Web/XSLT/Element', "#{XsltXpath.base_url}/XSLT"
url
end
end
end

Loading…
Cancel
Save