From 07904f6e1ce72a1993a0d8af73d9439f8818acca Mon Sep 17 00:00:00 2001 From: David Date: Fri, 9 Sep 2016 14:06:09 +0800 Subject: [PATCH] added v3 scraper --- lib/docs/scrapers/craft_cms.rb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/docs/scrapers/craft_cms.rb b/lib/docs/scrapers/craft_cms.rb index a77e1262..b30d2cf0 100755 --- a/lib/docs/scrapers/craft_cms.rb +++ b/lib/docs/scrapers/craft_cms.rb @@ -9,15 +9,26 @@ module Docs options[:skip_patterns] = [/features/, /support/, /pricing/, /introduction/, /community/, /search/, /news/, /changelog/, /index/] options[:container] = 'div[id=content]' - - version '2.6' do - self.release = '2.6.2930' +# For Version 2 + version '2' do + self.release = '2' self.base_url = 'https://craftcms.com/' self.root_path = 'docs' html_filters.push 'craft_cms/clean_html_v2', 'craft_cms/entries_v2' end + +# For Version 3 + version '3' do + self.release = '3' + self.base_url = 'https://craftcms.com/3/' + self.root_path = 'docs' + + options[:skip] = %w(docs/installing-and-updating) + + html_filters.push 'craft_cms/clean_html_v3', 'craft_cms/entries_v3' + end end end