diff --git a/lib/docs/filters/react/clean_html.rb b/lib/docs/filters/react/clean_html.rb index e76caaee..ef6ea35f 100644 --- a/lib/docs/filters/react/clean_html.rb +++ b/lib/docs/filters/react/clean_html.rb @@ -8,7 +8,7 @@ module Docs at_css('h1').content = context[:root_title] end - css('.docs-prevnext', '.hash-link', '.edit-page-link', '.edit-github').remove + css('.docs-prevnext', '.hash-link', '.edit-page-link', '.edit-github', 'a.hash', '.edit-page-block', 'a.show', 'a.hide').remove css('table h1', 'table h2', 'table h3').each do |node| table = node @@ -16,15 +16,15 @@ module Docs table.replace(node) end - css('a.anchor').each do |node| - node.parent['id'] = node['name'] + css('a.anchor', 'a.hashref').each do |node| + node.parent['id'] = node['name'] || node['id'] end css('.highlight').each do |node| node.name = 'pre' node.css('.gutter').remove node['data-language'] = node.at_css('[data-lang]').try(:[], 'data-lang') || 'js' - node.content = node.content + node.content = node.content.strip end css('table.highlighttable').each do |node| diff --git a/lib/docs/filters/react/entries.rb b/lib/docs/filters/react/entries.rb index b52d46e6..c70defe5 100644 --- a/lib/docs/filters/react/entries.rb +++ b/lib/docs/filters/react/entries.rb @@ -9,6 +9,7 @@ module Docs REPLACE_TYPES = { 'Quick Start' => 'Guides', + 'User Guide' => 'Guides', 'The Basics' => 'Getting Started', 'apis' => 'APIs', 'components' => 'Components' diff --git a/lib/docs/scrapers/flow.rb b/lib/docs/scrapers/flow.rb index 9c008d03..6462d8b3 100644 --- a/lib/docs/scrapers/flow.rb +++ b/lib/docs/scrapers/flow.rb @@ -1,18 +1,17 @@ module Docs class Flow < React self.type = 'react' - self.release = '0.22' - self.base_url = 'http://flowtype.org/docs/' - self.root_path = 'about-flow.html' + self.release = '0.33' + self.base_url = 'https://flowtype.org/docs/' + self.root_path = 'getting-started.html' self.links = { - home: 'http://flowtype.org/', + home: 'https://flowtype.org/', code: 'https://github.com/facebook/flow' } options[:container] = '.content' options[:root_title] = 'Flow Documentation' options[:only_patterns] = nil - options[:skip] = %w(coming-soon.html) options[:attribution] = <<-HTML © 2013–2016 Facebook Inc.