From 610e49119ffafc88ad5b4b56da6b99d9583294ad Mon Sep 17 00:00:00 2001 From: Thu Trang Pham Date: Sun, 1 Mar 2015 18:00:37 -0500 Subject: [PATCH] Renamed official_url to home_url --- lib/docs/core/scraper.rb | 2 +- lib/docs/filters/core/home_url.rb | 16 ++++++++++++++++ lib/docs/filters/core/official_url.rb | 15 --------------- 3 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 lib/docs/filters/core/home_url.rb delete mode 100644 lib/docs/filters/core/official_url.rb diff --git a/lib/docs/core/scraper.rb b/lib/docs/core/scraper.rb index 93861575..25e33cc1 100644 --- a/lib/docs/core/scraper.rb +++ b/lib/docs/core/scraper.rb @@ -34,7 +34,7 @@ module Docs self.text_filters = FilterStack.new html_filters.push 'container', 'clean_html', 'normalize_urls', 'internal_urls', 'normalize_paths' - text_filters.push 'official_url', 'inner_html', 'clean_text', 'attribution' + text_filters.push 'home_url', 'inner_html', 'clean_text', 'attribution' def build_page(path) response = request_one url_for(path) diff --git a/lib/docs/filters/core/home_url.rb b/lib/docs/filters/core/home_url.rb new file mode 100644 index 00000000..0892f3fd --- /dev/null +++ b/lib/docs/filters/core/home_url.rb @@ -0,0 +1,16 @@ +module Docs + class HomeUrlFilter < Filter + def call + html.prepend(home_url_html) if home_url + html + end + + def home_url_html + <<-HTML.strip_heredoc +
+ Official Documentation: #{home_url} +
+ HTML + end + end +end diff --git a/lib/docs/filters/core/official_url.rb b/lib/docs/filters/core/official_url.rb deleted file mode 100644 index 9b3097ae..00000000 --- a/lib/docs/filters/core/official_url.rb +++ /dev/null @@ -1,15 +0,0 @@ -module Docs - class OfficialUrlFilter < Filter - def call - official_url_html << html if base_url - end - - def official_url_html - <<-HTML.strip_heredoc -
- Official Documentation: #{base_url} -
- HTML - end - end -end