|
|
|
@ -8,25 +8,25 @@ module Docs
|
|
|
|
|
node.name = 'h2'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
at_css('> h2:first-child').name = 'h1'
|
|
|
|
|
|
|
|
|
|
# remove "This reference reflects Leaflet 1.2.0."
|
|
|
|
|
css('h1 ~ p').each do |node|
|
|
|
|
|
# remove "This reference reflects Leaflet"
|
|
|
|
|
css('p:contains("This reference reflects Leaflet")').each do |node|
|
|
|
|
|
node.remove
|
|
|
|
|
break
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
at_css('> h2:first-child').name = 'h1'
|
|
|
|
|
|
|
|
|
|
css('section', 'code b', '.accordion', '.accordion-overflow', '.accordion-content').each do |node|
|
|
|
|
|
node.before(node.children).remove
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
css('pre > code').each do |node|
|
|
|
|
|
node['class'] ||= ''
|
|
|
|
|
lang = if node['class'].include?('lang-html') || node.content =~ /\A</
|
|
|
|
|
lang = if node['class'].include?('lang-html') || node['class'].include?('language-html') || node.content =~ /\A</
|
|
|
|
|
'html'
|
|
|
|
|
elsif node['class'].include?('lang-css')
|
|
|
|
|
elsif node['class'].include?('lang-css') || node['class'].include?('language-css')
|
|
|
|
|
'css'
|
|
|
|
|
elsif node['class'].include?('lang-js') || node['class'].include?('lang-javascript')
|
|
|
|
|
elsif node['class'].include?('lang-js') || node['class'].include?('language-js') || node['class'].include?('lang-javascript')
|
|
|
|
|
'javascript'
|
|
|
|
|
end
|
|
|
|
|
node.parent['data-language'] = lang if lang
|
|
|
|
|