History

Update SVG scraper

Closes #198.

Thibaut committed 11 years ago

Commit 7ad018e1 parent 4c116c32 files · +5 −8Browse files

Unified · Split

2 files
  1. lib/docs/filters/svg/entries.rb +3 −3
  2. lib/docs/scrapers/mdn/svg.rb +2 −5
lib/docs/filters/svg/entries.rb+3−3
@@ -3,9 +3,9 @@ module Docs · 2 unmodified lines
33 class EntriesFilter < Docs::EntriesFilter
44 def get_name
55 name = super
6− name.remove!('Element.').try(:downcase!)
7− name.remove!('Attribute.').try(:downcase!)
8− name.remove!('Tutorial.')
6+ name.gsub!('Element.', '').try(:downcase!)
7+ name.gsub!('Attribute.', '').try(:downcase!)
8+ name.gsub!('Tutorial.', '')
99 name.gsub!('_', '')
1010
1111 if name.in?(%w(Element Attribute Content\ type))
lib/docs/scrapers/mdn/svg.rb+2−5
@@ -2,6 +2,7 @@ module Docs · 1 unmodified line
22 class Svg < Mdn
33 self.name = 'SVG'
44 self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/SVG'
5+ self.fix_redirections = true
56
67 html_filters.push 'svg/clean_html', 'svg/entries', 'title'
78
@@ -17,11 +18,7 @@ module Docs · 9 unmodified lines
1718 end
1819 end
1920
20− options[:skip] = %w(
21− /Compatibility_sources
22− /FAQ
23− /SVG_animation_with_SMIL
24− /SVG_as_an_Image)
21+ options[:skip] = %w(/Compatibility_sources /FAQ)
2522
2623 options[:fix_urls] = ->(url) do
2724 url.sub! 'https://developer.mozilla.org/en-US/Web/SVG', Svg.base_url