Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -1,7 +1,7 @@ | |||
| 1 | [ | 1 | [ |
| 2 | [ | 2 | [ |
| 3 | "2015-03-22", | 3 | "2015-03-22", |
| 4 | "New <a href=\"/mocha/\">mocha</a> documentation" | 4 | "New <a href=\"/meteor/\">Meteor</a> and <a href=\"/mocha/\">mocha</a> documentations" |
| 5 | ], [ | 5 | ], [ |
| 6 | "2015-02-22", | 6 | "2015-02-22", |
| 7 | "Improved <a href=\"/http/\">HTTP</a> documentation", | 7 | "Improved <a href=\"/http/\">HTTP</a> documentation", |
| @@ -220,6 +220,11 @@ credits = [ · 219 unmodified lines | |||
| 220 | '2015 MaxCDN', | 220 | '2015 MaxCDN', |
| 221 | 'MIT', | 221 | 'MIT', |
| 222 | 'https://raw.githubusercontent.com/MaxCDN/api-docs/master/LICENSE' | 222 | 'https://raw.githubusercontent.com/MaxCDN/api-docs/master/LICENSE' |
| 223 | ], [ | ||
| 224 | 'Meteor', | ||
| 225 | '2011-2015 Meteor Development Group', | ||
| 226 | 'MIT', | ||
| 227 | 'https://raw.githubusercontent.com/meteor/meteor/master/LICENSE.txt' | ||
| 223 | ], [ | 228 | ], [ |
| 224 | 'Minitest', | 229 | 'Minitest', |
| 225 | 'Ryan Davis, seattle.rb', | 230 | 'Ryan Davis, seattle.rb', |
| @@ -0,0 +1,7 @@ | |||
| 1 | #= require views/pages/base | ||
| 2 | |||
| 3 | class app.views.MeteorPage extends app.views.BasePage | ||
| 4 | afterRender: -> | ||
| 5 | @highlightCode @findAll('pre.js, pre.javascript'), 'javascript' | ||
| 6 | @highlightCode @findAll('pre.html'), 'markup' | ||
| 7 | return | ||
| @@ -52,6 +52,7 @@ · 51 unmodified lines | |||
| 52 | 'pages/markdown', | 52 | 'pages/markdown', |
| 53 | 'pages/maxcdn', | 53 | 'pages/maxcdn', |
| 54 | 'pages/mdn', | 54 | 'pages/mdn', |
| 55 | 'pages/meteor', | ||
| 55 | 'pages/modernizr', | 56 | 'pages/modernizr', |
| 56 | 'pages/moment', | 57 | 'pages/moment', |
| 57 | 'pages/mongoose', | 58 | 'pages/mongoose', |
| @@ -52,6 +52,7 @@ · 51 unmodified lines | |||
| 52 | 'pages/markdown', | 52 | 'pages/markdown', |
| 53 | 'pages/maxcdn', | 53 | 'pages/maxcdn', |
| 54 | 'pages/mdn', | 54 | 'pages/mdn', |
| 55 | 'pages/meteor', | ||
| 55 | 'pages/modernizr', | 56 | 'pages/modernizr', |
| 56 | 'pages/moment', | 57 | 'pages/moment', |
| 57 | 'pages/mongoose', | 58 | 'pages/mongoose', |
| @@ -98,3 +98,4 @@ · 97 unmodified lines | |||
| 98 | ._icon-clojure:before { background-position: -4rem -7rem; } | 98 | ._icon-clojure:before { background-position: -4rem -7rem; } |
| 99 | ._icon-symfony:before { background-position: -5rem -7rem; } | 99 | ._icon-symfony:before { background-position: -5rem -7rem; } |
| 100 | ._icon-mocha:before { background-position: -6rem -7rem; } | 100 | ._icon-mocha:before { background-position: -6rem -7rem; } |
| 101 | ._icon-meteor:before { background-position: -7rem -7rem; @extend %darkIconFix !optional; } | ||
| @@ -0,0 +1,15 @@ | |||
| 1 | ._meteor { | ||
| 2 | @extend %simple; | ||
| 3 | |||
| 4 | .note, .warning { @extend %note; } | ||
| 5 | .warning { @extend %note-red; } | ||
| 6 | |||
| 7 | dl.args { margin-left: 1rem; } | ||
| 8 | |||
| 9 | .locus { float: right; } | ||
| 10 | .locus, .type { | ||
| 11 | margin-left: .5em; | ||
| 12 | font-size: .9em; | ||
| 13 | color: $textColorLight; | ||
| 14 | } | ||
| 15 | } | ||
| @@ -0,0 +1,22 @@ | |||
| 1 | module Docs | ||
| 2 | class Meteor | ||
| 3 | class CleanHtmlFilter < Filter | ||
| 4 | def call | ||
| 5 | @doc = at_css('#introduction').parent | ||
| 6 | |||
| 7 | css('.github-ribbon').remove | ||
| 8 | |||
| 9 | css('.selflink', 'b > em').each do |node| | ||
| 10 | node.before(node.children).remove | ||
| 11 | end | ||
| 12 | |||
| 13 | css('pre').each do |node| | ||
| 14 | node['class'] = node.at_css('code')['class'] | ||
| 15 | node.content = node.content | ||
| 16 | end | ||
| 17 | |||
| 18 | doc | ||
| 19 | end | ||
| 20 | end | ||
| 21 | end | ||
| 22 | end | ||
| @@ -0,0 +1,29 @@ | |||
| 1 | module Docs | ||
| 2 | class Meteor | ||
| 3 | class EntriesFilter < Docs::EntriesFilter | ||
| 4 | def additional_entries | ||
| 5 | type = nil | ||
| 6 | |||
| 7 | at_css('.full-api-toc').element_children.each_with_object [] do |node, entries| | ||
| 8 | link = node.at_css('a') | ||
| 9 | next unless link | ||
| 10 | |||
| 11 | target = link['href'].remove('#/full/') | ||
| 12 | |||
| 13 | case node.name | ||
| 14 | when 'h1' | ||
| 15 | type = node.content.strip | ||
| 16 | when 'h2' | ||
| 17 | if type == 'Concepts' | ||
| 18 | entries << [node.content, target, type] | ||
| 19 | else | ||
| 20 | type = node.content.strip | ||
| 21 | end | ||
| 22 | when 'h3', 'h4' | ||
| 23 | entries << [node.content, target, type] | ||
| 24 | end | ||
| 25 | end | ||
| 26 | end | ||
| 27 | end | ||
| 28 | end | ||
| 29 | end | ||
| @@ -0,0 +1,51 @@ | |||
| 1 | module Docs | ||
| 2 | class Meteor < UrlScraper | ||
| 3 | self.type = 'meteor' | ||
| 4 | self.version = '1.0.4' | ||
| 5 | self.base_url = 'http://docs.meteor.com' | ||
| 6 | self.root_path = '/#/full/' | ||
| 7 | self.links = { | ||
| 8 | home: 'https://www.meteor.com/', | ||
| 9 | code: 'https://github.com/meteor/meteor/' | ||
| 10 | } | ||
| 11 | |||
| 12 | html_filters.push 'meteor/entries', 'meteor/clean_html', 'title' | ||
| 13 | |||
| 14 | options[:title] = 'Meteor' | ||
| 15 | options[:skip_links] = true | ||
| 16 | |||
| 17 | options[:attribution] = <<-HTML | ||
| 18 | © 2011–2015 Meteor Development Group<br> | ||
| 19 | Licensed under the MIT License. | ||
| 20 | HTML | ||
| 21 | |||
| 22 | private | ||
| 23 | |||
| 24 | def request_one(url) | ||
| 25 | stub_root_page if url == root_url.to_s | ||
| 26 | super | ||
| 27 | end | ||
| 28 | |||
| 29 | def request_all(urls, &block) | ||
| 30 | stub_root_page | ||
| 31 | super | ||
| 32 | end | ||
| 33 | |||
| 34 | def stub_root_page | ||
| 35 | response = Typhoeus::Response.new( | ||
| 36 | effective_url: root_url.to_s, | ||
| 37 | code: 200, | ||
| 38 | headers: { 'Content-Type' => 'text/html' }, | ||
| 39 | body: get_root_page_body) | ||
| 40 | |||
| 41 | Typhoeus.stub(root_url.to_s).and_return(response) | ||
| 42 | end | ||
| 43 | |||
| 44 | def get_root_page_body | ||
| 45 | require 'capybara' | ||
| 46 | Capybara.current_driver = :selenium | ||
| 47 | Capybara.visit(root_url.to_s) | ||
| 48 | Capybara.find('.body')['innerHTML'] | ||
| 49 | end | ||
| 50 | end | ||
| 51 | end | ||
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | |||
| 1 | https://www.meteor.com/ | ||