|
|
@ -4,7 +4,7 @@ module Docs
|
|
|
|
def call
|
|
|
|
def call
|
|
|
|
# Move the title into the main content node in the v1 docs
|
|
|
|
# Move the title into the main content node in the v1 docs
|
|
|
|
title = at_css('h1.title')
|
|
|
|
title = at_css('h1.title')
|
|
|
|
unless title.nil?
|
|
|
|
if title
|
|
|
|
name = title.children.last.content.strip
|
|
|
|
name = title.children.last.content.strip
|
|
|
|
kind = title.at_css('.kind').content
|
|
|
|
kind = title.at_css('.kind').content
|
|
|
|
at_css('.main-content').prepend_child("<h1>#{name} #{kind}</h1>")
|
|
|
|
at_css('.main-content').prepend_child("<h1>#{name} #{kind}</h1>")
|
|
|
@ -39,11 +39,26 @@ module Docs
|
|
|
|
header.add_child node unless header.nil?
|
|
|
|
header.add_child node unless header.nil?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css('section').each do |node|
|
|
|
|
|
|
|
|
if node['id'] && node.first_element_child
|
|
|
|
|
|
|
|
node.first_element_child['id'] ||= node['id']
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
node.before(node.children).remove
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css('span').each do |node|
|
|
|
|
|
|
|
|
node.before(node.children).remove
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# Make code blocks detectable by Prism
|
|
|
|
# Make code blocks detectable by Prism
|
|
|
|
css('pre').each do |node|
|
|
|
|
css('pre').each do |node|
|
|
|
|
node['data-language'] = 'dart'
|
|
|
|
node['data-language'] = 'dart'
|
|
|
|
|
|
|
|
node.content = node.content
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css('.properties', '.property', '.callables', '.callable').remove_attr('class')
|
|
|
|
|
|
|
|
|
|
|
|
doc
|
|
|
|
doc
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|