mirror of https://github.com/freeCodeCamp/devdocs
parent
549c19ac83
commit
4ad6715ec1
@ -0,0 +1,10 @@
|
|||||||
|
._openlayers {
|
||||||
|
@extend %simple;
|
||||||
|
.nameContainer {
|
||||||
|
@extend %block-label;
|
||||||
|
> * { display: inline-block; margin: 0; }
|
||||||
|
> .tag-source { float: right; }
|
||||||
|
}
|
||||||
|
.card { @extend %box; margin-bottom: 1rem; padding: 1rem; }
|
||||||
|
.signature, .type-signature { @extend %code; }
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
module Docs
|
||||||
|
class Openlayers
|
||||||
|
class CleanHtmlFilter < Filter
|
||||||
|
def call
|
||||||
|
@doc = at_css('section')
|
||||||
|
|
||||||
|
at_css('h2').name = 'h1' if at_css('h2')
|
||||||
|
|
||||||
|
css('pre.prettyprint').each do |node|
|
||||||
|
node['data-language'] = node['class'].include?('html') ? 'html' : 'js'
|
||||||
|
node.content = node.content
|
||||||
|
end
|
||||||
|
|
||||||
|
doc
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,22 @@
|
|||||||
|
module Docs
|
||||||
|
class Openlayers
|
||||||
|
class EntriesFilter < Docs::EntriesFilter
|
||||||
|
def get_name
|
||||||
|
at_css('h2').text.split('~').last.strip
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_type
|
||||||
|
slug[/ol_([^_]+)_/, 1] or 'ol'
|
||||||
|
end
|
||||||
|
|
||||||
|
def additional_entries
|
||||||
|
css('h4.name').each_with_object [] do |node, entries|
|
||||||
|
node['id'] = node.previous_element['id']
|
||||||
|
name = node.children.find {|n| n.text? }.text.strip
|
||||||
|
name.prepend "#{self.name}."
|
||||||
|
entries << [name, node['id']]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,24 @@
|
|||||||
|
module Docs
|
||||||
|
class Openlayers < UrlScraper
|
||||||
|
self.name = 'OpenLayers'
|
||||||
|
self.type = 'openlayers'
|
||||||
|
self.slug = 'openlayers'
|
||||||
|
self.release = '10.4.0'
|
||||||
|
self.base_url = "https://openlayers.org/en/latest/apidoc/"
|
||||||
|
self.links = {
|
||||||
|
home: 'https://openlayers.org/',
|
||||||
|
code: 'https://github.com/openlayers/openlayers'
|
||||||
|
}
|
||||||
|
|
||||||
|
html_filters.push 'openlayers/entries', 'openlayers/clean_html'
|
||||||
|
|
||||||
|
options[:attribution] = <<-HTML
|
||||||
|
© 2005-present, OpenLayers Contributors All rights reserved.
|
||||||
|
Licensed under the BSD 2-Clause License.
|
||||||
|
HTML
|
||||||
|
|
||||||
|
def get_latest_version(opts)
|
||||||
|
get_npm_version('ol', opts)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
After Width: | Height: | Size: 419 B |
After Width: | Height: | Size: 840 B |
@ -0,0 +1,2 @@
|
|||||||
|
https://github.com/openlayers
|
||||||
|
https://avatars.githubusercontent.com/u/240579?s=64
|
Loading…
Reference in new issue