Skip to content

Commit

Permalink
Fix leaflet documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterEnoc committed Dec 5, 2021
1 parent 5ca406d commit 432b46f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion assets/javascripts/templates/pages/about_tmpl.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ credits = [
'https://ctan.org/pkg/latex2e-help-texinfo/'
], [
'Leaflet',
'2010-2019 Vladimir Agafonkin<br>&copy; 2010-2011, CloudMade<br>Maps &copy; OpenStreetMap contributors.',
'2010-2021 Vladimir Agafonkin<br>&copy; 2010-2011, CloudMade<br>Maps &copy; OpenStreetMap contributors.',
'BSD',
'https://raw.githubusercontent.com/Leaflet/Leaflet/master/LICENSE'
], [
Expand Down
10 changes: 5 additions & 5 deletions lib/docs/scrapers/leaflet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ class Leaflet < UrlScraper
options[:skip_links] = true

options[:attribution] = <<-HTML
&copy; 2010&ndash;2019 Vladimir Agafonkin<br>
&copy; 2010&ndash;2021 Vladimir Agafonkin<br>
&copy; 2010&ndash;2011, CloudMade<br>
Maps &copy; OpenStreetMap contributors.
HTML

version '1.7' do
self.release = '1.7.1'
self.base_url = "https://leafletjs.com/reference-#{release}.html"
self.base_url = "https://leafletjs.com/reference.html"
end

version '1.6' do
Expand Down Expand Up @@ -60,9 +60,9 @@ class Leaflet < UrlScraper
end

def get_latest_version(opts)
doc = fetch_doc('https://leafletjs.com/index.html', opts)
link = doc.css('ul > li > a').to_a.select {|node| node.content == 'Docs'}.first
link['href'].scan(/reference-([0-9.]+)\.html/)[0][0]
doc = fetch_doc('https://leafletjs.com/reference-versions.html', opts)
link = doc.at_css('.container > ul > li:last-child > a').content
link.sub(/[a-zA-Z\s]*/, '')
end
end
end

0 comments on commit 432b46f

Please sign in to comment.