diff --git a/assets/images/docs-2.png b/assets/images/docs-2.png
index a1758a0e..ac9ca5e8 100644
Binary files a/assets/images/docs-2.png and b/assets/images/docs-2.png differ
diff --git a/assets/images/docs-2@2x.png b/assets/images/docs-2@2x.png
index b2d719c2..d376d2e1 100644
Binary files a/assets/images/docs-2@2x.png and b/assets/images/docs-2@2x.png differ
diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json
index 461073ec..e0111413 100644
--- a/assets/javascripts/news.json
+++ b/assets/javascripts/news.json
@@ -1,5 +1,8 @@
[
[
+ "2018-07-08",
+ "New documentation: Leaflet"
+ ], [
"2018-03-26",
"DevDocs is joining the freeCodeCamp community. Read the announcement here."
], [
diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee
index 9cfc1a0b..ea59df98 100644
--- a/assets/javascripts/templates/pages/about_tmpl.coffee
+++ b/assets/javascripts/templates/pages/about_tmpl.coffee
@@ -375,6 +375,11 @@ credits = [
'Taylor Otwell',
'MIT',
'https://raw.githubusercontent.com/laravel/framework/master/LICENSE.txt'
+ ], [
+ 'Leaflet',
+ '2010-2018 Vladimir Agafonkin
© 2010-2011, CloudMade
Maps © OpenStreetMap contributors.',
+ 'BSD',
+ 'https://raw.githubusercontent.com/Leaflet/Leaflet/master/LICENSE'
], [
'Less',
'2009-2016 The Core Less Team',
diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss
index a4ae5bf1..d74581be 100644
--- a/assets/stylesheets/global/_icons.scss
+++ b/assets/stylesheets/global/_icons.scss
@@ -170,3 +170,4 @@
._icon-homebrew:before { background-position: 0 -3rem; @extend %doc-icon-2; }
._icon-jekyll:before { background-position: -1rem -3rem; @extend %doc-icon-2; }
._icon-babel:before { background-position: -2rem -3rem; @extend %doc-icon-2; }
+._icon-leaflet:before { background-position: -3rem -3rem; @extend %doc-icon-2; }
diff --git a/lib/docs/filters/leaflet/clean_html.rb b/lib/docs/filters/leaflet/clean_html.rb
index c8d000f3..802463de 100644
--- a/lib/docs/filters/leaflet/clean_html.rb
+++ b/lib/docs/filters/leaflet/clean_html.rb
@@ -2,18 +2,35 @@ module Docs
class Leaflet
class CleanHtmlFilter < Filter
def call
- css('#toc', '.expander').remove
+ css('#toc', '.expander', '.footer').remove
+
+ css('h1').each do |node|
+ node.name = 'h2'
+ end
+
+ at_css('> h2:first-child').name = 'h1'
# remove "This reference reflects Leaflet 1.2.0."
- css('h2 ~ p').each do |node|
+ css('h1 ~ p').each do |node|
node.remove
break
end
- # syntax highlighting
- css('code.lang-js').each do |node|
- node.parent['data-language'] = 'javascript'
- node.parent.content = node.content
+ 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
+ 'html'
+ elsif node['class'].include?('lang-css')
+ 'css'
+ elsif node['class'].include?('lang-js') || node['class'].include?('lang-javascript')
+ 'javascript'
+ end
+ node.parent['data-language'] = lang if lang
+ node.before(node.children).remove
end
doc
diff --git a/lib/docs/scrapers/leaflet.rb b/lib/docs/scrapers/leaflet.rb
index 5e939394..128217b0 100644
--- a/lib/docs/scrapers/leaflet.rb
+++ b/lib/docs/scrapers/leaflet.rb
@@ -1,10 +1,10 @@
module Docs
class Leaflet < UrlScraper
self.name = 'Leaflet'
- self.type = 'leaflet'
+ self.type = 'simple'
self.slug = 'leaflet'
self.links = {
- home: 'http://leafletjs.com/',
+ home: 'https://leafletjs.com/',
code: 'https://github.com/Leaflet/Leaflet'
}
@@ -14,23 +14,29 @@ module Docs
options[:skip_links] = true
options[:attribution] = <<-HTML
- © 2017 Vladimir Agafonkin.
- Maps © OpenStreetMap contributors.