History

Fix mdn scrapers

- xslt_xpath had an error with redirection.

Enoc committed 5 years ago

Commit 3cf987d1 parent 9a297ed6 files · +8 −11Browse files

Unified · Split

6 files
  1. lib/docs/filters/xslt_xpath/entries.rb +3 −2
  2. lib/docs/scrapers/mdn/css.rb +1 −1
  3. lib/docs/scrapers/mdn/dom.rb +1 −1
  4. lib/docs/scrapers/mdn/javascript.rb +1 −1
  5. lib/docs/scrapers/mdn/svg.rb +1 −1
  6. lib/docs/scrapers/mdn/xslt_xpath.rb +1 −5
lib/docs/filters/xslt_xpath/entries.rb+3−2
@@ -6,13 +6,14 @@ module Docs · 5 unmodified lines
66 name.remove! 'XPath.'
77 name.remove! 'XSLT.'
88 name.remove! 'Axes.'
9− name.prepend 'xsl:' if slug =~ /\AXSLT\/[a-z]/
9+ name.remove! 'Element.'
10+ name.prepend 'xsl:' if slug =~ /XSLT\/Element/
1011 name << '()' if name.gsub!('Functions.', '')
1112 name
1213 end
1314
1415 def get_type
15− if slug =~ /\AXSLT\/[a-z]/
16+ if slug =~ /XSLT\/Element/
1617 'XSLT Elements'
1718 elsif slug.start_with?('XPath/Axes')
1819 'XPath Axes'
lib/docs/scrapers/mdn/css.rb+1−1
@@ -4,7 +4,7 @@ module Docs · 3 unmodified lines
44 self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/CSS'
55 self.root_path = '/Reference'
66
7− html_filters.push 'css/clean_html', 'css/entries', 'title'
7+ html_filters.push 'css/clean_html', 'css/entries'
88
99 options[:root_title] = 'CSS'
1010
lib/docs/scrapers/mdn/dom.rb+1−1
@@ -4,7 +4,7 @@ module Docs · 3 unmodified lines
44 self.name = 'DOM'
55 self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/API'
66
7− html_filters.push 'dom/clean_html', 'dom/entries', 'title'
7+ html_filters.push 'dom/clean_html', 'dom/entries'
88
99 options[:root_title] = 'DOM'
1010
lib/docs/scrapers/mdn/javascript.rb+1−1
@@ -6,7 +6,7 @@ module Docs · 5 unmodified lines
66 self.name = 'JavaScript'
77 self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference'
88
9− html_filters.push 'javascript/clean_html', 'javascript/entries', 'title'
9+ html_filters.push 'javascript/clean_html', 'javascript/entries'
1010
1111 options[:root_title] = 'JavaScript'
1212
lib/docs/scrapers/mdn/svg.rb+1−1
@@ -6,7 +6,7 @@ module Docs · 5 unmodified lines
66 self.name = 'SVG'
77 self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/SVG'
88
9− html_filters.push 'svg/clean_html', 'svg/entries', 'title'
9+ html_filters.push 'svg/clean_html', 'svg/entries'
1010
1111 options[:root_title] = 'SVG'
1212
lib/docs/scrapers/mdn/xslt_xpath.rb+1−5
@@ -6,15 +6,11 @@ module Docs · 5 unmodified lines
66 self.root_path = '/XSLT'
77 self.initial_paths = %w(/XPath)
88
9− html_filters.push 'xslt_xpath/clean_html', 'xslt_xpath/entries', 'title'
9+ html_filters.push 'xslt_xpath/clean_html', 'xslt_xpath/entries'
1010
1111 options[:root_title] = 'XSLT'
1212
1313 options[:only_patterns] = [/\A\/XSLT/, /\A\/XPath/]
1414
15− options[:fix_urls] = ->(url) do
16− url.sub! 'https://developer.mozilla.org/en-US/docs/Web/XSLT/Element', "#{XsltXpath.base_url}/XSLT"
17− url
18− end
1915 end
2016 end