|
|
@ -2,9 +2,11 @@ module Docs
|
|
|
|
class Symfony
|
|
|
|
class Symfony
|
|
|
|
class CleanHtmlFilter < Filter
|
|
|
|
class CleanHtmlFilter < Filter
|
|
|
|
def call
|
|
|
|
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.content = 'Symfony' if root_page?
|
|
|
|
node.parent.before(node).remove
|
|
|
|
node.parent.before(node).remove
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -22,6 +24,13 @@ module Docs
|
|
|
|
node.before(node.children).remove
|
|
|
|
node.before(node.children).remove
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css('.container-fluid').each do |node|
|
|
|
|
|
|
|
|
html = node.inner_html
|
|
|
|
|
|
|
|
html.gsub! %r{<div class="col[^>]+>(.+?)</div>}, '<td>\1</td>'
|
|
|
|
|
|
|
|
html.gsub! %r{<div class="row[^>]+>(.+?)</div>}, '<tr>\1</tr>'
|
|
|
|
|
|
|
|
node.replace("<table>#{html}</table>")
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
doc
|
|
|
|
doc
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|