File tree Expand file tree Collapse file tree 6 files changed +94
-0
lines changed
public/icons/docs/leaflet Expand file tree Collapse file tree 6 files changed +94
-0
lines changed Original file line number Diff line number Diff line change
1
+ module Docs
2
+ class Leaflet
3
+ class CleanHtmlFilter < Filter
4
+ def call
5
+ css ( '#toc' , '.expander' ) . remove
6
+
7
+ # remove "This reference reflects Leaflet 1.2.0."
8
+ css ( 'h2 ~ p' ) . each do |node |
9
+ node . remove
10
+ break
11
+ end
12
+
13
+ # syntax highlighting
14
+ css ( 'code.lang-js' ) . each do |node |
15
+ node . parent [ 'data-language' ] = 'javascript'
16
+ node . parent . content = node . content
17
+ end
18
+
19
+ doc
20
+ end
21
+ end
22
+ end
23
+ end
Original file line number Diff line number Diff line change
1
+ module Docs
2
+ class Leaflet
3
+ class EntriesFilter < Docs ::EntriesFilter
4
+ def additional_entries
5
+ entries = [ ]
6
+ type = nil
7
+ subtype = nil
8
+
9
+ css ( '*' ) . each do |node |
10
+ if node . name == 'h2' && node [ 'id' ]
11
+ type = node . content
12
+ subtype = nil
13
+ entries << [ type , node [ 'id' ] , type ]
14
+ elsif node . name == 'h3'
15
+ subtype = node . content
16
+ elsif node . name == 'tr' && node [ 'id' ]
17
+ value = node . css ( 'td > code > b' ) . first . content
18
+ if subtype && subtype . end_with? ( ' options' )
19
+ name = "#{ subtype } : #{ value } "
20
+ elsif subtype
21
+ name = "#{ type } #{ subtype . downcase } : #{ value } "
22
+ else
23
+ name = "#{ type } : #{ value } "
24
+ end
25
+ entries << [ name , node [ 'id' ] , type ]
26
+ end
27
+ end
28
+
29
+ entries
30
+ end
31
+ end
32
+ end
33
+ end
Original file line number Diff line number Diff line change
1
+ module Docs
2
+ class Leaflet < UrlScraper
3
+ self . name = 'Leaflet'
4
+ self . type = 'leaflet'
5
+ self . slug = 'leaflet'
6
+ self . links = {
7
+ home : 'http://leafletjs.com/' ,
8
+ code : 'https://github.com/Leaflet/Leaflet'
9
+ }
10
+
11
+ html_filters . push 'leaflet/entries' , 'leaflet/clean_html' , 'title'
12
+
13
+ options [ :container ] = '.container'
14
+ options [ :skip_links ] = true
15
+
16
+ options [ :attribution ] = <<-HTML
17
+ © 2017 < a href ="http://agafonkin.com/en "> Vladimir Agafonkin</ a > .
18
+ Maps © < a href ="http://openstreetmap.org/copyright "> OpenStreetMap</ a > contributors.</ p>
19
+ HTML
20
+
21
+ version '1.2' do
22
+ self . release = '1.2.0'
23
+ self . base_url = "http://leafletjs.com/reference-#{ release } .html"
24
+ end
25
+
26
+ version '1.1' do
27
+ self . release = '1.1.0'
28
+ self . base_url = "http://leafletjs.com/reference-#{ release } .html"
29
+ end
30
+
31
+ version '1.0' do
32
+ self . release = '1.0.3'
33
+ self . base_url = "http://leafletjs.com/reference-#{ release } .html"
34
+ end
35
+
36
+ end
37
+ end
Original file line number Diff line number Diff line change
1
+ http://leafletjs.com/docs/images/favicon.ico
You can’t perform that action at this time.
0 commit comments