mirror of https://github.com/freeCodeCamp/devdocs
parent
3a7cc9c535
commit
9386a2d368
@ -1,53 +1,22 @@
|
|||||||
._ember {
|
._ember {
|
||||||
> .class-info { @extend %note, %note-blue; }
|
@extend %simple;
|
||||||
> .class-info > p { margin: 0; }
|
|
||||||
|
|
||||||
> .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 {
|
h2 > .flag, h2 > .type {
|
||||||
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;
|
margin-left: .5em;
|
||||||
color: $textColorLight;
|
color: $textColorLight;
|
||||||
}
|
|
||||||
|
|
||||||
> .type {
|
|
||||||
float: right;
|
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.meta { // "defined in"
|
h2 > .type { float: right; }
|
||||||
color: $textColorLight;
|
|
||||||
margin-bottom: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.return, .params {
|
|
||||||
margin-top: 1.5em;
|
|
||||||
|
|
||||||
> h3 {
|
.meta { color: $textColorLight; }
|
||||||
display: inline-block;
|
|
||||||
vertical-align: top;
|
|
||||||
margin: 0 0 1em;
|
|
||||||
font-size: inherit;
|
|
||||||
@extend %label, %label-blue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dl { margin: 0 1em; }
|
dl { margin: 0 1em; }
|
||||||
dt + dt, dd + dt { margin-top: .5em; }
|
dt + dt, dd + dt { margin-top: .5em; }
|
||||||
|
dt > code { @extend %label; }
|
||||||
p > code { @extend %label; }
|
|
||||||
}
|
}
|
||||||
|
@ -1,32 +1,67 @@
|
|||||||
module Docs
|
module Docs
|
||||||
class Ember < UrlScraper
|
class Ember < UrlScraper
|
||||||
|
class << self
|
||||||
|
attr_accessor :guide_url
|
||||||
|
end
|
||||||
|
|
||||||
self.name = 'Ember.js'
|
self.name = 'Ember.js'
|
||||||
self.slug = 'ember'
|
self.slug = 'ember'
|
||||||
self.type = 'ember'
|
self.type = 'ember'
|
||||||
self.release = '2.7.0'
|
self.release = '2.7.0'
|
||||||
self.base_url = 'http://emberjs.com/api/'
|
self.base_url = 'http://emberjs.com/api/'
|
||||||
|
self.guide_url = "https://guides.emberjs.com/v#{self.release}/"
|
||||||
|
self.initial_urls = [guide_url]
|
||||||
self.links = {
|
self.links = {
|
||||||
home: 'http://emberjs.com/',
|
home: 'http://emberjs.com/',
|
||||||
code: 'https://github.com/emberjs/ember.js'
|
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[:title] = false
|
||||||
options[:root_title] = 'Ember.js'
|
options[:root_title] = 'Ember.js'
|
||||||
|
|
||||||
options[:container] = ->(filter) do
|
options[:container] = ->(filter) do
|
||||||
|
if filter.base_url.path.start_with?('/api')
|
||||||
filter.root_page? ? '#toc-list' : '#content'
|
filter.root_page? ? '#toc-list' : '#content'
|
||||||
|
else
|
||||||
|
'main'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Duplicates
|
# Duplicates
|
||||||
options[:skip] = %w(classes/String.html data/classes/DS.html)
|
options[:skip] = %w(classes/String.html data/classes/DS.html)
|
||||||
|
options[:skip_patterns] = [/\._/, /contributing/]
|
||||||
options[:skip_patterns] = [/\._/]
|
|
||||||
|
|
||||||
options[:attribution] = <<-HTML
|
options[:attribution] = <<-HTML
|
||||||
© 2016 Yehuda Katz, Tom Dale and Ember.js contributors<br>
|
© 2016 Yehuda Katz, Tom Dale and Ember.js contributors<br>
|
||||||
Licensed under the MIT License.
|
Licensed under the MIT License.
|
||||||
HTML
|
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
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in new issue