mirror of https://github.com/freeCodeCamp/devdocs
parent
3a7cc9c535
commit
9386a2d368
@ -1,53 +1,22 @@
|
||||
._ember {
|
||||
> .class-info { @extend %note, %note-blue; }
|
||||
> .class-info > p { margin: 0; }
|
||||
@extend %simple;
|
||||
|
||||
> .description > h2, > .description > h3 { font-size: 1rem; }
|
||||
blockquote.class-info { @extend %note-blue; }
|
||||
blockquote.class-info > p { margin: 0; }
|
||||
|
||||
.item-entry { padding-left: 1rem; }
|
||||
.pre-title { @extend %pre-heading; }
|
||||
|
||||
.title {
|
||||
margin-left: -1rem;
|
||||
@extend %block-heading;
|
||||
|
||||
> h2, > .args, > .flag {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin: 0;
|
||||
line-height: inherit;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
> .flag { // "static"
|
||||
margin-left: .5em;
|
||||
color: $textColorLight;
|
||||
}
|
||||
|
||||
> .type {
|
||||
float: right;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.meta { // "defined in"
|
||||
h2 > .flag, h2 > .type {
|
||||
margin-left: .5em;
|
||||
color: $textColorLight;
|
||||
margin-bottom: 1em;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.return, .params {
|
||||
margin-top: 1.5em;
|
||||
h2 > .type { float: right; }
|
||||
|
||||
> h3 {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin: 0 0 1em;
|
||||
font-size: inherit;
|
||||
@extend %label, %label-blue;
|
||||
}
|
||||
}
|
||||
.meta { color: $textColorLight; }
|
||||
|
||||
dl { margin: 0 1em; }
|
||||
dt + dt, dd + dt { margin-top: .5em; }
|
||||
|
||||
p > code { @extend %label; }
|
||||
dt > code { @extend %label; }
|
||||
}
|
||||
|
@ -1,32 +1,67 @@
|
||||
module Docs
|
||||
class Ember < UrlScraper
|
||||
class << self
|
||||
attr_accessor :guide_url
|
||||
end
|
||||
|
||||
self.name = 'Ember.js'
|
||||
self.slug = 'ember'
|
||||
self.type = 'ember'
|
||||
self.release = '2.7.0'
|
||||
self.base_url = 'http://emberjs.com/api/'
|
||||
self.guide_url = "https://guides.emberjs.com/v#{self.release}/"
|
||||
self.initial_urls = [guide_url]
|
||||
self.links = {
|
||||
home: 'http://emberjs.com/',
|
||||
code: 'https://github.com/emberjs/ember.js'
|
||||
}
|
||||
|
||||
html_filters.push 'ember/clean_html', 'ember/entries', 'title'
|
||||
html_filters.push 'ember/entries', 'ember/clean_html', 'title'
|
||||
|
||||
options[:trailing_slash] = false
|
||||
|
||||
options[:title] = false
|
||||
options[:root_title] = 'Ember.js'
|
||||
|
||||
options[:container] = ->(filter) do
|
||||
filter.root_page? ? '#toc-list' : '#content'
|
||||
if filter.base_url.path.start_with?('/api')
|
||||
filter.root_page? ? '#toc-list' : '#content'
|
||||
else
|
||||
'main'
|
||||
end
|
||||
end
|
||||
|
||||
# Duplicates
|
||||
options[:skip] = %w(classes/String.html data/classes/DS.html)
|
||||
|
||||
options[:skip_patterns] = [/\._/]
|
||||
options[:skip_patterns] = [/\._/, /contributing/]
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2016 Yehuda Katz, Tom Dale and Ember.js contributors<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
|
||||
def guide_url
|
||||
@guide_url ||= URL.parse(self.class.guide_url)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def process_url?(url)
|
||||
base_url.contains?(url) || guide_url.contains?(url)
|
||||
end
|
||||
|
||||
def process_response(response)
|
||||
original_scheme = @base_url.scheme
|
||||
original_host = @base_url.host
|
||||
original_path = @base_url.path
|
||||
@base_url.scheme = response.effective_url.scheme
|
||||
@base_url.host = response.effective_url.host
|
||||
@base_url.path = response.effective_url.path[/\A\/v[\d\.]+\//, 0] || '/api/'
|
||||
super
|
||||
ensure
|
||||
@base_url.scheme = original_scheme
|
||||
@base_url.host = original_host
|
||||
@base_url.path = original_path
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in new issue