diff --git a/assets/stylesheets/pages/_meteor.scss b/assets/stylesheets/pages/_meteor.scss
index 0de5a9bb..b07bc031 100644
--- a/assets/stylesheets/pages/_meteor.scss
+++ b/assets/stylesheets/pages/_meteor.scss
@@ -1,15 +1,18 @@
._meteor {
@extend %simple;
- .note, .warning { @extend %note; }
+ .note, .warning, .subtitle-page { @extend %note; }
+ .subtitle-page { @extend %note-blue; }
.warning { @extend %note-red; }
dl.args { margin-left: 1rem; }
+ dt > code { @extend %label; }
+ .api-heading { overflow: hidden; }
+ .api-heading > code { font-weight: bold; }
.locus, .src-code { float: right; }
- .locus, .type, .src-code {
- margin-left: .5em;
- font-size: .9em;
- }
+ .locus, .type, .src-code { margin-left: .5em; }
+ h2 .subtext-api { margin-top: .25rem; }
+ .locus, .subtext-api, .subtext-api > code { font-size: .75rem; }
.locus, .type { color: $textColorLight; }
}
diff --git a/lib/docs/core/scraper.rb b/lib/docs/core/scraper.rb
index 2d3b43ee..93aed4c0 100644
--- a/lib/docs/core/scraper.rb
+++ b/lib/docs/core/scraper.rb
@@ -3,7 +3,7 @@ require 'set'
module Docs
class Scraper < Doc
class << self
- attr_accessor :base_url, :root_path, :initial_paths, :options, :html_filters, :text_filters, :stubs
+ attr_accessor :base_url, :root_path, :initial_paths, :initial_urls, :options, :html_filters, :text_filters, :stubs
def inherited(subclass)
super
@@ -16,6 +16,7 @@ module Docs
subclass.base_url = base_url
subclass.root_path = root_path
subclass.initial_paths = initial_paths.dup
+ subclass.initial_urls = initial_urls.dup
subclass.options = options.deep_dup
subclass.html_filters = html_filters.inheritable_copy
subclass.text_filters = text_filters.inheritable_copy
@@ -35,6 +36,7 @@ module Docs
include Instrumentable
self.initial_paths = []
+ self.initial_urls = []
self.options = {}
self.stubs = {}
@@ -103,7 +105,7 @@ module Docs
end
def initial_urls
- @initial_urls ||= [root_url.to_s].concat(initial_paths.map(&method(:url_for))).freeze
+ @initial_urls ||= [root_url.to_s].concat(self.class.initial_urls).concat(initial_paths.map(&method(:url_for))).freeze
end
def pipeline
diff --git a/lib/docs/core/scrapers/url_scraper.rb b/lib/docs/core/scrapers/url_scraper.rb
index 047b0346..f5ecd40c 100644
--- a/lib/docs/core/scrapers/url_scraper.rb
+++ b/lib/docs/core/scrapers/url_scraper.rb
@@ -33,7 +33,11 @@ module Docs
raise "Error status code (#{response.code}): #{response.url}"
end
- response.success? && response.html? && base_url.contains?(response.effective_url)
+ response.success? && response.html? && process_url?(response.effective_url)
+ end
+
+ def process_url?(url)
+ base_url.contains?(url)
end
def load_capybara_selenium
diff --git a/lib/docs/filters/meteor/clean_html.rb b/lib/docs/filters/meteor/clean_html.rb
index 2174150d..bbd383a7 100644
--- a/lib/docs/filters/meteor/clean_html.rb
+++ b/lib/docs/filters/meteor/clean_html.rb
@@ -2,44 +2,45 @@ module Docs
class Meteor
class CleanHtmlFilter < Filter
def call
- root_page? ? root : other
+ @doc = at_css('.content-wrapper')
- css('pre span').each do |node|
- node.before(node.children).remove
- end
-
- doc
- end
+ css('.page-actions', '.anchor').remove
- def root
- @doc = at_css('#introduction').parent
-
- css('.github-ribbon', '#introduction').remove
-
- css('.selflink', 'b > em').each do |node|
+ css('.header-content', '.document-formatting', 'h2 > a', '.api', '.api-body', 'div.desc').each do |node|
node.before(node.children).remove
end
- css('pre').each do |node|
- node['data-language'] = node.at_css('code')['class'].include?('html') ? 'html' : 'js'
- node.content = node.content
+ css('.anchor-offset').each do |node|
+ node.parent['id'] = node['id']
+ node.remove
end
- css('a.src-code').each do |node|
- node.content = 'Source'
+ css('.api-heading').each do |node|
+ heading = node.at_css('h2, h3')
+ name = heading.name
+ node['id'] = heading['id']
+ heading.replace "#{heading.content.strip}
"
+ node.name = name
end
- end
- def other
- @doc = at_css('#content')
-
- css('.edit-discuss-links', '.bottom-nav', '.edit-link').remove
+ css('div.code', 'span.code', '.args .name').each do |node|
+ node.name = 'code'
+ node.remove_attribute('class')
+ end
css('figure.highlight').each do |node|
- node.inner_html = node.at_css('.code pre').inner_html.gsub('
', "\n")
+ node.inner_html = node.at_css('.code pre').inner_html.gsub('