Переглянути джерело

Add ParseCfEmail filter to the default stack used by all scrapers

Thibaut Courouble 7 роки тому
батько
коміт
c7a10efe5b

+ 1 - 1
lib/docs/core/scraper.rb

@@ -41,7 +41,7 @@ module Docs
     self.html_filters = FilterStack.new
     self.text_filters = FilterStack.new
 
-    html_filters.push 'apply_base_url', 'container', 'clean_html', 'normalize_urls', 'internal_urls', 'normalize_paths'
+    html_filters.push 'apply_base_url', 'container', 'clean_html', 'normalize_urls', 'internal_urls', 'normalize_paths', 'parse_cf_email'
     text_filters.push 'images' # ensure the images filter runs after all html filters
     text_filters.push 'inner_html', 'clean_text', 'attribution'
 

+ 1 - 1
lib/docs/scrapers/ansible.rb

@@ -7,7 +7,7 @@ module Docs
       code: 'https://github.com/ansible/ansible'
     }
 
-    html_filters.push 'ansible/entries', 'sphinx/clean_html', 'parse_cf_email'
+    html_filters.push 'ansible/entries', 'sphinx/clean_html'
 
     options[:skip] = %w(
       glossary.html

+ 0 - 2
lib/docs/scrapers/bootstrap.rb

@@ -15,8 +15,6 @@ module Docs
       Documentation licensed under the Creative Commons Attribution License v3.0.
     HTML
 
-    html_filters.push 'parse_cf_email'
-
     version '4' do
       self.release = '4.0.0'
       self.base_url = 'https://getbootstrap.com/docs/4.0/'

+ 1 - 1
lib/docs/scrapers/flow.rb

@@ -8,7 +8,7 @@ module Docs
       code: 'https://github.com/facebook/flow'
     }
 
-    html_filters.push 'flow/entries', 'flow/clean_html', 'title', 'parse_cf_email'
+    html_filters.push 'flow/entries', 'flow/clean_html', 'title'
 
     options[:trailing_slash] = false
     options[:root_title] = 'Flow'

+ 1 - 1
lib/docs/scrapers/laravel.rb

@@ -7,7 +7,7 @@ module Docs
       code: 'https://github.com/laravel/laravel'
     }
 
-    html_filters.push 'laravel/entries', 'laravel/clean_html', 'parse_cf_email'
+    html_filters.push 'laravel/entries', 'laravel/clean_html'
 
     options[:container] = ->(filter) {
       filter.subpath.start_with?('/api') ? '#content' : '.docs-wrapper'

+ 1 - 1
lib/docs/scrapers/node.rb

@@ -8,7 +8,7 @@ module Docs
       code: 'https://github.com/nodejs/node'
     }
 
-    html_filters.push 'node/clean_html', 'node/entries', 'title', 'parse_cf_email'
+    html_filters.push 'node/clean_html', 'node/entries', 'title'
 
     options[:title] = false
     options[:root_title] = 'Node.js'

+ 1 - 1
lib/docs/scrapers/vue.rb

@@ -8,7 +8,7 @@ module Docs
       code: 'https://github.com/vuejs/vue'
     }
 
-    html_filters.push 'vue/entries', 'vue/clean_html', 'parse_cf_email'
+    html_filters.push 'vue/entries', 'vue/clean_html'
 
     options[:only_patterns] = [/guide\//, /api\//]
     options[:skip] = %w(guide/team.html)

+ 1 - 1
lib/docs/scrapers/yarn.rb

@@ -8,7 +8,7 @@ module Docs
       code: 'https://github.com/yarnpkg/yarn'
     }
 
-    html_filters.push 'yarn/entries', 'yarn/clean_html', 'title', 'parse_cf_email'
+    html_filters.push 'yarn/entries', 'yarn/clean_html', 'title'
 
     options[:root_title] = 'Yarn'
     options[:trailing_slash] = false