update Ember docs

* better organization of items (put classes at top level)
* add both v3 and v2 docs
pull/1483/head
Vadim Kazakov 4 years ago
parent cc32a355d7
commit 5c99f2cf24

@ -2,7 +2,7 @@ module Docs
class Ember
class CleanHtmlFilter < Filter
def call
css('hr', '.edit-page', '.heading__link__edit', 'aside').remove
css('hr', '.edit-page', '.heading__link__edit', 'aside', '.old-version-warning').remove
base_url.host.start_with?('api') ? api : guide

@ -17,15 +17,17 @@ module Docs
def get_type
if base_url.host.start_with?('api')
name = self.name.remove(/ \(.*/)
if name.start_with?('@') || name == 'rsvp'
'Packages'
elsif name == 'Function'
'Functions'
if name == 'Function'
'3. Functions'
elsif at_css('h1').content.start_with?('Package')
'2. Packages'
else
'Classes'
name = name.remove(' (methods)').remove(' (properties)').remove(' (events)')
# Reference gets sorted to the top by default, need to have it with other classes so add a zero width space
name == 'Reference' ? 'Reference' : name
end
else
'Guide'
'1. Guide'
end
end

@ -7,12 +7,6 @@ module Docs
self.name = 'Ember.js'
self.slug = 'ember'
self.type = 'ember'
self.release = '3.25.0'
self.base_urls = %w[
https://guides.emberjs.com/v3.25.0/
https://api.emberjs.com/ember/3.25/
https://api.emberjs.com/ember-data/3.25/
]
self.links = {
home: 'https://emberjs.com/',
code: 'https://github.com/emberjs/ember.js'
@ -54,12 +48,23 @@ module Docs
options[:decode_and_clean_paths] = true # handle paths like @ember/application
def initial_urls
%w(
version '3' do
self.release = '3.25.0'
self.base_urls = %w[
https://guides.emberjs.com/v3.25.0/
https://api.emberjs.com/ember/3.25/
https://api.emberjs.com/ember-data/3.25/
)
]
end
version '2' do
self.release = '2.18.0'
self.base_urls = %w[
https://guides.emberjs.com/v2.18.0/
https://api.emberjs.com/ember/2.18/
https://api.emberjs.com/ember-data/2.18/
]
options[:skip_patterns].push(/handlebars-basics$/)
end
def get_latest_version(opts)

Loading…
Cancel
Save