[devdocsgjs/main: 890/1867] enzyme: process review comments




commit af412d641ebead801d1cb9b5cd6e72fe71998852
Author: Jasper van Merle <jaspervmerle gmail com>
Date:   Wed Aug 28 20:16:41 2019 +0200

    enzyme: process review comments

 lib/docs/filters/enzyme/clean_html.rb | 11 +++++++++--
 lib/docs/scrapers/enzyme.rb           |  2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/lib/docs/filters/enzyme/clean_html.rb b/lib/docs/filters/enzyme/clean_html.rb
index 8a42ad0d..caf7980f 100644
--- a/lib/docs/filters/enzyme/clean_html.rb
+++ b/lib/docs/filters/enzyme/clean_html.rb
@@ -4,14 +4,21 @@ module Docs
       def call
         @doc = at_css('.page-inner > section')
 
+        # Remove badges
+        if root_page?
+          css('a > img').each do |node|
+            node.parent.remove
+          end
+        end
+
         # Clean headers
         css('h1').each do |node|
           node.content = node.content
         end
 
         # Make headers on reference pages bigger
-        if subpath.include?('ReactWrapper') || subpath.include?('ShallowWrapper')
-          css('h4').each do |node|
+        if subpath.include?('api/')
+          css('h3, h4').each do |node|
             node.name = 'h2'
           end
         end
diff --git a/lib/docs/scrapers/enzyme.rb b/lib/docs/scrapers/enzyme.rb
index 4bdbb82f..1af4ed60 100644
--- a/lib/docs/scrapers/enzyme.rb
+++ b/lib/docs/scrapers/enzyme.rb
@@ -10,7 +10,7 @@ module Docs
 
     html_filters.push 'enzyme/entries', 'enzyme/clean_html'
 
-    options[:skip] = %w(CHANGELOG.html docs/future.html CONTRIBUTING.html)
+    options[:skip] = %w(CHANGELOG.html docs/future.html docs/guides.html docs/api/ CONTRIBUTING.html)
 
     options[:attribution] = <<-HTML
       &copy; 2015 Airbnb, Inc.<br>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]