mirror of https://github.com/freeCodeCamp/devdocs
parent
71bbf4994b
commit
5f7005729c
@ -1,7 +0,0 @@
|
||||
#= require views/pages/base
|
||||
|
||||
class app.views.MeteorPage extends app.views.BasePage
|
||||
prepare: ->
|
||||
@highlightCode @findAll('pre.js, pre.javascript'), 'javascript'
|
||||
@highlightCode @findAll('pre.html'), 'markup'
|
||||
return
|
@ -1,33 +1,36 @@
|
||||
module Docs
|
||||
class Meteor < UrlScraper
|
||||
include StubRootPage
|
||||
|
||||
self.type = 'meteor'
|
||||
self.release = '1.2.0'
|
||||
self.base_url = 'http://docs.meteor.com'
|
||||
self.root_path = '/#/full/'
|
||||
self.release = '1.3.0'
|
||||
self.base_url = 'http://guide.meteor.com/v1.3/'
|
||||
self.initial_paths = %w(guide)
|
||||
self.links = {
|
||||
home: 'https://www.meteor.com/',
|
||||
code: 'https://github.com/meteor/meteor/'
|
||||
}
|
||||
|
||||
html_filters.push 'meteor/entries', 'meteor/clean_html', 'title'
|
||||
html_filters.push 'meteor/entries', 'meteor/clean_html'
|
||||
|
||||
options[:title] = 'Meteor'
|
||||
options[:skip_links] = true
|
||||
options[:skip_links] = ->(filter) { filter.root_page? }
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2011–2015 Meteor Development Group<br>
|
||||
© 2011–2016 Meteor Development Group<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
|
||||
private
|
||||
|
||||
def root_page_body
|
||||
require 'capybara'
|
||||
stub '' do
|
||||
require 'capybara/dsl'
|
||||
Capybara.current_driver = :selenium
|
||||
Capybara.visit(root_url.to_s)
|
||||
Capybara.run_server = false
|
||||
Capybara.app_host = 'https://docs.meteor.com'
|
||||
Capybara.visit('/#/full/')
|
||||
Capybara.find('.body')['innerHTML']
|
||||
end
|
||||
|
||||
stub 'guide' do
|
||||
request_one(url_for('index.html')).body
|
||||
end
|
||||
|
||||
options[:replace_paths] = { 'index.html' => 'guide' }
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in new issue