Skip to content

Commit 4ad6715

Browse files
committed
Add OpenLayers documentation (10.4.0)
1 parent 549c19a commit 4ad6715

File tree

9 files changed

+81
-0
lines changed

9 files changed

+81
-0
lines changed

assets/javascripts/news.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
[
2+
[
3+
"2025-02-16",
4+
"New documentation: <a href=\"/openlayers/\">OpenLayers</a>"
5+
],
26
[
37
"2024-11-23",
48
"New documentation: <a href=\"/duckdb/\">DuckDB</a>"

assets/stylesheets/application.css.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
'pages/nushell',
9898
'pages/octave',
9999
'pages/openjdk',
100+
'pages/openlayers',
100101
'pages/perl',
101102
'pages/phalcon',
102103
'pages/phaser',
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
._openlayers {
2+
@extend %simple;
3+
.nameContainer {
4+
@extend %block-label;
5+
> * { display: inline-block; margin: 0; }
6+
> .tag-source { float: right; }
7+
}
8+
.card { @extend %box; margin-bottom: 1rem; padding: 1rem; }
9+
.signature, .type-signature { @extend %code; }
10+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module Docs
2+
class Openlayers
3+
class CleanHtmlFilter < Filter
4+
def call
5+
@doc = at_css('section')
6+
7+
at_css('h2').name = 'h1' if at_css('h2')
8+
9+
css('pre.prettyprint').each do |node|
10+
node['data-language'] = node['class'].include?('html') ? 'html' : 'js'
11+
node.content = node.content
12+
end
13+
14+
doc
15+
end
16+
end
17+
end
18+
end
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module Docs
2+
class Openlayers
3+
class EntriesFilter < Docs::EntriesFilter
4+
def get_name
5+
at_css('h2').text.split('~').last.strip
6+
end
7+
8+
def get_type
9+
slug[/ol_([^_]+)_/, 1] or 'ol'
10+
end
11+
12+
def additional_entries
13+
css('h4.name').each_with_object [] do |node, entries|
14+
node['id'] = node.previous_element['id']
15+
name = node.children.find {|n| n.text? }.text.strip
16+
name.prepend "#{self.name}."
17+
entries << [name, node['id']]
18+
end
19+
end
20+
end
21+
end
22+
end

lib/docs/scrapers/openlayers.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module Docs
2+
class Openlayers < UrlScraper
3+
self.name = 'OpenLayers'
4+
self.type = 'openlayers'
5+
self.slug = 'openlayers'
6+
self.release = '10.4.0'
7+
self.base_url = "https://openlayers.org/en/latest/apidoc/"
8+
self.links = {
9+
home: 'https://openlayers.org/',
10+
code: 'https://github.com/openlayers/openlayers'
11+
}
12+
13+
html_filters.push 'openlayers/entries', 'openlayers/clean_html'
14+
15+
options[:attribution] = <<-HTML
16+
&copy; 2005-present, OpenLayers Contributors All rights reserved.
17+
Licensed under the BSD 2-Clause License.
18+
HTML
19+
20+
def get_latest_version(opts)
21+
get_npm_version('ol', opts)
22+
end
23+
end
24+
end

public/icons/docs/openlayers/16.png

419 Bytes
Loading
840 Bytes
Loading

public/icons/docs/openlayers/SOURCE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
https://github.com/openlayers
2+
https://avatars.githubusercontent.com/u/240579?s=64

0 commit comments

Comments
 (0)