From 96d50431bfcc0172af7d373bbb6d047da1646872 Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Sat, 23 Jul 2016 18:59:56 -0400 Subject: [PATCH] Update Symfony documentation (3.1.2, 3.0.1, 2.8.2, 2.7.9) --- lib/docs/filters/symfony/clean_html.rb | 13 +++++++++++-- lib/docs/scrapers/symfony.rb | 5 +++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/docs/filters/symfony/clean_html.rb b/lib/docs/filters/symfony/clean_html.rb index 98f6aecc..7926b9a7 100644 --- a/lib/docs/filters/symfony/clean_html.rb +++ b/lib/docs/filters/symfony/clean_html.rb @@ -2,9 +2,11 @@ module Docs class Symfony class CleanHtmlFilter < Filter def call - css('.location', '#footer').remove + @doc = at_css('#page-content') - css('.header > h1').each do |node| + css('.location', '.no-description').remove + + css('.page-header > h1').each do |node| node.content = 'Symfony' if root_page? node.parent.before(node).remove end @@ -22,6 +24,13 @@ module Docs node.before(node.children).remove end + css('.container-fluid').each do |node| + html = node.inner_html + html.gsub! %r{
]+>(.+?)
}, '\1' + node.replace("#{html}
") + end + doc end end diff --git a/lib/docs/scrapers/symfony.rb b/lib/docs/scrapers/symfony.rb index d77246f8..1cd3981b 100644 --- a/lib/docs/scrapers/symfony.rb +++ b/lib/docs/scrapers/symfony.rb @@ -26,6 +26,11 @@ module Docs Licensed under the MIT License. HTML + version '3.1' do + self.release = '3.1.2' + self.base_url = "http://api.symfony.com/#{version}/" + end + version '3.0' do self.release = '3.0.1' self.base_url = "http://api.symfony.com/#{version}/"