diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..73db316c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 82% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md index bdb36d55..d1f848bd 100644 --- a/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -27,8 +27,6 @@ Want to contribute? Great. Please review the following guidelines carefully and 2. Make sure your feature fits DevDocs's [vision](https://github.com/freeCodeCamp/devdocs/blob/master/README.md#vision). 3. Provide a clear and detailed explanation of the feature and why it's important to add it. -For general feedback and ideas, please use the [mailing list](https://groups.google.com/d/forum/devdocs). - ## Requesting new documentations Please don't open issues to request new documentations. @@ -37,7 +35,7 @@ Use the [Trello board](https://trello.com/b/6BmTulfx/devdocs-documentation) wher ## Contributing code and features 1. Search for existing issues; someone may already be working on a similar feature. -2. Before embarking on any significant pull request, please open an issue describing the changes you intend to make. Otherwise you risk spending a lot of time working on something I may not want to merge. This also tells other contributors that you're working on the feature. +2. Before embarking on any significant pull request, please open an issue describing the changes you intend to make. Otherwise you risk spending a lot of time working on something we may not want to merge. This also tells other contributors that you're working on the feature. 3. Follow the [coding conventions](#coding-conventions). 4. If you're modifying the Ruby code, include tests and ensure they pass. 5. Try to keep your pull request small and simple. @@ -65,13 +63,6 @@ Please don't submit a pull request updating the version number of a documentatio To ask that an existing documentation be updated, please use the [Trello board](https://trello.com/c/2B0hmW7M/52-request-updates-here). -## Other contributions - -Besides new docs and features, here are other ways you can contribute: - -* **Improve our copy.** English isn't my first language so if you notice grammatical or usage errors, feel free to submit a pull request — it'll be much appreciated. -* **Participate in the issue tracker.** Your opinion matters — feel free to add comments to existing issues. You're also welcome to participate to the [mailing list](https://groups.google.com/d/forum/devdocs). - ## Coding conventions * two spaces; no tabs @@ -80,4 +71,4 @@ Besides new docs and features, here are other ways you can contribute: ## Questions? -If you have any questions, please feel free to ask on the [mailing list](https://groups.google.com/d/forum/devdocs). +If you have any questions, please feel free to ask them on the contributor chat room on [Gitter](https://gitter.im/FreeCodeCamp/DevDocs). diff --git a/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md similarity index 73% rename from ISSUE_TEMPLATE.md rename to .github/ISSUE_TEMPLATE.md index 4b173394..807f88e0 100644 --- a/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,6 +1,6 @@ +
+ Expressive HTTP middleware framework for node.js to make web applications and APIs more enjoyable to write. Koa's middleware stack flows in a stack-like manner, allowing you to perform actions downstream then filter and manipulate the response upstream. +
++ Only methods that are common to nearly all HTTP servers are integrated directly into Koa's small ~570 SLOC codebase. This includes things like content negotiation, normalization of node inconsistencies, redirection, and a few others. +
++ Koa is not bundled with any middleware. +
+ HTML + end + end + end +end diff --git a/lib/docs/filters/koa/entries.rb b/lib/docs/filters/koa/entries.rb new file mode 100644 index 00000000..6e237371 --- /dev/null +++ b/lib/docs/filters/koa/entries.rb @@ -0,0 +1,36 @@ +module Docs + class Koa + class EntriesFilter < Docs::EntriesFilter + @root_type = 'Koa' + def get_name + at_css('h1').content + end + + def additional_entries + return [] unless slug.match?(/^api/) + type = get_name + css('h2, h3').to_a + .delete_if do |node| + node.content == 'API' || + (slug.include?('index') && !node.content.include?('.')) + end + .map do |node| + name = node.content.strip.sub(/\(.*\)\z/, '()') + type = 'API' if type == @root_type && name.include?('.') + [name, node['id'], type] + end + end + + def get_type + case slug + when /^api\/index/ + 'API' + when /^api/ + get_name + else + 'Guides' + end + end + end + end +end diff --git a/lib/docs/filters/leaflet/clean_html.rb b/lib/docs/filters/leaflet/clean_html.rb new file mode 100644 index 00000000..802463de --- /dev/null +++ b/lib/docs/filters/leaflet/clean_html.rb @@ -0,0 +1,40 @@ +module Docs + class Leaflet + class CleanHtmlFilter < Filter + def call + css('#toc', '.expander', '.footer').remove + + css('h1').each do |node| + node.name = 'h2' + end + + at_css('> h2:first-child').name = 'h1' + + # remove "This reference reflects Leaflet 1.2.0." + css('h1 ~ p').each do |node| + node.remove + break + end + + css('section', 'code b', '.accordion', '.accordion-overflow', '.accordion-content').each do |node| + node.before(node.children).remove + end + + css('pre > code').each do |node| + node['class'] ||= '' + lang = if node['class'].include?('lang-html') || node.content =~ /\A + 'html' + elsif node['class'].include?('lang-css') + 'css' + elsif node['class'].include?('lang-js') || node['class'].include?('lang-javascript') + 'javascript' + end + node.parent['data-language'] = lang if lang + node.before(node.children).remove + end + + doc + end + end + end +end diff --git a/lib/docs/filters/leaflet/entries.rb b/lib/docs/filters/leaflet/entries.rb new file mode 100644 index 00000000..c246d5ad --- /dev/null +++ b/lib/docs/filters/leaflet/entries.rb @@ -0,0 +1,33 @@ +module Docs + class Leaflet + class EntriesFilter < Docs::EntriesFilter + def additional_entries + entries = [] + type = nil + subtype = nil + + css('*').each do |node| + if node.name == 'h2' && node['id'] + type = node.content + subtype = nil + entries << [type, node['id'], type] + elsif node.name == 'h3' + subtype = node.content + elsif node.name == 'tr' && node['id'] + value = node.css('td > code > b').first.content + if subtype && subtype.end_with?(' options') + name = "#{subtype}: #{value}" + elsif subtype + name = "#{type} #{subtype.downcase}: #{value}" + else + name = "#{type}: #{value}" + end + entries << [name, node['id'], type] + end + end + + entries + end + end + end +end diff --git a/lib/docs/filters/mdn/clean_html.rb b/lib/docs/filters/mdn/clean_html.rb index ee151462..540be3e1 100644 --- a/lib/docs/filters/mdn/clean_html.rb +++ b/lib/docs/filters/mdn/clean_html.rb @@ -14,6 +14,8 @@ module Docs '#Quick_Links', 'hr'] + BROWSER_UNNECESSARY_CLASS_REGEX = /\s*bc-browser[\w_-]+/ + def call css(*REMOVE_NODES).remove @@ -61,6 +63,94 @@ module Docs node.previous_element << node end + # New compatibility tables + + css('.bc-data #Legend + dl', '.bc-data #Legend', '.bc-data #Legend_2 + dl', '.bc-data #Legend_2', '.bc-browser-name').remove + + css('abbr.only-icon[title="Full support"]', + 'abbr.only-icon[title="Partial support"]', + 'abbr.only-icon[title="No support"]', + 'abbr.only-icon[title="See implementation notes"]').remove + + css('.bc-data .ic-altname', '.bc-data .ic-deprecated', '.bc-data .ic-non-standard', '.bc-data .ic-experimental').each do |node| + node.parent.remove + end + + css('abbr.only-icon').each do |node| + node.replace(node.content) + end + + css('.bc-table .bc-platforms td', '.bc-table .bc-browsers td').each do |node| + node.name = 'th' + end + + css('.bc-data').each do |node| + link = node.at_css('.bc-github-link') + prev = node.previous_element + prev = prev.previous_element until prev.name == 'h2' + prev.add_child(link) + + node.before(node.children).remove + end + + css('.bc-table').each do |node| + desktop_table = node + + mobile_table = node.dup + desktop_table.after(mobile_table) + + if desktop_table.at_css('.bc-platform-server') + server_table = node.dup + mobile_table.after(server_table) + end + + desktop_columns = desktop_table.at_css('th.bc-platform-desktop')['colspan'].to_i + mobile_columns = desktop_table.at_css('th.bc-platform-mobile')['colspan'].to_i + + desktop_table.css('.bc-platform-mobile').remove + desktop_table.css('.bc-platform-server').remove + desktop_table.css('.bc-browsers th').to_a[(desktop_columns + 1)..-1].each(&:remove) + desktop_table.css('tr:not(.bc-platforms):not(.bc-browsers)').each do |line| + line.css('td').to_a[(desktop_columns)..-1].each(&:remove) + end + + mobile_table.css('.bc-platform-desktop').remove + mobile_table.css('.bc-platform-server').remove + mobile_table.css('.bc-browsers th').to_a[1..(desktop_columns)].each(&:remove) + mobile_table.css('.bc-browsers th').to_a[(mobile_columns + 1)..-1].each(&:remove) + mobile_table.css('tr:not(.bc-platforms):not(.bc-browsers)').each do |line| + line.css('td').to_a[0..(desktop_columns - 1)].each(&:remove) + line.css('td').to_a[(mobile_columns)..-1].each(&:remove) + end + + if server_table + server_table.css('.bc-platform-desktop').remove + server_table.css('.bc-platform-mobile').remove + server_table.css('.bc-browsers th').to_a[1..(desktop_columns + mobile_columns)].each(&:remove) + server_table.css('tr:not(.bc-platforms):not(.bc-browsers)').each do |line| + line.css('td').to_a[0..(desktop_columns + mobile_columns - 1)].each(&:remove) + end + end + end + + # Reduce page size to make the offline bundle smaller. + css('.bc-supports-unknown').remove_attr('class') + css('td[class*="bc-platform"], th[class*="bc-platform"]').remove_attr('class') + css('td[class*="bc-browser"], th[class*="bc-browser"]').each do |node| + class_name = node['class'] + class_name.remove!(BROWSER_UNNECESSARY_CLASS_REGEX) + + if class_name.present? + node['class'] = class_name + else + node.remove_attribute('class') + end + end + + css('abbr[title*="Compatibility unknown"]').each do |node| + node.before(node.children).remove + end + doc end end diff --git a/lib/docs/filters/node/clean_html.rb b/lib/docs/filters/node/clean_html.rb index cd118927..37c9ebb4 100644 --- a/lib/docs/filters/node/clean_html.rb +++ b/lib/docs/filters/node/clean_html.rb @@ -16,7 +16,7 @@ module Docs css('pre').each do |node| if lang = node.at_css('code')['class'] - node['data-language'] = lang.remove('lang-') + node['data-language'] = lang.remove(%r{lang(uage)?-}) end node.content = node.content diff --git a/lib/docs/filters/node/entries.rb b/lib/docs/filters/node/entries.rb index eee70266..361cfbeb 100644 --- a/lib/docs/filters/node/entries.rb +++ b/lib/docs/filters/node/entries.rb @@ -26,6 +26,7 @@ module Docs def get_type type = at_css('h1').content.strip + type.remove! %r{\[.*\]} REPLACE_TYPES[type] || "#{type.first.upcase}#{type[1..-1]}" end @@ -40,6 +41,7 @@ module Docs klass = nil if node.name == 'h2' name = node.content.strip + name.remove! %r{\s*\[src\]} # Skip constructors if name.start_with? 'new ' diff --git a/lib/docs/filters/puppeteer/clean_html.rb b/lib/docs/filters/puppeteer/clean_html.rb new file mode 100644 index 00000000..d9f6460f --- /dev/null +++ b/lib/docs/filters/puppeteer/clean_html.rb @@ -0,0 +1,24 @@ +module Docs + class Puppeteer + class CleanHtmlFilter < Filter + def call + at_css('h1').content = 'Puppeteer Documentation' + + # None of the elements to remove have classes, so the order of the remove calls is trivial + + # Remove links to previous versions of the reference + at_css('h1 + ul').remove + + # Remove table of contents + at_css('h1 + h5').remove + at_css('h1 + ul').remove + + # Make headers bigger by transforming them into a bigger variant + css('h3').each { |node| node.name = 'h2' } + css('h4').each { |node| node.name = 'h3' } + + doc + end + end + end +end diff --git a/lib/docs/filters/puppeteer/entries.rb b/lib/docs/filters/puppeteer/entries.rb new file mode 100644 index 00000000..3b1e1ba6 --- /dev/null +++ b/lib/docs/filters/puppeteer/entries.rb @@ -0,0 +1,41 @@ +module Docs + class Puppeteer + class EntriesFilter < Docs::EntriesFilter + # The entire reference is one big page, so get_name and get_type are not necessary + + def additional_entries + entries = [] + + css('h3').each do |node| + name = node.content.split(': ').last + + # Find all sub-items (all h4's between the current h3 and the next) + current = node.next + while !current.nil? && current.name != 'h3' + if current.name == 'h4' + current_name = current.content + + # Prepend events with the class name + if current_name.start_with?('event: ') + current_name = "#{name} event: #{current_name[/'(.*)'/, 1]}" + end + + # Remove arguments from functions + if current_name.include?('(') + current_name = current_name.split('(')[0] + '()' + end + + entries << [current_name, current['id'], name] + end + + current = current.next + end + + entries << [name, node['id'], name] + end + + entries + end + end + end +end diff --git a/lib/docs/filters/pygame/clean_html.rb b/lib/docs/filters/pygame/clean_html.rb new file mode 100644 index 00000000..8ef7d2d6 --- /dev/null +++ b/lib/docs/filters/pygame/clean_html.rb @@ -0,0 +1,102 @@ +module Docs + class Pygame + class CleanHtmlFilter < Filter + def call + @doc = at_css '.body' + + if root_page? + # remove unneeded stuff + at_css('.modindex-jumpbox').remove + css('[role="navigation"],.pcap, .cap, .footer').remove + # table -> list + list = at_css('table') + list.replace(list.children) + list.name = 'ul' + css('tr').each do |row| + row.name = 'li' + row.remove_attribute('class') + end + at_css('h1').content = 'Pygame' + return doc + end + + # remove unwanted stuff + # .headerlink => ¶ after links + # .toc => table of content + # .tooltip-content => tooltips after links to functions + css('table.toc.docutils, .headerlink, .tooltip-content').remove + + # Remove wrapper .section + section = at_css('.section') + definition = at_css('.definition') + definition['id'] = section['id'] + section.replace(section.children) + + # Format code for it be highlighted + css('.highlight-default.notranslate').each do |node| + pre = node.at_css('pre') + node.replace(pre) + # gets rid of the already existing syntax highlighting + pre.content = pre.content + pre['class'] = 'language-python' + pre['data-language'] = "python" + end + + # change descriptions of functions/attributes to blockquote + css('.line-block').each do |node| + node.name = 'blockquote' + end + + # change functions + css('.definition').each do |d| + + # the header is the function/attribute name. It might look something like + # this: + # pygame.image.load() + # It'll end up being something like this: + # pygame.image.load(filename) -> Surface + # pygame.image.load(fileobj, namehint="") -> Surface + + header = d.at_css('dt.title') + if d['class'].include?('class') or d['class'].include?('module') + header.name = 'h1' + @section = header.content.strip + else + header.name = 'h3' + end + # save the original header + initial_header = header.content.strip + # save the real name for the entries + header['data-name'] = initial_header + # empty the header + if header.name == 'h3' + header.inner_html = '' + end + # to replace it with the signatures + next_el = header.next_element + signatures = next_el.css('.signature') + signatures.each do |sig| + sig.name = 'code' + if header.name == 'h3' + sig.parent = header + # the signature don't contain pygame.module. I think it's better + # to display them, as it avoids confusion with methods (have a + # look at the pygame.Rect page) + if initial_header.start_with?(@section) + sig.content = @section + '.' + sig.text + end + # seperate the signatures on different lines. + header.add_child " tag (virtual/static/… attributes)
+ code = header.children.first
+ code.remove if code.name == 'code'
+
+ # Remove leading ‘const’
+ header.children.first.remove if header.content.strip.start_with?('const ')
+
+ # Remove return type
+ returnType = header.children.first
+ returnType.remove if returnType['class'] == 'type'
+
+ title = header.content.strip
+
+ # Remove leading '&'/'*'
+ title[0] = '' if title[0] == '&' || title[0] == '*'
+
+ # Ignore operator overloads
+ next if title.start_with?('operator')
+
+ # Remove function parameters
+ title.sub! %r{\(.*\)}, '()'
+
+ # Remove template generics
+ title.remove!(%r{^<.*> })
+
+ # Remove ‘const’ at the end
+ title.remove!(%r{ const$})
+
+ # Enum/typedef formatting
+ title.sub! %r{(enum|typedef) (.*)}, '\2 (\1)'
+
+ # Remove property type
+ title = "#{displayedClassName}::#{title}" if title.sub!(%r{ : .*$}, '')
+
+ # Replace the class name by the alternative class name if available
+ title = title.sub(className, displayedClassName) if alternativeClassName
+
+ unless titles.include?(title) # Remove duplicates (function overloading)
+ entries << [title, header['id']]
+ titles.push title
+ end
+ end
+
+ # QML properties/functions
+ qmlTypeName = at_css('h1.title').content.remove(' QML Type', '')
+ css('.qmlproto').each do |node|
+ title = node.content.strip
+ id = node.at_css('tr')['id']
+
+ # Remove options
+ title.remove!(%r{^\[.*\] })
+
+ # Remove function parameters
+ title.sub! %r{\(.*\)}, '()'
+
+ # Remove property type
+ title.remove!(%r{ : .*$})
+
+ # Remove return type
+ title.remove!(%r{.* })
+
+ # Remove return type
+ title.remove!(%r{.* })
+
+ title = "#{qmlTypeName}.#{title.strip}"
+ unless titles.include?(title) # Remove duplicates (function overloading)
+ entries << [title, id]
+ titles.push(title)
+ end
+ end
+
+ entries
+ end
+ end
+ end
+end
diff --git a/lib/docs/filters/rdoc/clean_html.rb b/lib/docs/filters/rdoc/clean_html.rb
index 7c06f324..ac836d19 100644
--- a/lib/docs/filters/rdoc/clean_html.rb
+++ b/lib/docs/filters/rdoc/clean_html.rb
@@ -37,8 +37,10 @@ module Docs
end
# Add class to differentiate Ruby code from C code
- css('.method-source-code > pre').each do |node|
- node['class'] = node.at_css('.ruby-keyword') ? 'ruby' : 'c'
+ css('.method-source-code').each do |node|
+ node.parent.prepend_child(node)
+ pre = node.at_css('pre')
+ pre['class'] = pre.at_css('.ruby-keyword') ? 'ruby' : 'c'
end
# Remove code highlighting
diff --git a/lib/docs/filters/react/entries.rb b/lib/docs/filters/react/entries.rb
index 84702167..975f171b 100644
--- a/lib/docs/filters/react/entries.rb
+++ b/lib/docs/filters/react/entries.rb
@@ -6,9 +6,11 @@ module Docs
end
def get_type
- link = at_css("nav a[href='#{result[:path].split('/').last}']")
+ link = css("nav a[href='#{result[:path].split('/').last}']").last
return 'Miscellaneous' unless link
- link.ancestors('ul').last.previous_element.content
+ type = link.ancestors('ul').last.previous_element.content
+ type.remove! %r{\s*\(.*\)}
+ type
end
def additional_entries
@@ -25,6 +27,8 @@ module Docs
'Reference: Component'
elsif slug == 'react-api'
'Reference: React'
+ elsif slug == 'hooks-reference'
+ 'Hooks'
else
'Reference'
end
diff --git a/lib/docs/filters/react_native/entries.rb b/lib/docs/filters/react_native/entries.rb
index 54583368..71a55ece 100644
--- a/lib/docs/filters/react_native/entries.rb
+++ b/lib/docs/filters/react_native/entries.rb
@@ -12,7 +12,7 @@ module Docs
end
def get_type
- link = at_css('.navItemActive')
+ link = at_css('.navListItemActive')
return 'Miscellaneous' unless link
section = link.ancestors('.navGroup').first
type = section.at_css('h3').content.strip
diff --git a/lib/docs/filters/redis/entries.rb b/lib/docs/filters/redis/entries.rb
index a35b7c48..c0dc2fa4 100644
--- a/lib/docs/filters/redis/entries.rb
+++ b/lib/docs/filters/redis/entries.rb
@@ -12,7 +12,7 @@ module Docs
when 'HDEL' then 'Hashes'
when 'BLPOP' then 'Lists'
when 'SADD' then 'Sets'
- when 'ZADD' then 'Sorted Sets'
+ when 'BZPOPMAX' then 'Sorted Sets'
when 'PSUBSCRIBE' then 'Pub/Sub'
when 'DISCARD' then 'Transactions'
when 'EVAL' then 'Scripting'
@@ -21,6 +21,7 @@ module Docs
when 'PFADD' then 'HyperLogLog'
when 'CLUSTER ADDSLOTS' then 'Cluster'
when 'GEOADD' then 'Geo'
+ when 'XACK' then 'Stream'
else 'Miscellaneous'
end
end
diff --git a/lib/docs/filters/rust/clean_html.rb b/lib/docs/filters/rust/clean_html.rb
index 1550c89c..db07a9ed 100644
--- a/lib/docs/filters/rust/clean_html.rb
+++ b/lib/docs/filters/rust/clean_html.rb
@@ -1,11 +1,11 @@
+# frozen_string_literal: true
+
module Docs
class Rust
class CleanHtmlFilter < Filter
def call
- puts subpath if at_css('#versioninfo')
-
if slug.start_with?('book') || slug.start_with?('reference')
- @doc = at_css('#content')
+ @doc = at_css('#content main')
elsif slug == 'error-index'
css('.error-undescribed').remove
@@ -29,12 +29,16 @@ module Docs
css('.rusttest', '.test-arrow', 'hr').remove
+ css('.docblock.attributes').each do |node|
+ node.remove if node.content.include?('#[must_use]')
+ end
+
css('a.header').each do |node|
- node.first_element_child['id'] = node['name']
+ node.first_element_child['id'] = node['name'] || node['id']
node.before(node.children).remove
end
- css('.docblock > h1').each { |node| node.name = 'h4' }
+ css('.docblock > h1:not(.section-header)').each { |node| node.name = 'h4' }
css('h2.section-header').each { |node| node.name = 'h3' }
css('h1.section-header').each { |node| node.name = 'h2' }
@@ -44,7 +48,7 @@ module Docs
end
end
- css('> .impl-items', '> .docblock', 'pre > pre').each do |node|
+ css('> .impl-items', '> .docblock', 'pre > pre', '.tooltiptext', '.tooltip').each do |node|
node.before(node.children).remove
end
@@ -62,6 +66,35 @@ module Docs
node['data-language'] = 'rust' if node['class'] && node['class'].include?('rust')
end
+ doc.first_element_child.name = 'h1' if doc.first_element_child.name = 'h2'
+ at_css('h1').content = 'Rust Documentation' if root_page?
+
+ css('.table-display').each do |node|
+ node.css('td').each do |td|
+ node.before(td.children)
+ end
+ node.remove
+ end
+
+ css('.important-traits').to_a.each_with_index do |node, index|
+ content = node.at_css('.content.hidden .content')
+ node.at_css('.content.hidden').replace(content) if content
+ node.parent.after(node) if node.parent.name.in?(%(h2 h3 h4))
+ end
+
+ css('code.content').each do |node|
+ node.name = 'pre'
+ node.css('.fmt-newline').each do |line|
+ line.inner_html = line.inner_html + "\n"
+ end
+ node.inner_html = node.inner_html.gsub('
', "\n")
+ node.content = node.content
+ end
+
+ css('.since + .srclink').each do |node|
+ node.previous_element.before(node)
+ end
+
doc
end
end
diff --git a/lib/docs/filters/rust/entries.rb b/lib/docs/filters/rust/entries.rb
index e0b3ecad..524342fc 100644
--- a/lib/docs/filters/rust/entries.rb
+++ b/lib/docs/filters/rust/entries.rb
@@ -42,11 +42,13 @@ module Docs
entries << [node.content, node['id']] unless node.content.include?('Note:')
end
else
- css('#methods + * + div > .method', '#required-methods + div > .method', '#provided-methods + div > .method').map do |node|
- name = node.at_css('.fnname').content
- name.prepend "#{self.name}::"
- [name, node['id']]
- end
+ css('.method')
+ .each_with_object({}) { |node, entries|
+ name = node.at_css('.fnname').try(:content)
+ next unless name
+ name.prepend "#{self.name}::"
+ entries[name] ||= [name, node['id']]
+ }.values
end
end
end
diff --git a/lib/docs/filters/sqlite/entries.rb b/lib/docs/filters/sqlite/entries.rb
index 8ba7a42a..a7c4d440 100644
--- a/lib/docs/filters/sqlite/entries.rb
+++ b/lib/docs/filters/sqlite/entries.rb
@@ -34,7 +34,8 @@ module Docs
'rtree' => 'R*Tree Module',
'rbu' => 'RBU Extension',
'limits' => 'Limits',
- 'howtocorrupt' => 'How To Corrupt'
+ 'howtocorrupt' => 'How To Corrupt',
+ 'geopoly' => 'Geopoly'
}
def get_type
diff --git a/lib/docs/filters/svg/entries.rb b/lib/docs/filters/svg/entries.rb
index aebdeb76..b1fbfe9c 100644
--- a/lib/docs/filters/svg/entries.rb
+++ b/lib/docs/filters/svg/entries.rb
@@ -3,8 +3,8 @@ module Docs
class EntriesFilter < Docs::EntriesFilter
def get_name
name = super
- name.gsub!('Element.', '').try(:downcase!)
- name.gsub!('Attribute.', '').try(:downcase!)
+ name.gsub!('Element.', '')
+ name.gsub!('Attribute.', '')
name.gsub!('Tutorial.', '')
name.gsub!('_', '')
diff --git a/lib/docs/filters/terraform/clean_html.rb b/lib/docs/filters/terraform/clean_html.rb
new file mode 100644
index 00000000..7d662293
--- /dev/null
+++ b/lib/docs/filters/terraform/clean_html.rb
@@ -0,0 +1,33 @@
+module Docs
+ class Terraform
+ class CleanHtmlFilter < Filter
+ def call
+ @doc = at_css('#inner')
+
+ css('hr', 'a.anchor').remove
+
+ css('.alert').each do |node|
+ node.name = 'blockquote'
+ end
+
+ css('pre').each do |node|
+ if language = node['class'][/(json|shell|ruby)/, 1]
+ node['data-language'] = language
+ end
+ # HCL isn't currently supported by Prism, Ruby syntax does an acceptable job for now
+ if language = node['class'][/(hcl)/, 1]
+ node['data-language'] = 'ruby'
+ end
+ node.content = node.content
+ node.remove_attribute('class')
+ end
+
+ css('.highlight').each do |node|
+ node.before(node.children).remove
+ end
+
+ doc
+ end
+ end
+ end
+end
diff --git a/lib/docs/filters/terraform/entries.rb b/lib/docs/filters/terraform/entries.rb
new file mode 100644
index 00000000..486edac9
--- /dev/null
+++ b/lib/docs/filters/terraform/entries.rb
@@ -0,0 +1,76 @@
+module Docs
+ class Terraform
+ class EntriesFilter < Docs::EntriesFilter
+
+ # Some providers have non-trivial mappings between the directory they live in and their name
+ # Anything *not* in this list will be capitalized instead.
+ PROVIDER_NAME_MAP = {
+ 'aws' => 'AWS',
+ 'azure' => 'Azure (Legacy)',
+ 'azurerm' => 'Azure',
+ 'centurylinkcloud' => 'CenturyLinkCloud',
+ 'cloudscale' => 'CloudScale.ch',
+ 'cloudstack' => 'CloudStack',
+ 'dme' => 'DNSMadeEasy',
+ 'dns' => 'DNS',
+ 'dnsimple' => 'DNSimple',
+ 'do' => 'DigitalOcean',
+ 'github' => 'GitHub',
+ 'google' => 'Google Cloud',
+ 'http' => 'HTTP',
+ 'mysql' => 'MySQL',
+ 'newrelic' => 'New Relic',
+ 'oneandone' => '1&1',
+ 'opentelekomcloud' => 'OpenTelekomCloud',
+ 'opsgenie' => 'OpsGenie',
+ 'opc' => 'Oracle Public Cloud',
+ 'oraclepaas' => 'Oracle Cloud Platform',
+ 'ovh' => 'OVH',
+ 'pagerduty' => 'PagerDuty',
+ 'panos' => 'Palo Alto Networks',
+ 'postgresql' => 'PostgreSQL',
+ 'powerdns' => 'PowerDNS',
+ 'profitbricks' => 'ProfitBricks',
+ 'rabbitmq' => 'RabbitMQ',
+ 'softlayer' => 'SoftLayer',
+ 'statuscake' => 'StatusCake',
+ 'tls' => 'TLS',
+ 'ultradns' => 'UltraDNS',
+ 'vcd' => 'VMware vCloud Director',
+ 'nsxt' => 'VMware NSX-T',
+ 'vsphere' => 'VMware vSphere',
+ }
+
+ # Some providers have a lot (> 100) entries, which makes browsing them unwieldy.
+ # Any present in the list below will have an extra set of types added, breaking the pages out into the different
+ # products they offer.
+ LARGE_PROVIDERS = {
+ "aws" => true,
+ "azurerm" => true,
+ "google" => true,
+ }
+
+
+ def get_name
+ name ||= at_css('#inner h1').content
+ name.remove! "» "
+ name.remove! "Data Source: "
+ name
+ end
+
+ def get_type
+ category, subcategory, subfolder, page = *slug.split('/')
+ provider = page ? subcategory : category
+ nice_provider = PROVIDER_NAME_MAP[provider] || provider.capitalize
+
+ if LARGE_PROVIDERS[provider]
+ category_node = at_css('ul > li > ul > li.active')
+ parent_node = category_node.parent.previous_element if category_node
+ nice_provider = nice_provider + ": #{parent_node.content}" if category_node
+ end
+
+ nice_provider
+ end
+ end
+ end
+end
diff --git a/lib/docs/filters/typescript/entries.rb b/lib/docs/filters/typescript/entries.rb
index ab10340a..19bcbe3f 100644
--- a/lib/docs/filters/typescript/entries.rb
+++ b/lib/docs/filters/typescript/entries.rb
@@ -9,6 +9,7 @@ module Docs
def get_type
return 'Declaration Files' if subpath.include?('declaration-files')
+ return 'Project Configuration' if slug == 'handbook/configuring-watch'
type = at_css('#main-nav a.active').ancestors('.panel').first.at_css('> a').content
type = name if type == 'Handbook'
type
diff --git a/lib/docs/scrapers/ansible.rb b/lib/docs/scrapers/ansible.rb
index 2ac3ee6f..2d62909a 100644
--- a/lib/docs/scrapers/ansible.rb
+++ b/lib/docs/scrapers/ansible.rb
@@ -15,6 +15,46 @@ module Docs
Licensed under the GNU General Public License version 3.
HTML
+ version '2.7' do
+ self.release = '2.7.1'
+ self.base_url = 'https://docs.ansible.com/ansible/2.7/'
+
+ options[:skip] = %w(
+ installation_guide/index.html
+ reference_appendices/glossary.html
+ reference_appendices/faq.html
+ reference_appendices/tower.html
+ user_guide/quickstart.html
+ modules/modules_by_category.html
+ modules/list_of_all_modules.html)
+
+ options[:skip_patterns] = [
+ /\Acommunity.*/i,
+ /\Adev_guide.*/i,
+ /\Aroadmap.*/i,
+ ]
+ end
+
+ version '2.6' do
+ self.release = '2.6.7'
+ self.base_url = 'https://docs.ansible.com/ansible/2.6/'
+
+ options[:skip] = %w(
+ installation_guide/index.html
+ reference_appendices/glossary.html
+ reference_appendices/faq.html
+ reference_appendices/tower.html
+ user_guide/quickstart.html
+ modules/modules_by_category.html
+ modules/list_of_all_modules.html)
+
+ options[:skip_patterns] = [
+ /\Acommunity.*/i,
+ /\Adev_guide.*/i,
+ /\Aroadmap.*/i,
+ ]
+ end
+
version '2.5' do
self.release = '2.5.3'
self.base_url = 'https://docs.ansible.com/ansible/2.5/'
diff --git a/lib/docs/scrapers/apache.rb b/lib/docs/scrapers/apache.rb
index 596e6703..9ee82f12 100644
--- a/lib/docs/scrapers/apache.rb
+++ b/lib/docs/scrapers/apache.rb
@@ -3,7 +3,7 @@ module Docs
self.name = 'Apache HTTP Server'
self.slug = 'apache_http_server'
self.type = 'apache'
- self.release = '2.4.33'
+ self.release = '2.4.37'
self.base_url = 'https://httpd.apache.org/docs/2.4/en/'
self.links = {
home: 'https://httpd.apache.org/'
diff --git a/lib/docs/scrapers/apache_pig.rb b/lib/docs/scrapers/apache_pig.rb
index 32bfa2d1..65897a78 100644
--- a/lib/docs/scrapers/apache_pig.rb
+++ b/lib/docs/scrapers/apache_pig.rb
@@ -2,7 +2,7 @@ module Docs
class ApachePig < UrlScraper
self.name = 'Apache Pig'
self.slug = 'apache_pig'
- self.type = 'apache_pig'
+ self.type = 'simple'
self.links = {
home: 'https://pig.apache.org/'
}
diff --git a/lib/docs/scrapers/async.rb b/lib/docs/scrapers/async.rb
index 2969bd01..40022f19 100644
--- a/lib/docs/scrapers/async.rb
+++ b/lib/docs/scrapers/async.rb
@@ -1,7 +1,7 @@
module Docs
class Async < UrlScraper
self.type = 'async'
- self.release = '2.6.0'
+ self.release = '2.6.1'
self.base_url = 'https://caolan.github.io/async/'
self.root_path = 'docs.html'
self.links = {
@@ -14,7 +14,7 @@ module Docs
options[:skip_links] = true
options[:attribution] = <<-HTML
- © 2010–2017 Caolan McMahon
+ © 2010–2018 Caolan McMahon
Licensed under the MIT License.
HTML
end
diff --git a/lib/docs/scrapers/bash.rb b/lib/docs/scrapers/bash.rb
new file mode 100644
index 00000000..feb0ddce
--- /dev/null
+++ b/lib/docs/scrapers/bash.rb
@@ -0,0 +1,21 @@
+module Docs
+ class Bash < UrlScraper
+ self.type = 'bash'
+ self.release = '4.4'
+ self.base_url = 'https://www.gnu.org/software/bash/manual'
+ self.root_path = '/html_node/index.html'
+ self.links = {
+ home: 'https://www.gnu.org/software/bash/',
+ code: 'http://git.savannah.gnu.org/cgit/bash.git'
+ }
+
+ html_filters.push 'bash/entries', 'bash/clean_html'
+
+ options[:only_patterns] = [/\/html_node\//]
+
+ options[:attribution] = <<-HTML
+ Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+ Licensed under the GNU Free Documentation License.
+ HTML
+ end
+end
diff --git a/lib/docs/scrapers/bootstrap.rb b/lib/docs/scrapers/bootstrap.rb
index 5b29b992..7b2406b8 100644
--- a/lib/docs/scrapers/bootstrap.rb
+++ b/lib/docs/scrapers/bootstrap.rb
@@ -16,7 +16,7 @@ module Docs
HTML
version '4' do
- self.release = '4.1.1'
+ self.release = '4.1.3'
self.base_url = 'https://getbootstrap.com/docs/4.1/'
self.root_path = 'getting-started/introduction/'
diff --git a/lib/docs/scrapers/bower.rb b/lib/docs/scrapers/bower.rb
index a86f5449..b032f1d3 100644
--- a/lib/docs/scrapers/bower.rb
+++ b/lib/docs/scrapers/bower.rb
@@ -1,7 +1,7 @@
module Docs
class Bower < UrlScraper
self.name = 'Bower'
- self.type = 'bower'
+ self.type = 'simple'
self.release = '1.8.4'
self.base_url = 'https://bower.io/docs/'
self.root_path = 'api'
diff --git a/lib/docs/scrapers/c.rb b/lib/docs/scrapers/c.rb
index e90b3679..f9289617 100644
--- a/lib/docs/scrapers/c.rb
+++ b/lib/docs/scrapers/c.rb
@@ -1,7 +1,6 @@
module Docs
class C < FileScraper
self.type = 'c'
- self.dir = '/Users/Thibaut/DevDocs/Docs/c'
self.base_url = 'http://en.cppreference.com/w/c/'
self.root_path = 'header.html'
diff --git a/lib/docs/scrapers/chai.rb b/lib/docs/scrapers/chai.rb
index e299771f..9d8aa4d2 100644
--- a/lib/docs/scrapers/chai.rb
+++ b/lib/docs/scrapers/chai.rb
@@ -1,7 +1,7 @@
module Docs
class Chai < UrlScraper
self.name = 'Chai'
- self.type = 'chai'
+ self.type = 'simple'
self.release = '4.1.0'
self.base_url = 'http://chaijs.com'
self.root_path = '/api/'
diff --git a/lib/docs/scrapers/cmake.rb b/lib/docs/scrapers/cmake.rb
index 1cb00dd1..c455e4fd 100644
--- a/lib/docs/scrapers/cmake.rb
+++ b/lib/docs/scrapers/cmake.rb
@@ -16,12 +16,22 @@ module Docs
options[:skip_patterns] = [/\Agenerator/, /\Ainclude/, /\Arelease/]
options[:attribution] = <<-HTML
- © 2000–2017 Kitware, Inc. and Contributors
+ © 2000–2018 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
HTML
+ version '3.12' do
+ self.release = '3.12.1'
+ self.base_url = 'https://cmake.org/cmake/help/v3.12/'
+ end
+
+ version '3.11' do
+ self.release = '3.11.4'
+ self.base_url = 'https://cmake.org/cmake/help/v3.11/'
+ end
+
version '3.10' do
- self.release = '3.10.1'
+ self.release = '3.10.3'
self.base_url = 'https://cmake.org/cmake/help/v3.10/'
end
diff --git a/lib/docs/scrapers/codeception.rb b/lib/docs/scrapers/codeception.rb
index c1f12238..919f146d 100644
--- a/lib/docs/scrapers/codeception.rb
+++ b/lib/docs/scrapers/codeception.rb
@@ -2,7 +2,7 @@ module Docs
class Codeception < UrlScraper
self.name = 'Codeception'
self.type = 'codeception'
- self.release = '2.4.0'
+ self.release = '2.5.1'
self.base_url = 'https://codeception.com/docs/'
self.root_path = 'index.html'
self.links = {
diff --git a/lib/docs/scrapers/codeceptjs.rb b/lib/docs/scrapers/codeceptjs.rb
index c30a4a59..13189340 100644
--- a/lib/docs/scrapers/codeceptjs.rb
+++ b/lib/docs/scrapers/codeceptjs.rb
@@ -1,9 +1,9 @@
module Docs
class Codeceptjs < UrlScraper
self.name = 'CodeceptJS'
- self.type = 'codeceptjs'
+ self.type = 'simple'
self.root_path = 'index.html'
- self.release = '1.2.1'
+ self.release = '1.4.4'
self.base_url = 'https://codecept.io/'
self.links = {
home: 'https://codecept.io/',
diff --git a/lib/docs/scrapers/cordova.rb b/lib/docs/scrapers/cordova.rb
index a8ff86e9..f74c72ff 100644
--- a/lib/docs/scrapers/cordova.rb
+++ b/lib/docs/scrapers/cordova.rb
@@ -24,10 +24,15 @@ module Docs
end
options[:attribution] = <<-HTML
- © 2012–2017 The Apache Software Foundation
+ © 2012–2018 The Apache Software Foundation
Licensed under the Apache License 2.0.
HTML
+ version '8' do
+ self.release = '8.1.2'
+ self.base_url = 'https://cordova.apache.org/docs/en/8.x/'
+ end
+
version '7' do
self.release = '7.1.0'
self.base_url = 'https://cordova.apache.org/docs/en/7.x/'
diff --git a/lib/docs/scrapers/cpp.rb b/lib/docs/scrapers/cpp.rb
index 819fd626..374f6883 100644
--- a/lib/docs/scrapers/cpp.rb
+++ b/lib/docs/scrapers/cpp.rb
@@ -3,7 +3,6 @@ module Docs
self.name = 'C++'
self.slug = 'cpp'
self.type = 'c'
- self.dir = '/Users/Thibaut/DevDocs/Docs/cpp'
self.base_url = 'http://en.cppreference.com/w/cpp/'
self.root_path = 'header.html'
diff --git a/lib/docs/scrapers/crystal.rb b/lib/docs/scrapers/crystal.rb
index 1e95e540..29061a1d 100644
--- a/lib/docs/scrapers/crystal.rb
+++ b/lib/docs/scrapers/crystal.rb
@@ -1,7 +1,7 @@
module Docs
class Crystal < UrlScraper
self.type = 'crystal'
- self.release = '0.24.1'
+ self.release = '0.27.0'
self.base_url = 'https://crystal-lang.org/'
self.root_path = "api/#{release}/index.html"
self.initial_paths = %w(docs/index.html)
@@ -29,7 +29,7 @@ module Docs
HTML
else
<<-HTML
- © 2012–2017 Manas Technology Solutions.
+ © 2012–2018 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
HTML
end
diff --git a/lib/docs/scrapers/d.rb b/lib/docs/scrapers/d.rb
index c6d151d7..6126380e 100644
--- a/lib/docs/scrapers/d.rb
+++ b/lib/docs/scrapers/d.rb
@@ -2,7 +2,7 @@ module Docs
class D < UrlScraper
include MultipleBaseUrls
- self.release = '2.080.0'
+ self.release = '2.083.0'
self.type = 'd'
self.base_urls = ['https://dlang.org/phobos/', 'https://dlang.org/spec/']
self.root_path = 'index.html'
diff --git a/lib/docs/scrapers/d3.rb b/lib/docs/scrapers/d3.rb
index 94448278..26b27ca5 100644
--- a/lib/docs/scrapers/d3.rb
+++ b/lib/docs/scrapers/d3.rb
@@ -17,7 +17,7 @@ module Docs
HTML
version '5' do
- self.release = '5.4.0'
+ self.release = '5.7.0'
self.base_url = 'https://github.com/d3/'
self.root_path = 'd3/blob/master/API.md'
diff --git a/lib/docs/scrapers/dart.rb b/lib/docs/scrapers/dart.rb
new file mode 100644
index 00000000..c345c22f
--- /dev/null
+++ b/lib/docs/scrapers/dart.rb
@@ -0,0 +1,35 @@
+module Docs
+ class Dart < FileScraper
+ self.type = 'dart'
+ self.root_path = 'index.html'
+ self.links = {
+ home: 'https://www.dartlang.org/',
+ code: 'https://github.com/dart-lang/sdk'
+ }
+
+ html_filters.push 'dart/entries', 'dart/clean_html'
+
+ options[:fix_urls] = ->(url) do
+ # localhost/dart-web_audio/..dart-io/dart-io-library.html > localhost/dart-io/dart-io-library.html
+ url.remove!(/[^\/]+\/\.\./)
+ url
+ end
+
+ options[:attribution] = <<-HTML
+ © 2012 the Dart project authors
+ Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
+ HTML
+
+ # Download the documentation from https://www.dartlang.org/tools/sdk/archive
+
+ version '2' do
+ self.release = '2.0.0'
+ self.base_url = "https://api.dartlang.org/stable/#{release}/"
+ end
+
+ version '1' do
+ self.release = '1.24.3'
+ self.base_url = "https://api.dartlang.org/stable/#{release}/"
+ end
+ end
+end
diff --git a/lib/docs/scrapers/django.rb b/lib/docs/scrapers/django.rb
index 37f3270a..45273540 100644
--- a/lib/docs/scrapers/django.rb
+++ b/lib/docs/scrapers/django.rb
@@ -34,33 +34,33 @@ module Docs
Licensed under the BSD License.
HTML
+ version '2.1' do
+ self.release = '2.1.0'
+ self.base_url = 'https://docs.djangoproject.com/en/2.1/'
+ end
+
version '2.0' do
- self.release = '2.0.5'
- self.dir = '/Users/Thibaut/DevDocs/Docs/Django20'
+ self.release = '2.0.7'
self.base_url = 'https://docs.djangoproject.com/en/2.0/'
end
version '1.11' do
self.release = '1.11.9'
- self.dir = '/Users/Thibaut/DevDocs/Docs/Django111'
self.base_url = 'https://docs.djangoproject.com/en/1.11/'
end
version '1.10' do
self.release = '1.10.8'
- self.dir = '/Users/Thibaut/DevDocs/Docs/Django110'
self.base_url = 'https://docs.djangoproject.com/en/1.10/'
end
version '1.9' do
self.release = '1.9.13'
- self.dir = '/Users/Thibaut/DevDocs/Docs/Django19'
self.base_url = 'https://docs.djangoproject.com/en/1.9/'
end
version '1.8' do
self.release = '1.8.18'
- self.dir = '/Users/Thibaut/DevDocs/Docs/Django18'
self.base_url = 'https://docs.djangoproject.com/en/1.8/'
end
end
diff --git a/lib/docs/scrapers/docker.rb b/lib/docs/scrapers/docker.rb
index a1a6345b..92494f8a 100644
--- a/lib/docs/scrapers/docker.rb
+++ b/lib/docs/scrapers/docker.rb
@@ -1,6 +1,6 @@
module Docs
class Docker < UrlScraper
- self.type = 'docker'
+ self.type = 'simple'
self.links = {
home: 'https://docker.com/',
code: 'https://github.com/docker/docker'
diff --git a/lib/docs/scrapers/electron.rb b/lib/docs/scrapers/electron.rb
index e9881f70..3cb399f0 100644
--- a/lib/docs/scrapers/electron.rb
+++ b/lib/docs/scrapers/electron.rb
@@ -1,8 +1,8 @@
module Docs
class Electron < UrlScraper
- self.type = 'electron'
+ self.type = 'simple'
self.base_url = 'https://electronjs.org/docs'
- self.release = '2.0.0'
+ self.release = '2.0.2'
self.links = {
home: 'https://electronjs.org/',
code: 'https://github.com/electron/electron'
diff --git a/lib/docs/scrapers/elixir.rb b/lib/docs/scrapers/elixir.rb
index 4a8e33cd..10d5aac1 100644
--- a/lib/docs/scrapers/elixir.rb
+++ b/lib/docs/scrapers/elixir.rb
@@ -33,6 +33,19 @@ module Docs
"https://elixir-lang.org/getting-started/introduction.html" ]
end
+ version '1.7' do
+ self.release = '1.7.3'
+ self.base_urls = [
+ "https://hexdocs.pm/elixir/#{release}/",
+ "https://hexdocs.pm/eex/#{release}/",
+ "https://hexdocs.pm/ex_unit/#{release}/",
+ "https://hexdocs.pm/iex/#{release}/",
+ "https://hexdocs.pm/logger/#{release}/",
+ "https://hexdocs.pm/mix/#{release}/",
+ 'https://elixir-lang.org/getting-started/'
+ ]
+ end
+
version '1.6' do
self.release = '1.6.5'
self.base_urls = [
diff --git a/lib/docs/scrapers/erlang.rb b/lib/docs/scrapers/erlang.rb
index ffa267f3..d6aa2a0b 100644
--- a/lib/docs/scrapers/erlang.rb
+++ b/lib/docs/scrapers/erlang.rb
@@ -40,19 +40,20 @@ module Docs
Licensed under the Apache License, Version 2.0.
HTML
+ version '21' do
+ self.release = '21.0'
+ end
+
version '20' do
self.release = '20.3'
- self.dir = '/Users/Thibaut/DevDocs/Docs/Erlang20'
end
version '19' do
self.release = '19.3'
- self.dir = '/Users/Thibaut/DevDocs/Docs/Erlang19'
end
version '18' do
self.release = '18.3'
- self.dir = '/Users/Thibaut/DevDocs/Docs/Erlang18'
end
end
end
diff --git a/lib/docs/scrapers/eslint.rb b/lib/docs/scrapers/eslint.rb
index f89d7c19..8b4c9a2e 100644
--- a/lib/docs/scrapers/eslint.rb
+++ b/lib/docs/scrapers/eslint.rb
@@ -2,7 +2,7 @@ module Docs
class Eslint < UrlScraper
self.name = 'ESLint'
self.type = 'simple'
- self.release = '4.19.0'
+ self.release = '5.8.0'
self.base_url = 'https://eslint.org/docs/'
self.root_path = 'user-guide/getting-started'
self.links = {
diff --git a/lib/docs/scrapers/express.rb b/lib/docs/scrapers/express.rb
index 7e2b2f29..0fb4ed14 100644
--- a/lib/docs/scrapers/express.rb
+++ b/lib/docs/scrapers/express.rb
@@ -2,7 +2,7 @@ module Docs
class Express < UrlScraper
self.name = 'Express'
self.type = 'express'
- self.release = '4.16.1'
+ self.release = '4.16.3'
self.base_url = 'http://expressjs.com/en/'
self.root_path = '4x/api.html'
self.initial_paths = %w(
diff --git a/lib/docs/scrapers/fish.rb b/lib/docs/scrapers/fish.rb
index ac098d45..5ccfa71c 100644
--- a/lib/docs/scrapers/fish.rb
+++ b/lib/docs/scrapers/fish.rb
@@ -1,7 +1,7 @@
module Docs
class Fish < UrlScraper
self.name = 'Fish'
- self.type = 'fish'
+ self.type = 'simple'
self.root_path = 'index.html'
self.links = {
home: 'https://fishshell.com/',
diff --git a/lib/docs/scrapers/flow.rb b/lib/docs/scrapers/flow.rb
index cbf95f5c..16ea70dd 100644
--- a/lib/docs/scrapers/flow.rb
+++ b/lib/docs/scrapers/flow.rb
@@ -1,7 +1,7 @@
module Docs
class Flow < UrlScraper
- self.type = 'flow'
- self.release = '0.68.0'
+ self.type = 'simple'
+ self.release = '0.85.0'
self.base_url = 'https://flow.org/en/docs/'
self.links = {
home: 'https://flow.org/',
@@ -16,7 +16,7 @@ module Docs
options[:attribution] = <<-HTML
© 2013–present Facebook Inc.
- Licensed under the BSD License.
+ Licensed under the MIT License.
HTML
end
end
diff --git a/lib/docs/scrapers/git.rb b/lib/docs/scrapers/git.rb
index a72b7eb1..26b2da95 100644
--- a/lib/docs/scrapers/git.rb
+++ b/lib/docs/scrapers/git.rb
@@ -1,7 +1,7 @@
module Docs
class Git < UrlScraper
self.type = 'git'
- self.release = '2.17.0'
+ self.release = '2.19.1'
self.base_url = 'https://git-scm.com/docs'
self.initial_paths = %w(/git.html)
self.links = {
diff --git a/lib/docs/scrapers/gnu.rb b/lib/docs/scrapers/gnu.rb
index f920e14e..d3f5e7ba 100644
--- a/lib/docs/scrapers/gnu.rb
+++ b/lib/docs/scrapers/gnu.rb
@@ -1,6 +1,6 @@
module Docs
class Gnu < FileScraper
- self.type = 'gnu'
+ self.type = 'simple'
self.root_path = 'index.html'
self.abstract = 'true'
diff --git a/lib/docs/scrapers/gnu/gcc.rb b/lib/docs/scrapers/gnu/gcc.rb
index d3a77493..be3bb54e 100644
--- a/lib/docs/scrapers/gnu/gcc.rb
+++ b/lib/docs/scrapers/gnu/gcc.rb
@@ -48,13 +48,11 @@ module Docs
version '7' do
self.release = '7.3.0'
- self.dir = '/Users/Thibaut/DevDocs/Docs/gcc7'
self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/"
end
version '7 CPP' do
self.release = '7.3.0'
- self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp7'
self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/"
options[:replace_paths] = CPP_PATHS
@@ -62,7 +60,6 @@ module Docs
version '6' do
self.release = '6.4.0'
- self.dir = '/Users/Thibaut/DevDocs/Docs/gcc6'
self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/"
options[:root_title] = 'Using the GNU Compiler Collection (GCC)'
@@ -70,7 +67,6 @@ module Docs
version '6 CPP' do
self.release = '6.4.0'
- self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp6'
self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/"
options[:replace_paths] = CPP_PATHS
@@ -78,7 +74,6 @@ module Docs
version '5' do
self.release = '5.4.0'
- self.dir = '/Users/Thibaut/DevDocs/Docs/gcc5'
self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/"
options[:root_title] = 'Using the GNU Compiler Collection (GCC)'
@@ -86,7 +81,6 @@ module Docs
version '5 CPP' do
self.release = '5.4.0'
- self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp5'
self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/"
options[:replace_paths] = CPP_PATHS
@@ -94,7 +88,6 @@ module Docs
version '4' do
self.release = '4.9.3'
- self.dir = '/Users/Thibaut/DevDocs/Docs/gcc4'
self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/"
options[:root_title] = 'Using the GNU Compiler Collection (GCC)'
@@ -102,7 +95,6 @@ module Docs
version '4 CPP' do
self.release = '4.9.3'
- self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp4'
self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/"
options[:replace_paths] = CPP_PATHS
diff --git a/lib/docs/scrapers/gnu/gnu_fortran.rb b/lib/docs/scrapers/gnu/gnu_fortran.rb
index c373a0bf..2610178e 100644
--- a/lib/docs/scrapers/gnu/gnu_fortran.rb
+++ b/lib/docs/scrapers/gnu/gnu_fortran.rb
@@ -8,25 +8,21 @@ module Docs
version '7' do
self.release = '7.3.0'
- self.dir = '/Users/Thibaut/DevDocs/Docs/gfortran7'
self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/"
end
version '6' do
self.release = '6.4.0'
- self.dir = '/Users/Thibaut/DevDocs/Docs/gfortran6'
self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/"
end
version '5' do
self.release = '5.4.0'
- self.dir = '/Users/Thibaut/DevDocs/Docs/gfortran5'
self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/"
end
version '4' do
self.release = '4.9.3'
- self.dir = '/Users/Thibaut/DevDocs/Docs/gfortran4'
self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/"
end
end
diff --git a/lib/docs/scrapers/go.rb b/lib/docs/scrapers/go.rb
index 272b94b5..7b233317 100644
--- a/lib/docs/scrapers/go.rb
+++ b/lib/docs/scrapers/go.rb
@@ -1,7 +1,7 @@
module Docs
class Go < UrlScraper
self.type = 'go'
- self.release = '1.10.1'
+ self.release = '1.11.2'
self.base_url = 'https://golang.org/pkg/'
self.links = {
home: 'https://golang.org/',
diff --git a/lib/docs/scrapers/godot.rb b/lib/docs/scrapers/godot.rb
index 19696915..7e7da9a6 100644
--- a/lib/docs/scrapers/godot.rb
+++ b/lib/docs/scrapers/godot.rb
@@ -29,7 +29,7 @@ module Docs
end
version '3.0' do
- self.release = '3.0'
+ self.release = '3.0.6'
self.base_url = "http://docs.godotengine.org/en/#{self.version}/"
end
diff --git a/lib/docs/scrapers/graphite.rb b/lib/docs/scrapers/graphite.rb
new file mode 100644
index 00000000..49ade898
--- /dev/null
+++ b/lib/docs/scrapers/graphite.rb
@@ -0,0 +1,21 @@
+module Docs
+ class Graphite < UrlScraper
+ self.type = 'graphite'
+ self.release = '1.1.4'
+ self.base_url = 'https://graphite.readthedocs.io/en/latest/'
+ self.links = {
+ code: 'https://github.com/graphite-project/graphite-web'
+ }
+
+ html_filters.push 'graphite/entries', 'graphite/clean_html'
+
+ options[:container] = '.document > div'
+ options[:skip] = %w(releases.html who-is-using.html composer.html search.html py-modindex.html genindex.html)
+
+ options[:attribution] = <<-HTML
+ © 2008–2012 Chris Davis
+ © 2011–2016 The Graphite Project
+ Licensed under the Apache License, Version 2.0.
+ HTML
+ end
+end
diff --git a/lib/docs/scrapers/grunt.rb b/lib/docs/scrapers/grunt.rb
index 764f6d8f..2201c043 100644
--- a/lib/docs/scrapers/grunt.rb
+++ b/lib/docs/scrapers/grunt.rb
@@ -1,7 +1,7 @@
module Docs
class Grunt < UrlScraper
self.name = 'Grunt'
- self.type = 'grunt'
+ self.type = 'simple'
self.release = '1.0.1'
self.base_url = 'https://gruntjs.com/'
self.root_path = 'getting-started'
diff --git a/lib/docs/scrapers/handlebars.rb b/lib/docs/scrapers/handlebars.rb
new file mode 100644
index 00000000..22935d21
--- /dev/null
+++ b/lib/docs/scrapers/handlebars.rb
@@ -0,0 +1,23 @@
+module Docs
+ class Handlebars < UrlScraper
+ self.name = 'Handlebars.js'
+ self.slug = 'handlebars'
+ self.type = 'simple'
+ self.release = '4.0.12'
+ self.base_url = 'https://handlebarsjs.com/'
+ self.links = {
+ home: 'https://handlebarsjs.com/',
+ code: 'https://github.com/wycats/handlebars.js/'
+ }
+
+ html_filters.push 'handlebars/entries', 'handlebars/clean_html', 'title'
+
+ options[:container] = '#contents'
+ options[:root_title] = 'Handlebars.js'
+
+ options[:attribution] = <<-HTML
+ © 2011–2017 by Yehuda Katz
+ Licensed under the MIT License.
+ HTML
+ end
+end
diff --git a/lib/docs/scrapers/haskell.rb b/lib/docs/scrapers/haskell.rb
index 8be5941e..442339b3 100755
--- a/lib/docs/scrapers/haskell.rb
+++ b/lib/docs/scrapers/haskell.rb
@@ -57,7 +57,7 @@ module Docs
end
version '8' do
- self.release = '8.2.1'
+ self.release = '8.6.1'
self.base_url = "https://downloads.haskell.org/~ghc/#{release}/docs/html/"
end
diff --git a/lib/docs/scrapers/haxe.rb b/lib/docs/scrapers/haxe.rb
index 70a49b0b..33f20b93 100644
--- a/lib/docs/scrapers/haxe.rb
+++ b/lib/docs/scrapers/haxe.rb
@@ -1,7 +1,7 @@
module Docs
class Haxe < UrlScraper
self.name = 'Haxe'
- self.type = 'haxe'
+ self.type = 'simple'
self.release = '3.4.7'
self.base_url = 'https://api.haxe.org/'
diff --git a/lib/docs/scrapers/homebrew.rb b/lib/docs/scrapers/homebrew.rb
index 1e1c1633..fba79ec0 100644
--- a/lib/docs/scrapers/homebrew.rb
+++ b/lib/docs/scrapers/homebrew.rb
@@ -2,7 +2,7 @@ module Docs
class Homebrew < UrlScraper
self.name = 'Homebrew'
self.type = 'simple'
- self.release = '1.4.2'
+ self.release = '1.8.1'
self.base_url = 'https://docs.brew.sh/'
self.links = {
home: 'https://brew.sh',
@@ -13,8 +13,7 @@ module Docs
options[:container] = ->(filter) { filter.root_page? ? '#home' : '#page' }
- options[:skip_patterns] = [/maintainer/i, /core\-contributor/i]
- options[:skip] = %w(Kickstarter-Supporters.html)
+ options[:skip_patterns] = [/maintainer/i, /core\-contributor/i, /kickstarter/i]
options[:attribution] = <<-HTML
© 2009–present Homebrew contributors
diff --git a/lib/docs/scrapers/immutable.rb b/lib/docs/scrapers/immutable.rb
index 3a316ea8..fa7fb81b 100644
--- a/lib/docs/scrapers/immutable.rb
+++ b/lib/docs/scrapers/immutable.rb
@@ -2,7 +2,7 @@ module Docs
class Immutable < UrlScraper
self.name = 'Immutable.js'
self.slug = 'immutable'
- self.type = 'immutable'
+ self.type = 'simple'
self.release = '3.8.1'
self.base_url = 'https://facebook.github.io/immutable-js/docs/'
self.links = {
diff --git a/lib/docs/scrapers/influxdata.rb b/lib/docs/scrapers/influxdata.rb
index ef8ca5d9..6c83b66b 100644
--- a/lib/docs/scrapers/influxdata.rb
+++ b/lib/docs/scrapers/influxdata.rb
@@ -1,7 +1,7 @@
module Docs
class Influxdata < UrlScraper
self.name = 'InfluxData'
- self.type = 'influxdata'
+ self.type = 'simple'
self.release = '1.3'
self.base_url = 'https://docs.influxdata.com/'
self.links = {
diff --git a/lib/docs/scrapers/jasmine.rb b/lib/docs/scrapers/jasmine.rb
index 3be0163a..82f3c9cf 100644
--- a/lib/docs/scrapers/jasmine.rb
+++ b/lib/docs/scrapers/jasmine.rb
@@ -1,8 +1,8 @@
module Docs
class Jasmine < UrlScraper
- self.type = 'jasmine'
- self.release = '3.1.0'
- self.base_url = 'https://jasmine.github.io/api/3.0/'
+ self.type = 'simple'
+ self.release = '3.3.0'
+ self.base_url = 'https://jasmine.github.io/api/3.2/'
self.root_path = 'index.html'
self.links = {
home: 'https://jasmine.github.io/',
diff --git a/lib/docs/scrapers/jest.rb b/lib/docs/scrapers/jest.rb
index 689b3268..f4ce944f 100644
--- a/lib/docs/scrapers/jest.rb
+++ b/lib/docs/scrapers/jest.rb
@@ -1,9 +1,9 @@
module Docs
class Jest < UrlScraper
- self.type = 'jest'
- self.release = '23.1.0'
- self.base_url = 'https://facebook.github.io/jest/docs/en/'
- self.root_path = 'getting-started.html'
+ self.type = 'simple'
+ self.release = '23.5.0'
+ self.base_url = 'https://jestjs.io/docs/en/'
+ self.root_path = 'getting-started'
self.links = {
home: 'https://facebook.github.io/jest/',
code: 'https://github.com/facebook/jest'
diff --git a/lib/docs/scrapers/julia.rb b/lib/docs/scrapers/julia.rb
index 6a411b70..5bc16b77 100644
--- a/lib/docs/scrapers/julia.rb
+++ b/lib/docs/scrapers/julia.rb
@@ -8,13 +8,33 @@ module Docs
options[:only_patterns] = [/\Amanual\//, /\Astdlib\//]
options[:attribution] = <<-HTML
- © 2009–2016 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors
+ © 2009–2018 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors
Licensed under the MIT License.
HTML
+ version '1.0' do
+ self.release = '1.0.1'
+ self.base_url = "https://docs.julialang.org/en/v#{release}/"
+ self.type = 'julia'
+
+ html_filters.push 'julia/entries', 'julia/clean_html'
+
+ options[:container] = '#docs'
+ end
+
+ version '0.7' do
+ self.release = '0.7.0'
+ self.base_url = "https://docs.julialang.org/en/v#{release}/"
+ self.type = 'julia'
+
+ html_filters.push 'julia/entries', 'julia/clean_html'
+
+ options[:container] = '#docs'
+ end
+
version '0.6' do
self.release = '0.6.2'
- self.base_url = 'https://docs.julialang.org/en/release-0.6/'
+ self.base_url = "https://docs.julialang.org/en/v#{release}/"
self.type = 'julia'
html_filters.push 'julia/entries', 'julia/clean_html'
@@ -24,7 +44,7 @@ module Docs
version '0.5' do
self.release = '0.5.2'
- self.base_url = 'https://docs.julialang.org/en/release-0.5/'
+ self.base_url = "https://docs.julialang.org/en/v#{release}/"
self.type = 'sphinx_simple'
html_filters.push 'julia/entries_sphinx', 'julia/clean_html_sphinx', 'sphinx/clean_html'
diff --git a/lib/docs/scrapers/koa.rb b/lib/docs/scrapers/koa.rb
new file mode 100644
index 00000000..3ce79cac
--- /dev/null
+++ b/lib/docs/scrapers/koa.rb
@@ -0,0 +1,38 @@
+# frozen_string_literal: true
+
+module Docs
+ class Koa < Github
+ self.base_url = 'https://github.com/koajs/koa/blob/master/docs/'
+ self.release = '2.6.1'
+
+ self.root_path = 'api/index.md'
+ self.initial_paths = %w[
+ error-handling
+ faq
+ guide
+ koa-vs-express
+ migration
+ troubleshooting
+ api/index
+ api/context
+ api/request
+ api/response
+ ].map { |name| name + '.md' }
+
+ self.links = {
+ home: 'https://koajs.com/',
+ code: 'https://github.com/koajs/koa'
+ }
+
+ html_filters.push 'koa/clean_html', 'koa/entries'
+
+ options[:skip] = %w[middleware.gif]
+ options[:trailing_slash] = false
+ options[:container] = '.markdown-body'
+
+ options[:attribution] = <<-HTML
+ © 2018 Koa contributors
+ Licensed under the MIT License.
+ HTML
+ end
+end
diff --git a/lib/docs/scrapers/laravel.rb b/lib/docs/scrapers/laravel.rb
index 5bbc299a..5c88ae0f 100644
--- a/lib/docs/scrapers/laravel.rb
+++ b/lib/docs/scrapers/laravel.rb
@@ -29,8 +29,21 @@ module Docs
Laravel is a trademark of Taylor Otwell.
HTML
+ version '5.7' do
+ self.release = '5.7.7'
+ self.root_path = '/api/5.7/index.html'
+ self.initial_paths = %w(/docs/5.7/installation /api/5.7/classes.html)
+
+ options[:only_patterns] = [%r{\A/api/5\.7/}, %r{\A/docs/5\.7/}]
+
+ options[:fix_urls] = ->(url) do
+ url.sub! %r{#{Regexp.escape(Laravel.base_url)}/docs\/(?!\d)}, "#{Laravel.base_url}/docs/5.7/"
+ url
+ end
+ end
+
version '5.6' do
- self.release = '5.6.12'
+ self.release = '5.6.33'
self.root_path = '/api/5.6/index.html'
self.initial_paths = %w(/docs/5.6/installation /api/5.6/classes.html)
diff --git a/lib/docs/scrapers/leaflet.rb b/lib/docs/scrapers/leaflet.rb
new file mode 100644
index 00000000..c8e2071c
--- /dev/null
+++ b/lib/docs/scrapers/leaflet.rb
@@ -0,0 +1,43 @@
+module Docs
+ class Leaflet < UrlScraper
+ self.name = 'Leaflet'
+ self.type = 'simple'
+ self.slug = 'leaflet'
+ self.links = {
+ home: 'https://leafletjs.com/',
+ code: 'https://github.com/Leaflet/Leaflet'
+ }
+
+ html_filters.push 'leaflet/entries', 'leaflet/clean_html', 'title'
+
+ options[:container] = '.container'
+ options[:skip_links] = true
+
+ options[:attribution] = <<-HTML
+ © 2010–2018 Vladimir Agafonkin
+ © 2010–2011, CloudMade
+ Maps © OpenStreetMap contributors.
+ HTML
+
+ version '1.3' do
+ self.release = '1.3.4'
+ self.base_url = "https://leafletjs.com/reference-#{release}.html"
+ end
+
+ version '1.2' do
+ self.release = '1.2.0'
+ self.base_url = "https://leafletjs.com/reference-#{release}.html"
+ end
+
+ version '1.1' do
+ self.release = '1.1.0'
+ self.base_url = "https://leafletjs.com/reference-#{release}.html"
+ end
+
+ version '1.0' do
+ self.release = '1.0.3'
+ self.base_url = "https://leafletjs.com/reference-#{release}.html"
+ end
+
+ end
+end
diff --git a/lib/docs/scrapers/less.rb b/lib/docs/scrapers/less.rb
index bf5c1607..a0947e1a 100644
--- a/lib/docs/scrapers/less.rb
+++ b/lib/docs/scrapers/less.rb
@@ -1,6 +1,6 @@
module Docs
class Less < UrlScraper
- self.type = 'less'
+ self.type = 'simple'
self.release = '2.7.2'
self.base_url = 'http://lesscss.org'
self.root_path = '/features'
diff --git a/lib/docs/scrapers/lodash.rb b/lib/docs/scrapers/lodash.rb
index fa566e5e..0461f7b7 100644
--- a/lib/docs/scrapers/lodash.rb
+++ b/lib/docs/scrapers/lodash.rb
@@ -2,7 +2,7 @@ module Docs
class Lodash < UrlScraper
self.name = 'lodash'
self.slug = 'lodash'
- self.type = 'lodash'
+ self.type = 'simple'
self.links = {
home: 'https://lodash.com/',
code: 'https://github.com/lodash/lodash/'
diff --git a/lib/docs/scrapers/marionette.rb b/lib/docs/scrapers/marionette.rb
index fbcc71cf..fea6617f 100644
--- a/lib/docs/scrapers/marionette.rb
+++ b/lib/docs/scrapers/marionette.rb
@@ -2,7 +2,7 @@ module Docs
class Marionette < UrlScraper
self.name = 'Marionette.js'
self.slug = 'marionette'
- self.type = 'marionette'
+ self.type = 'simple'
self.root_path = 'index'
self.links = {
home: 'https://marionettejs.com/',
@@ -18,6 +18,13 @@ module Docs
Licensed under the MIT License.
HTML
+ version '4' do
+ self.release = '4.0.0'
+ self.base_url = "https://marionettejs.com/docs/v#{release}/"
+
+ html_filters.push 'marionette/entries_v3'
+ end
+
version '3' do
self.release = '3.5.1'
self.base_url = "https://marionettejs.com/docs/v#{release}/"
diff --git a/lib/docs/scrapers/markdown.rb b/lib/docs/scrapers/markdown.rb
index 6dc7b020..87e9c957 100644
--- a/lib/docs/scrapers/markdown.rb
+++ b/lib/docs/scrapers/markdown.rb
@@ -1,7 +1,7 @@
module Docs
class Markdown < UrlScraper
self.name = 'Markdown'
- self.type = 'markdown'
+ self.type = 'simple'
self.base_url = 'http://daringfireball.net/projects/markdown/syntax'
html_filters.push 'markdown/clean_html', 'markdown/entries'
diff --git a/lib/docs/scrapers/matplotlib.rb b/lib/docs/scrapers/matplotlib.rb
index 0e50a7f7..ddd1f9de 100644
--- a/lib/docs/scrapers/matplotlib.rb
+++ b/lib/docs/scrapers/matplotlib.rb
@@ -6,7 +6,7 @@ module Docs
self.type = 'sphinx'
self.root_path = 'index.html'
self.links = {
- home: 'http://matplotlib.org/',
+ home: 'https://matplotlib.org/',
code: 'https://github.com/matplotlib/matplotlib'
}
@@ -16,34 +16,52 @@ module Docs
options[:skip] = %w(api_changes.html tutorial.html faq.html)
options[:attribution] = <<-HTML
- © 2012–2017 Matplotlib Development Team. All rights reserved.
+ © 2012–2018 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
HTML
+ version '3.0' do
+ self.release = '3.0.0'
+ self.base_urls = [
+ "https://matplotlib.org/#{release}/api/",
+ "https://matplotlib.org/#{release}/mpl_toolkits/mplot3d/",
+ "https://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/"
+ ]
+ end
+
+ version '2.2' do
+ self.release = '2.2.3'
+ self.base_urls = [
+ "https://matplotlib.org/#{release}/api/",
+ "https://matplotlib.org/#{release}/mpl_toolkits/mplot3d/",
+ "https://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/"
+ ]
+ end
+
version '2.1' do
self.release = '2.1.0'
self.base_urls = [
- "http://matplotlib.org/#{release}/api/",
- "http://matplotlib.org/#{release}/mpl_toolkits/mplot3d/",
- "http://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/"
+ "https://matplotlib.org/#{release}/api/",
+ "https://matplotlib.org/#{release}/mpl_toolkits/mplot3d/",
+ "https://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/"
]
end
version '2.0' do
self.release = '2.0.2'
self.base_urls = [
- "http://matplotlib.org/#{release}/api/",
- "http://matplotlib.org/#{release}/mpl_toolkits/mplot3d/",
- "http://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/"
+ "https://matplotlib.org/#{release}/api/",
+ "https://matplotlib.org/#{release}/mpl_toolkits/mplot3d/",
+ "https://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/"
]
end
version '1.5' do
self.release = '1.5.3'
self.base_urls = [
- "http://matplotlib.org/#{release}/api/",
- "http://matplotlib.org/#{release}/mpl_toolkits/mplot3d/",
- "http://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/"
+ "https://matplotlib.org/#{release}/api/",
+ "https://matplotlib.org/#{release}/mpl_toolkits/mplot3d/",
+ "https://matplotlib.org/#{release}/mpl_toolkits/axes_grid/api/"
]
end
end
diff --git a/lib/docs/scrapers/mocha.rb b/lib/docs/scrapers/mocha.rb
index c358a79b..8ab9bdc8 100644
--- a/lib/docs/scrapers/mocha.rb
+++ b/lib/docs/scrapers/mocha.rb
@@ -1,7 +1,7 @@
module Docs
class Mocha < UrlScraper
- self.type = 'mocha'
- self.release = '5.0.1'
+ self.type = 'simple'
+ self.release = '5.2.0'
self.base_url = 'https://mochajs.org/'
self.links = {
home: 'https://mochajs.org/',
diff --git a/lib/docs/scrapers/mongoose.rb b/lib/docs/scrapers/mongoose.rb
index d6ca8a01..71ee04d2 100644
--- a/lib/docs/scrapers/mongoose.rb
+++ b/lib/docs/scrapers/mongoose.rb
@@ -1,7 +1,7 @@
module Docs
class Mongoose < UrlScraper
self.name = 'Mongoose'
- self.type = 'mongoose'
+ self.type = 'simple'
self.release = '4.13.1'
self.base_url = 'http://mongoosejs.com/docs/'
self.root_path = 'index.html'
diff --git a/lib/docs/scrapers/nginx.rb b/lib/docs/scrapers/nginx.rb
index c6a772e2..5a3dbf1e 100644
--- a/lib/docs/scrapers/nginx.rb
+++ b/lib/docs/scrapers/nginx.rb
@@ -2,7 +2,7 @@ module Docs
class Nginx < UrlScraper
self.name = 'nginx'
self.type = 'nginx'
- self.release = '1.15.0'
+ self.release = '1.15.5'
self.base_url = 'https://nginx.org/en/docs/'
self.links = {
home: 'https://nginx.org/',
diff --git a/lib/docs/scrapers/nim.rb b/lib/docs/scrapers/nim.rb
index 1077d98e..cce16f1c 100644
--- a/lib/docs/scrapers/nim.rb
+++ b/lib/docs/scrapers/nim.rb
@@ -1,7 +1,7 @@
module Docs
class Nim < UrlScraper
- self.type = 'nim'
- self.release = '0.18.0'
+ self.type = 'simple'
+ self.release = '0.19.0'
self.base_url = 'https://nim-lang.org/docs/'
self.root_path = 'overview.html'
self.links = {
@@ -14,7 +14,7 @@ module Docs
options[:skip] = %w(theindex.html docgen.txt)
options[:attribution] = <<-HTML
- © 2006–2017 Andreas Rumpf
+ © 2006–2018 Andreas Rumpf
Licensed under the MIT License.
HTML
end
diff --git a/lib/docs/scrapers/node.rb b/lib/docs/scrapers/node.rb
index 0dc7c7e8..66c6a456 100644
--- a/lib/docs/scrapers/node.rb
+++ b/lib/docs/scrapers/node.rb
@@ -23,17 +23,22 @@ module Docs
HTML
version do
- self.release = '10.4.0'
+ self.release = '11.1.0'
+ self.base_url = 'https://nodejs.org/dist/latest-v11.x/docs/api/'
+ end
+
+ version '10 LTS' do
+ self.release = '10.13.0'
self.base_url = 'https://nodejs.org/dist/latest-v10.x/docs/api/'
end
version '8 LTS' do
- self.release = '8.11.2'
+ self.release = '8.12.0'
self.base_url = 'https://nodejs.org/dist/latest-v8.x/docs/api/'
end
version '6 LTS' do
- self.release = '6.14.2'
+ self.release = '6.14.4'
self.base_url = 'https://nodejs.org/dist/latest-v6.x/docs/api/'
end
diff --git a/lib/docs/scrapers/nokogiri2.rb b/lib/docs/scrapers/nokogiri2.rb
index f7fed163..084ad2fb 100644
--- a/lib/docs/scrapers/nokogiri2.rb
+++ b/lib/docs/scrapers/nokogiri2.rb
@@ -1,9 +1,13 @@
module Docs
class Nokogiri2 < Rdoc
+ # Instructions:
+ # 1. Download the latest release at https://github.com/sparklemotion/nokogiri/releases
+ # 2. Run "bundle install && bundle exec rake docs" (in the Nokogiri directory)
+ # 4. Copy the "doc" directory to "docs/nokgiri"
+
self.name = 'Nokogiri'
self.slug = 'nokogiri'
- self.release = '1.8.1'
- self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Nokogiri'
+ self.release = '1.9.0'
html_filters.replace 'rdoc/entries', 'nokogiri2/entries'
@@ -11,8 +15,8 @@ module Docs
options[:only_patterns] = [/\ANokogiri/, /\AXSD/]
options[:attribution] = <<-HTML
- © 2008–2017 Aaron Patterson, Mike Dalessio, Charles Nutter, Sergio Arbeo
- Patrick Mahoney, Yoko Harada, Akinori Musha, John Shahid
+ © 2008–2018 Aaron Patterson, Mike Dalessio, Charles Nutter, Sergio Arbeo,
+ Patrick Mahoney, Yoko Harada, Akinori Musha, John Shahid, Lars Kanis
Licensed under the MIT License.
HTML
end
diff --git a/lib/docs/scrapers/npm.rb b/lib/docs/scrapers/npm.rb
index 3e15848b..2c854e6e 100644
--- a/lib/docs/scrapers/npm.rb
+++ b/lib/docs/scrapers/npm.rb
@@ -2,7 +2,7 @@ module Docs
class Npm < UrlScraper
self.name = 'npm'
self.type = 'npm'
- self.release = '6.1.0'
+ self.release = '6.4.0'
self.base_url = 'https://docs.npmjs.com/'
self.force_gzip = true
self.links = {
diff --git a/lib/docs/scrapers/numpy.rb b/lib/docs/scrapers/numpy.rb
index 0756e062..1327fc02 100644
--- a/lib/docs/scrapers/numpy.rb
+++ b/lib/docs/scrapers/numpy.rb
@@ -2,7 +2,6 @@ module Docs
class Numpy < FileScraper
self.name = 'NumPy'
self.type = 'sphinx'
- self.dir = '/Users/Thibaut/DevDocs/Docs/numpy/reference/'
self.root_path = 'index.html'
self.links = {
home: 'http://www.numpy.org/',
diff --git a/lib/docs/scrapers/openjdk.rb b/lib/docs/scrapers/openjdk.rb
index deff67d6..944ac416 100644
--- a/lib/docs/scrapers/openjdk.rb
+++ b/lib/docs/scrapers/openjdk.rb
@@ -1,11 +1,10 @@
module Docs
class Openjdk < FileScraper
+ # Downloaded from packages.debian.org/sid/openjdk-8-doc
+ # Extracting subdirectory /usr/share/doc/openjdk-8-jre-headless/api
self.name = 'OpenJDK'
self.type = 'openjdk'
self.root_path = 'overview-summary.html'
- # Downloaded from packages.debian.org/sid/openjdk-8-doc
- # Extracting subdirectory /usr/share/doc/openjdk-8-jre-headless/api
- self.dir = '/Users/Thibaut/DevDocs/Docs/OpenJDK'
html_filters.insert_after 'internal_urls', 'openjdk/clean_urls'
html_filters.push 'openjdk/entries', 'openjdk/clean_html'
diff --git a/lib/docs/scrapers/pandas.rb b/lib/docs/scrapers/pandas.rb
index 4879c8c1..1355a012 100644
--- a/lib/docs/scrapers/pandas.rb
+++ b/lib/docs/scrapers/pandas.rb
@@ -20,6 +20,11 @@ module Docs
Licensed under the 3-clause BSD License.
HTML
+ version '0.23' do
+ self.release = '0.23.4'
+ self.base_url = "http://pandas.pydata.org/pandas-docs/version/#{self.release}/"
+ end
+
version '0.22' do
self.release = '0.22.0'
self.base_url = "http://pandas.pydata.org/pandas-docs/version/#{self.release}/"
diff --git a/lib/docs/scrapers/perl.rb b/lib/docs/scrapers/perl.rb
index d794a4d6..142ceaa5 100644
--- a/lib/docs/scrapers/perl.rb
+++ b/lib/docs/scrapers/perl.rb
@@ -2,7 +2,6 @@ module Docs
class Perl < FileScraper
self.name = 'Perl'
self.type = 'perl'
- self.dir = '/Users/Thibaut/DevDocs/Docs/Perl'
self.root_path = 'index.html'
self.links = {
home: 'https://www.perl.org/'
diff --git a/lib/docs/scrapers/phoenix.rb b/lib/docs/scrapers/phoenix.rb
index a3760c44..26b0144f 100644
--- a/lib/docs/scrapers/phoenix.rb
+++ b/lib/docs/scrapers/phoenix.rb
@@ -1,7 +1,7 @@
module Docs
class Phoenix < UrlScraper
self.type = 'elixir'
- self.release = '1.3.2'
+ self.release = '1.3.4'
self.base_url = 'https://hexdocs.pm/'
self.root_path = 'phoenix/Phoenix.html'
self.initial_paths = %w(
diff --git a/lib/docs/scrapers/php.rb b/lib/docs/scrapers/php.rb
index 74336296..d4a66b5b 100644
--- a/lib/docs/scrapers/php.rb
+++ b/lib/docs/scrapers/php.rb
@@ -1,10 +1,12 @@
module Docs
class Php < FileScraper
+ # Downloaded from php.net/download-docs.php
+
include FixInternalUrlsBehavior
self.name = 'PHP'
self.type = 'php'
- self.release = '7.2.5'
+ self.release = '7.2.9'
self.base_url = 'https://secure.php.net/manual/en/'
self.root_path = 'index.html'
self.initial_paths = %w(
@@ -23,9 +25,6 @@ module Docs
code: 'https://git.php.net/?p=php-src.git;a=summary'
}
- # Downloaded from php.net/download-docs.php
- self.dir = '/Users/Thibaut/DevDocs/Docs/PHP'
-
html_filters.push 'php/internal_urls', 'php/entries', 'php/clean_html', 'title'
text_filters.push 'php/fix_urls'
diff --git a/lib/docs/scrapers/puppeteer.rb b/lib/docs/scrapers/puppeteer.rb
new file mode 100644
index 00000000..2e26c180
--- /dev/null
+++ b/lib/docs/scrapers/puppeteer.rb
@@ -0,0 +1,18 @@
+module Docs
+ class Puppeteer < Github
+ self.release = '1.10.0'
+ self.base_url = 'https://github.com/GoogleChrome/puppeteer/blob/v1.8.0/docs/api.md'
+ self.links = {
+ code: 'https://github.com/GoogleChrome/puppeteer'
+ }
+
+ html_filters.push 'puppeteer/entries', 'puppeteer/clean_html'
+
+ options[:container] = '.markdown-body'
+
+ options[:attribution] = <<-HTML
+ © 2017 Google Inc
+ Licensed under the Apache License 2.0.
+ HTML
+ end
+end
diff --git a/lib/docs/scrapers/pygame.rb b/lib/docs/scrapers/pygame.rb
new file mode 100644
index 00000000..9da3148d
--- /dev/null
+++ b/lib/docs/scrapers/pygame.rb
@@ -0,0 +1,20 @@
+module Docs
+ class Pygame < UrlScraper
+ self.type = 'simple'
+ self.release = '1.9.4'
+ self.root_path = 'py-modindex.html'
+ self.links = {
+ home: 'https://www.pygame.org/',
+ code: 'https://github.com/pygame/pygame'
+ }
+
+ html_filters.push 'pygame/clean_html', 'pygame/entries'
+
+ options[:only_patterns] = [/ref\//]
+
+ options[:attribution] = <<-HTML
+ © Pygame Developpers.
+ Licensed under the GNU LGPL License version 2.1.
+ HTML
+ end
+end
diff --git a/lib/docs/scrapers/python.rb b/lib/docs/scrapers/python.rb
index 8b0289d5..aa4336d9 100644
--- a/lib/docs/scrapers/python.rb
+++ b/lib/docs/scrapers/python.rb
@@ -1,6 +1,6 @@
module Docs
class Python < FileScraper
- self.type = 'sphinx'
+ self.type = 'python'
self.root_path = 'library/index.html'
self.links = {
home: 'https://www.python.org/',
@@ -23,25 +23,29 @@ module Docs
Licensed under the PSF License.
HTML
- version '3.6' do
- self.release = '3.6.4'
- self.dir = '/Users/Thibaut/DevDocs/Docs/Python36' # docs.python.org/3.6/download.html
+ version '3.7' do # docs.python.org/3.7/download.html
+ self.release = '3.7.0'
+ self.base_url = 'https://docs.python.org/3.7/'
+
+ html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
+ end
+
+ version '3.6' do # docs.python.org/3.6/download.html
+ self.release = '3.6.6'
self.base_url = 'https://docs.python.org/3.6/'
html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
end
- version '3.5' do
+ version '3.5' do # docs.python.org/3.5/download.html
self.release = '3.5.3'
- self.dir = '/Users/Thibaut/DevDocs/Docs/Python35' # docs.python.org/3.5/download.html
self.base_url = 'https://docs.python.org/3.5/'
html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'
end
- version '2.7' do
+ version '2.7' do # docs.python.org/2.7/download.html
self.release = '2.7.13'
- self.dir = '/Users/Thibaut/DevDocs/Docs/Python27' # docs.python.org/2.7/download.html
self.base_url = 'https://docs.python.org/2.7/'
html_filters.push 'python/entries_v2', 'sphinx/clean_html', 'python/clean_html'
diff --git a/lib/docs/scrapers/qt.rb b/lib/docs/scrapers/qt.rb
new file mode 100644
index 00000000..412eca6d
--- /dev/null
+++ b/lib/docs/scrapers/qt.rb
@@ -0,0 +1,121 @@
+module Docs
+ class Qt < UrlScraper
+ self.name = 'Qt'
+ self.type = 'qt'
+ self.initial_paths = %w(classes.html qmltypes.html)
+ self.root_path = 'index.html'
+ self.links = {
+ home: 'https://www.qt.io',
+ code: 'https://code.qt.io/cgit/'
+ }
+
+ html_filters.push 'qt/entries', 'qt/clean_html'
+
+ options[:container] = '.main'
+ options[:max_image_size] = 156_000
+ options[:skip_patterns] = [
+ # License, copyright attributions
+ /3rdparty/,
+ /attribution/,
+ /license/,
+ /licensing/,
+
+ # Examples, guides, tutorials
+ /example/,
+ /guide$/,
+ /tutorial/,
+ /porting/,
+ /usecase/,
+ /topic/,
+ /^modelview/,
+ /deploy(ing|ment)/,
+ /building/,
+
+ # Old versions, changelog
+ /obsolete/,
+ /compatibility/,
+ /^whatsnew/,
+ /^newclasses/,
+
+ # Deprecated modules
+ /(qtopengl|qgl)/,
+ /qt?script/,
+
+ # Indexes
+ /members/,
+ /module/,
+ /overview/,
+ /^qopenglfunctions/,
+
+ # Tooling
+ /^(qt)?(linguist|assistant|qdbusviewer)/,
+ ]
+
+ options[:skip] = [
+ "qt5-intro.html",
+ "compatmap.html",
+
+ # Indexes
+ "classes.html",
+ "qtmodules.html",
+ "modules-qml.html",
+ "modules-cpp.html",
+ "functions.html",
+ "namespaces.html",
+ "qmltypes.html",
+ "qt3d-qml.html",
+ "qmlbasictypes.html",
+ "guibooks.html",
+ "annotated.html",
+ "overviews-main.html",
+ "reference-overview.html",
+
+ # Tutorials
+ "qtvirtualkeyboard-build.html",
+
+ # Copyright
+ "trademarks.html",
+ "lgpl.html",
+ "bughowto.html",
+
+ # Changelogs
+ "changes.html",
+ "qtlocation-changes.html",
+ "sourcebreaks.html",
+
+ # Best practice guides
+ "accessible.html",
+ "accessible-qtquick.html",
+ "sharedlibrary.html",
+ "exceptionsafety.html",
+ "scalability.html",
+ "session.html",
+ "appicon.html",
+ "accelerators.html",
+
+ # Other
+ "ecmascript.html",
+ "qtremoteobjects-interaction.html",
+ ]
+
+ options[:attribution] = <<-HTML
+ © The Qt Company Ltd
+ Licensed under the GNU Free Documentation License, Version 1.3.
+ HTML
+
+ version '5.11' do
+ self.release = '5.11'
+ self.base_url = 'https://doc.qt.io/qt-5/'
+ end
+
+ version '5.9' do
+ self.release = '5.9'
+ self.base_url = 'https://doc.qt.io/qt-5.9/'
+ end
+
+ version '5.6' do
+ self.release = '5.6'
+ self.base_url = 'https://doc.qt.io/qt-5.6/'
+ end
+ end
+end
diff --git a/lib/docs/scrapers/rdoc/minitest.rb b/lib/docs/scrapers/rdoc/minitest.rb
index fa880199..761da1de 100644
--- a/lib/docs/scrapers/rdoc/minitest.rb
+++ b/lib/docs/scrapers/rdoc/minitest.rb
@@ -1,9 +1,14 @@
module Docs
class Minitest < Rdoc
+ # Instructions:
+ # 1. Run "gem update rdoc hoe"
+ # 2. Download the source code at https://github.com/seattlerb/minitest
+ # 3. Run "rake docs" (in the Minitest directory)
+ # 4. Copy the "docs" directory to "docs/minitest"
+
self.name = 'Ruby / Minitest'
self.slug = 'minitest'
- self.release = '5.10.3'
- self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Minitest' # rake docs
+ self.release = '5.11.3'
self.links = {
code: 'https://github.com/seattlerb/minitest'
}
diff --git a/lib/docs/scrapers/rdoc/rails.rb b/lib/docs/scrapers/rdoc/rails.rb
index d0365b50..6bdce34a 100644
--- a/lib/docs/scrapers/rdoc/rails.rb
+++ b/lib/docs/scrapers/rdoc/rails.rb
@@ -1,10 +1,17 @@
module Docs
class Rails < Rdoc
+ # Instructions:
+ # 1. Download a release at https://github.com/rails/rails/releases
+ # 2. Open "railties/lib/rails/api/task.rb" and comment out any code related to sdoc ("configure_sdoc")
+ # 3. Run "bundle install --without db && bundle exec rake rdoc" (in the Rails directory)
+ # 4. Run "cd guides && bundle exec rake guides:generate:html"
+ # 5. Copy the "guides/output" directory to "html/guides"
+ # 6. Copy the "html" directory to "docs/rails~[version]"
+
include FixInternalUrlsBehavior
self.name = 'Ruby on Rails'
self.slug = 'rails'
- self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Rails'
self.initial_paths = %w(guides/index.html)
self.links = {
home: 'http://rubyonrails.org/',
@@ -68,7 +75,7 @@ module Docs
end
version '5.2' do
- self.release = '5.2.0'
+ self.release = '5.2.2'
end
version '5.1' do
@@ -80,7 +87,7 @@ module Docs
end
version '4.2' do
- self.release = '4.2.10'
+ self.release = '4.2.11'
end
version '4.1' do
diff --git a/lib/docs/scrapers/rdoc/ruby.rb b/lib/docs/scrapers/rdoc/ruby.rb
index 35f34462..dd296765 100644
--- a/lib/docs/scrapers/rdoc/ruby.rb
+++ b/lib/docs/scrapers/rdoc/ruby.rb
@@ -1,16 +1,9 @@
module Docs
class Ruby < Rdoc
- # Generated with:
- # ./configure && make html
- # or:
- # rdoc \
- # --root . \
- # --page-dir doc \
- # --encoding=UTF-8 \
- # --visibility=public \
- # --format=darkfish \
- # --no-line-numbers \
- # --op html .
+ # Instructions:
+ # 1. Download Ruby's source code
+ # 2. Run "./configure && make html" (in the Ruby directory)
+ # 3. Copy the ".ext/html" directory to "docs/ruby~[version]"
include FixInternalUrlsBehavior
@@ -77,23 +70,19 @@ module Docs
HTML
version '2.5' do
- self.release = '2.5.0'
- self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Ruby25'
+ self.release = '2.5.3'
end
version '2.4' do
- self.release = '2.4.3'
- self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Ruby24'
+ self.release = '2.4.5'
end
version '2.3' do
- self.release = '2.3.6'
- self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Ruby23'
+ self.release = '2.3.8'
end
version '2.2' do
- self.release = '2.2.9'
- self.dir = '/Users/Thibaut/DevDocs/Docs/RDoc/Ruby22'
+ self.release = '2.2.10'
end
end
end
diff --git a/lib/docs/scrapers/react.rb b/lib/docs/scrapers/react.rb
index b8010bd6..704f3189 100644
--- a/lib/docs/scrapers/react.rb
+++ b/lib/docs/scrapers/react.rb
@@ -2,7 +2,7 @@ module Docs
class React < UrlScraper
self.name = 'React'
self.type = 'simple'
- self.release = '16.4.0'
+ self.release = '16.6.0'
self.base_url = 'https://reactjs.org/docs/'
self.root_path = 'hello-world.html'
self.links = {
diff --git a/lib/docs/scrapers/react_native.rb b/lib/docs/scrapers/react_native.rb
index 8300bc3b..d1f94001 100644
--- a/lib/docs/scrapers/react_native.rb
+++ b/lib/docs/scrapers/react_native.rb
@@ -2,7 +2,7 @@ module Docs
class ReactNative < UrlScraper
self.slug = 'react_native'
self.type = 'react_native'
- self.release = '0.55'
+ self.release = '0.56'
self.base_url = 'https://facebook.github.io/react-native/docs/'
self.root_path = 'getting-started.html'
self.links = {
diff --git a/lib/docs/scrapers/redis.rb b/lib/docs/scrapers/redis.rb
index 0314e273..201dbb47 100644
--- a/lib/docs/scrapers/redis.rb
+++ b/lib/docs/scrapers/redis.rb
@@ -1,7 +1,7 @@
module Docs
class Redis < UrlScraper
self.type = 'redis'
- self.release = '4.0.9'
+ self.release = '5.0.0'
self.base_url = 'https://redis.io/commands'
self.links = {
home: 'https://redis.io/',
diff --git a/lib/docs/scrapers/redux.rb b/lib/docs/scrapers/redux.rb
index 3cd5b330..cd7369ba 100644
--- a/lib/docs/scrapers/redux.rb
+++ b/lib/docs/scrapers/redux.rb
@@ -1,6 +1,6 @@
module Docs
class Redux < UrlScraper
- self.type = 'redux'
+ self.type = 'simple'
self.release = '3.7.2'
self.base_url = 'http://redux.js.org/docs/'
self.links = {
diff --git a/lib/docs/scrapers/requirejs.rb b/lib/docs/scrapers/requirejs.rb
index 357c58e5..200f1f2d 100644
--- a/lib/docs/scrapers/requirejs.rb
+++ b/lib/docs/scrapers/requirejs.rb
@@ -1,7 +1,7 @@
module Docs
class Requirejs < UrlScraper
self.name = 'RequireJS'
- self.type = 'requirejs'
+ self.type = 'simple'
self.release = '2.3.5'
self.base_url = 'http://requirejs.org/docs/'
self.links = {
diff --git a/lib/docs/scrapers/rust.rb b/lib/docs/scrapers/rust.rb
index e6019ac5..1677e138 100644
--- a/lib/docs/scrapers/rust.rb
+++ b/lib/docs/scrapers/rust.rb
@@ -1,9 +1,11 @@
+# frozen_string_literal: true
+
module Docs
class Rust < UrlScraper
self.type = 'rust'
- self.release = '1.26.0'
+ self.release = '1.30.1'
self.base_url = 'https://doc.rust-lang.org/'
- self.root_path = 'book/first-edition/index.html'
+ self.root_path = 'book/second-edition/index.html'
self.initial_paths = %w(
reference/introduction.html
collections/index.html
@@ -17,17 +19,18 @@ module Docs
html_filters.push 'rust/entries', 'rust/clean_html'
options[:only_patterns] = [
- /\Abook\/first-edition\//,
+ /\Abook\/second-edition\//,
/\Areference\//,
/\Acollections\//,
/\Astd\// ]
- options[:skip] = %w(book/first-edition/README.html)
- options[:skip_patterns] = [/(?(url) do
url.sub! %r{(#{Rust.base_url}.+/)\z}, '\1index.html'
url.sub! '/unicode/u_str', '/unicode/str/'
+ url.sub! '/std/std/', '/std/'
url
end
diff --git a/lib/docs/scrapers/scikit_image.rb b/lib/docs/scrapers/scikit_image.rb
index d229f6bb..2a60aaec 100644
--- a/lib/docs/scrapers/scikit_image.rb
+++ b/lib/docs/scrapers/scikit_image.rb
@@ -3,8 +3,8 @@ module Docs
self.name = 'scikit-image'
self.slug = 'scikit_image'
self.type = 'sphinx'
- self.release = '0.13.1'
- self.base_url = 'http://scikit-image.org/docs/0.13.x/'
+ self.release = '0.14.1'
+ self.base_url = 'http://scikit-image.org/docs/0.14.x/'
self.links = {
home: 'http://scikit-image.org/',
code: 'https://github.com/scikit-image/scikit-image'
diff --git a/lib/docs/scrapers/scikit_learn.rb b/lib/docs/scrapers/scikit_learn.rb
index 01b89e3b..fe6a8665 100644
--- a/lib/docs/scrapers/scikit_learn.rb
+++ b/lib/docs/scrapers/scikit_learn.rb
@@ -3,7 +3,7 @@ module Docs
self.name = 'scikit-learn'
self.slug = 'scikit_learn'
self.type = 'sphinx'
- self.release = '0.19.1'
+ self.release = '0.20.0'
self.base_url = 'http://scikit-learn.org/stable/'
self.root_path = 'documentation.html'
self.force_gzip = true
@@ -21,7 +21,7 @@ module Docs
options[:max_image_size] = 256_000
options[:attribution] = <<-HTML
- © 2007–2017 The scikit-learn developers
+ © 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
HTML
diff --git a/lib/docs/scrapers/sinon.rb b/lib/docs/scrapers/sinon.rb
index 4a950406..9e81cba9 100644
--- a/lib/docs/scrapers/sinon.rb
+++ b/lib/docs/scrapers/sinon.rb
@@ -4,7 +4,7 @@ module Docs
self.slug = 'sinon'
self.type = 'sinon'
self.links = {
- home: 'http://sinonjs.org/',
+ home: 'https://sinonjs.org/',
code: 'https://github.com/sinonjs/sinon'
}
@@ -18,29 +18,39 @@ module Docs
Licensed under the BSD License.
HTML
+ version '7' do
+ self.release = '7.1.1'
+ self.base_url = "https://sinonjs.org/releases/v#{release}/"
+ end
+
+ version '6' do
+ self.release = '6.3.5'
+ self.base_url = "https://sinonjs.org/releases/v#{release}/"
+ end
+
version '5' do
self.release = '5.1.0'
- self.base_url = "http://sinonjs.org/releases/v#{release}/"
+ self.base_url = "https://sinonjs.org/releases/v#{release}/"
end
version '4' do
self.release = '4.5.0'
- self.base_url = "http://sinonjs.org/releases/v#{release}/"
+ self.base_url = "https://sinonjs.org/releases/v#{release}/"
end
version '3' do
self.release = '3.3.0'
- self.base_url = "http://sinonjs.org/releases/v#{release}/"
+ self.base_url = "https://sinonjs.org/releases/v#{release}/"
end
version '2' do
self.release = '2.4.1'
- self.base_url = "http://sinonjs.org/releases/v#{release}/"
+ self.base_url = "https://sinonjs.org/releases/v#{release}/"
end
version '1' do
self.release = '1.17.7'
- self.base_url = "http://sinonjs.org/releases/v#{release}/"
+ self.base_url = "https://sinonjs.org/releases/v#{release}/"
end
end
end
diff --git a/lib/docs/scrapers/sqlite.rb b/lib/docs/scrapers/sqlite.rb
index 020f84bc..790acf83 100644
--- a/lib/docs/scrapers/sqlite.rb
+++ b/lib/docs/scrapers/sqlite.rb
@@ -2,8 +2,7 @@ module Docs
class Sqlite < FileScraper
self.name = 'SQLite'
self.type = 'sqlite'
- self.release = '3.23.1'
- self.dir = '/Users/Thibaut/DevDocs/Docs/sqlite/'
+ self.release = '3.25.2'
self.base_url = 'https://sqlite.org/'
self.root_path = 'docs.html'
self.initial_paths = %w(keyword_index.html)
diff --git a/lib/docs/scrapers/statsmodels.rb b/lib/docs/scrapers/statsmodels.rb
index 283141ab..255bde6c 100644
--- a/lib/docs/scrapers/statsmodels.rb
+++ b/lib/docs/scrapers/statsmodels.rb
@@ -1,7 +1,7 @@
module Docs
class Statsmodels < UrlScraper
self.type = 'sphinx'
- self.release = '0.8.0'
+ self.release = '0.9.0'
self.base_url = 'http://www.statsmodels.org/stable/'
self.root_path = 'index.html'
self.links = {
diff --git a/lib/docs/scrapers/symfony.rb b/lib/docs/scrapers/symfony.rb
index c50b7041..f5e4285a 100644
--- a/lib/docs/scrapers/symfony.rb
+++ b/lib/docs/scrapers/symfony.rb
@@ -26,44 +26,49 @@ module Docs
Licensed under the MIT License.
HTML
+ version '4.1' do
+ self.release = '4.1.7'
+ self.base_url = "https://api.symfony.com/#{version}/"
+ end
+
version '4.0' do
self.release = '4.0.3'
- self.base_url = "http://api.symfony.com/#{version}/"
+ self.base_url = "https://api.symfony.com/#{version}/"
end
version '3.4' do
self.release = '3.4.3'
- self.base_url = "http://api.symfony.com/#{version}/"
+ self.base_url = "https://api.symfony.com/#{version}/"
end
version '3.3' do
self.release = '3.3.15'
- self.base_url = "http://api.symfony.com/#{version}/"
+ self.base_url = "https://api.symfony.com/#{version}/"
end
version '3.2' do
self.release = '3.2.13'
- self.base_url = "http://api.symfony.com/#{version}/"
+ self.base_url = "https://api.symfony.com/#{version}/"
end
version '3.1' do
self.release = '3.1.8'
- self.base_url = "http://api.symfony.com/#{version}/"
+ self.base_url = "https://api.symfony.com/#{version}/"
end
version '3.0' do
self.release = '3.0.1'
- self.base_url = "http://api.symfony.com/#{version}/"
+ self.base_url = "https://api.symfony.com/#{version}/"
end
version '2.8' do
self.release = '2.8.28'
- self.base_url = "http://api.symfony.com/#{version}/"
+ self.base_url = "https://api.symfony.com/#{version}/"
end
version '2.7' do
self.release = '2.7.35'
- self.base_url = "http://api.symfony.com/#{version}/"
+ self.base_url = "https://api.symfony.com/#{version}/"
end
end
end
diff --git a/lib/docs/scrapers/terraform.rb b/lib/docs/scrapers/terraform.rb
new file mode 100644
index 00000000..ab12775d
--- /dev/null
+++ b/lib/docs/scrapers/terraform.rb
@@ -0,0 +1,22 @@
+module Docs
+ class Terraform < UrlScraper
+ self.name = 'Terraform'
+ self.type = 'terraform'
+ self.release = '0.11.7'
+ self.base_url = 'https://www.terraform.io/docs/'
+ self.root_path = 'index.html'
+ self.links = {
+ home: 'https://www.terraform.io/',
+ code: 'https://github.com/hashicorp/terraform'
+ }
+
+ html_filters.push 'terraform/entries', 'terraform/clean_html'
+
+ options[:skip_patterns] = [/enterprise/, /enterprise-legacy/]
+
+ options[:attribution] = <<-HTML
+ © 2018 HashiCorp
+ Licensed under the MPL 2.0 License.
+ HTML
+ end
+end
diff --git a/lib/docs/scrapers/twig.rb b/lib/docs/scrapers/twig.rb
index e382bfef..4781dcb2 100755
--- a/lib/docs/scrapers/twig.rb
+++ b/lib/docs/scrapers/twig.rb
@@ -4,14 +4,14 @@ module Docs
self.root_path = 'index.html'
self.initial_paths = %w(extensions/index.html)
self.links = {
- home: 'https://twig.sensiolabs.org/',
+ home: 'https://twig.symfony.com/',
code: 'https://github.com/twigphp/Twig'
}
options[:attribution] = <<-HTML
- © 2009–2017 by the Twig Team
+ © 2009–2018 by the Twig Team
Licensed under the three clause BSD license.
- The Twig logo is © 2010–2017 SensioLabs
+ The Twig logo is © 2010–2018 Symfony
HTML
html_filters.push 'twig/clean_html', 'twig/entries'
@@ -20,13 +20,13 @@ module Docs
options[:skip] = %w(deprecated.html advanced_legacy.html)
version '2' do
- self.release = '2.4.3'
- self.base_url = 'https://twig.sensiolabs.org/doc/2.x/'
+ self.release = '2.5.0'
+ self.base_url = 'https://twig.symfony.com/doc/2.x/'
end
version '1' do
self.release = '1.34.3'
- self.base_url = 'https://twig.sensiolabs.org/doc/1.x/'
+ self.base_url = 'https://twig.symfony.com/doc/1.x/'
end
end
end
diff --git a/lib/docs/scrapers/typescript.rb b/lib/docs/scrapers/typescript.rb
index e8004fe9..1117314a 100644
--- a/lib/docs/scrapers/typescript.rb
+++ b/lib/docs/scrapers/typescript.rb
@@ -1,8 +1,8 @@
module Docs
class Typescript < UrlScraper
self.name = 'TypeScript'
- self.type = 'typescript'
- self.release = '2.9.0'
+ self.type = 'simple'
+ self.release = '3.1.6'
self.base_url = 'https://www.typescriptlang.org/docs/'
self.root_path = 'tutorial.html'
self.links = {
diff --git a/lib/docs/scrapers/underscore.rb b/lib/docs/scrapers/underscore.rb
index ac9ecf81..004a09e9 100644
--- a/lib/docs/scrapers/underscore.rb
+++ b/lib/docs/scrapers/underscore.rb
@@ -3,10 +3,10 @@ module Docs
self.name = 'Underscore.js'
self.slug = 'underscore'
self.type = 'underscore'
- self.release = '1.9.0'
- self.base_url = 'http://underscorejs.org'
+ self.release = '1.9.1'
+ self.base_url = 'https://underscorejs.org'
self.links = {
- home: 'http://underscorejs.org',
+ home: 'https://underscorejs.org',
code: 'https://github.com/jashkenas/underscore'
}
@@ -17,7 +17,7 @@ module Docs
options[:skip_links] = true
options[:attribution] = <<-HTML
- © 2009–2017 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ © 2009–2018 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
Licensed under the MIT License.
HTML
end
diff --git a/lib/docs/scrapers/vagrant.rb b/lib/docs/scrapers/vagrant.rb
index 84369b5f..955746aa 100644
--- a/lib/docs/scrapers/vagrant.rb
+++ b/lib/docs/scrapers/vagrant.rb
@@ -1,8 +1,8 @@
module Docs
class Vagrant < UrlScraper
self.name = 'Vagrant'
- self.type = 'vagrant'
- self.release = '2.1.1'
+ self.type = 'simple'
+ self.release = '2.2.0'
self.base_url = 'https://www.vagrantup.com/docs/'
self.root_path = 'index.html'
self.links = {
diff --git a/lib/docs/scrapers/vulkan.rb b/lib/docs/scrapers/vulkan.rb
index c3b23269..e1fa4b4b 100644
--- a/lib/docs/scrapers/vulkan.rb
+++ b/lib/docs/scrapers/vulkan.rb
@@ -1,7 +1,7 @@
module Docs
class Vulkan < UrlScraper
self.name = 'Vulkan'
- self.type = 'vulkan'
+ self.type = 'simple'
self.release = '1.0.59'
self.base_url = 'https://www.khronos.org/registry/vulkan/specs/1.0/'
self.root_path = 'apispec.html'
diff --git a/lib/docs/scrapers/webpack.rb b/lib/docs/scrapers/webpack.rb
index 86632aa8..255c1bb4 100644
--- a/lib/docs/scrapers/webpack.rb
+++ b/lib/docs/scrapers/webpack.rb
@@ -4,7 +4,7 @@ module Docs
self.type = 'webpack'
version do
- self.release = '4.12.0'
+ self.release = '4.16.5'
self.base_url = 'https://webpack.js.org/'
self.root_path = 'guides/'
self.initial_paths = %w(
diff --git a/lib/docs/scrapers/yarn.rb b/lib/docs/scrapers/yarn.rb
index 7923f346..825a749f 100644
--- a/lib/docs/scrapers/yarn.rb
+++ b/lib/docs/scrapers/yarn.rb
@@ -1,7 +1,7 @@
module Docs
class Yarn < UrlScraper
- self.type = 'yarn'
- self.release = '1.7.0'
+ self.type = 'simple'
+ self.release = '1.12.1'
self.base_url = 'https://yarnpkg.com/en/docs/'
self.links = {
home: 'https://yarnpkg.com/',
diff --git a/lib/docs/subscribers/requester_subscriber.rb b/lib/docs/subscribers/requester_subscriber.rb
new file mode 100644
index 00000000..4629e9f3
--- /dev/null
+++ b/lib/docs/subscribers/requester_subscriber.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+module Docs
+ class RequesterSubscriber < Subscriber
+ self.namespace = 'requester'
+
+ def handle_response(event)
+ if event.duration > 10_000
+ log "WARN: #{format_url event.payload[:url]} was slow to process (#{(event.duration / 1000).round}s)"
+ end
+ end
+ end
+end
diff --git a/lib/tasks/docs.thor b/lib/tasks/docs.thor
index a312d714..4e7cbcce 100644
--- a/lib/tasks/docs.thor
+++ b/lib/tasks/docs.thor
@@ -12,15 +12,29 @@ class DocsCLI < Thor
end
desc 'list', 'List available documentations'
+ option :packaged, type: :boolean
def list
- output = Docs.all.flat_map do |doc|
- name = doc.to_s.demodulize.underscore
- if doc.versioned?
- doc.versions.map { |_doc| "#{name}@#{_doc.version}" }
- else
- name
+ if options[:packaged]
+ slugs = Dir[File.join(Docs.store_path, '*.tar.gz')].map { |f| File.basename(f, '.tar.gz') }
+ names = find_docs_by_slugs(slugs).map do |doc|
+ name = if doc.version?
+ "#{doc.superclass.to_s.demodulize.underscore}@#{doc.version}"
+ else
+ doc.to_s.demodulize.underscore
+ end
+ end
+ else
+ names = Docs.all.flat_map do |doc|
+ name = doc.to_s.demodulize.underscore
+ if doc.versioned?
+ doc.versions.map { |_doc| "#{name}@#{_doc.version}" }
+ else
+ name
+ end
end
- end.join("\n")
+ end
+
+ output = names.join("\n")
require 'tty-pager'
TTY::Pager.new.page(output)
@@ -39,7 +53,7 @@ class DocsCLI < Thor
Docs.install_report :store if options[:verbose]
if options[:debug]
GC.disable
- Docs.install_report :filter, :request
+ Docs.install_report :filter, :request, :doc
end
if Docs.generate_page(name, options[:version], path)
@@ -62,7 +76,7 @@ class DocsCLI < Thor
Docs.rescue_errors = true
Docs.install_report :store if options[:verbose]
Docs.install_report :scraper if options[:debug]
- Docs.install_report :progress_bar, :doc, :image if $stdout.tty?
+ Docs.install_report :progress_bar, :doc, :image, :requester if $stdout.tty?
require 'unix_utils' if options[:package]
@@ -149,15 +163,55 @@ class DocsCLI < Thor
option :dryrun, type: :boolean
option :packaged, type: :boolean
def upload(*names)
- names = Dir[File.join(Docs.store_path, '*.tar.gz')].map { |f| File.basename(f, '.tar.gz') } if options[:packaged]
- docs = find_docs(names)
+ require 'net/sftp'
+
+ if options[:packaged]
+ slugs = Dir[File.join(Docs.store_path, '*.tar.gz')].map { |f| File.basename(f, '.tar.gz') }
+ docs = find_docs_by_slugs(slugs)
+ else
+ docs = find_docs(names)
+ end
+
assert_docs(docs)
+
+ # Verify files are present
docs.each do |doc|
- puts "Syncing #{doc.path}..."
- cmd = "aws s3 sync #{File.join(Docs.store_path, doc.path)} s3://docs.devdocs.io/#{doc.path} --delete"
+ unless Dir.exists?(File.join(Docs.store_path, doc.path))
+ puts "ERROR: directory #{File.join(Docs.store_path, doc.path)} not found."
+ return
+ end
+
+ unless File.exists?(File.join(Docs.store_path, "#{doc.path}.tar.gz"))
+ puts "ERROR: package for '#{doc.slug}' documentation not found. Run 'thor docs:package #{doc.slug}' to create it."
+ return
+ end
+ end
+
+ # Sync files with S3 (used by the web app)
+ puts '[S3] Begin syncing.'
+ docs.each do |doc|
+ puts "[S3] Syncing #{doc.path}..."
+ cmd = "aws s3 sync #{File.join(Docs.store_path, doc.path)} s3://devdocs-assets/#{doc.path} --delete --profile devdocs"
cmd << ' --dryrun' if options[:dryrun]
system(cmd)
end
+ puts '[S3] Done syncing.'
+
+ # Upload packages to dl.devdocs.io (used by the "thor docs:download" command)
+ puts '[MaxCDN] Begin uploading.'
+ Net::SFTP.start('ftp.devdocs-dl.devdocs.netdna-cdn.com', ENV['DEVDOCS_DL_USERNAME'], password: ENV['DEVDOCS_DL_PASSWORD']) do |sftp|
+ docs.each do |doc|
+ filename = "#{doc.path}.tar.gz"
+ print "[MaxCDN] Uploading #{filename}..."
+ if options[:dryrun]
+ print "\n"
+ else
+ sftp.upload! File.join(Docs.store_path, filename), File.join('', 'public_html', filename)
+ print " OK\n"
+ end
+ end
+ end
+ puts '[MaxCDN] Done uploading.'
end
desc 'commit', '[private]'
@@ -172,12 +226,60 @@ class DocsCLI < Thor
handle_doc_not_found_error(error)
end
+ desc 'prepare_deploy', 'Internal task executed before deployment'
+ def prepare_deploy
+ puts 'Docs -- BEGIN'
+
+ require 'open-uri'
+ require 'thread'
+
+ docs = Docs.all_versions
+ time = Time.now.to_i
+ mutex = Mutex.new
+
+ (1..6).map do
+ Thread.new do
+ while doc = docs.shift
+ dir = File.join(Docs.store_path, doc.path)
+ FileUtils.mkpath(dir)
+
+ ['index.json', 'meta.json'].each do |filename|
+ open("https://docs.devdocs.io/#{doc.path}/#{filename}?#{time}") do |file|
+ mutex.synchronize do
+ path = File.join(dir, filename)
+ File.write(path, file.read)
+ end
+ end
+ end
+
+ puts "Docs -- Downloaded #{doc.slug}"
+ end
+ end
+ end.map(&:join)
+
+ puts 'Docs -- Generating manifest...'
+ generate_manifest
+
+ puts 'Docs -- DONE'
+ end
+
private
def find_docs(names)
- names.map do |name|
+ names.flat_map do |name|
name, version = name.split(/@|~/)
- Docs.find(name, version)
+ if version == 'all'
+ Docs.find(name, false).versions
+ else
+ Docs.find(name, version)
+ end
+ end
+ end
+
+ def find_docs_by_slugs(slugs)
+ slugs.flat_map do |slug|
+ slug, version = slug.split(/~/)
+ Docs.find_by_slug(slug, version)
end
end
diff --git a/public/favicon.pxm b/public/favicon.pxm
new file mode 100644
index 00000000..8093243c
Binary files /dev/null and b/public/favicon.pxm differ
diff --git a/public/favicon@2x.pxm b/public/favicon@2x.pxm
new file mode 100644
index 00000000..80e7e947
Binary files /dev/null and b/public/favicon@2x.pxm differ
diff --git a/public/icons/docs-2.pxm b/public/icons/docs-2.pxm
index 0cb4c478..ba5ce1b5 100644
Binary files a/public/icons/docs-2.pxm and b/public/icons/docs-2.pxm differ
diff --git a/public/icons/docs-2@2x.pxm b/public/icons/docs-2@2x.pxm
index 8adb507c..3c390953 100644
Binary files a/public/icons/docs-2@2x.pxm and b/public/icons/docs-2@2x.pxm differ
diff --git a/public/icons/docs/bash/16.png b/public/icons/docs/bash/16.png
new file mode 100644
index 00000000..083d83b2
Binary files /dev/null and b/public/icons/docs/bash/16.png differ
diff --git a/public/icons/docs/bash/16@2x.png b/public/icons/docs/bash/16@2x.png
new file mode 100644
index 00000000..3b7aa0bc
Binary files /dev/null and b/public/icons/docs/bash/16@2x.png differ
diff --git a/public/icons/docs/bash/SOURCE b/public/icons/docs/bash/SOURCE
new file mode 100644
index 00000000..1baa51d0
--- /dev/null
+++ b/public/icons/docs/bash/SOURCE
@@ -0,0 +1 @@
+https://github.com/odb/official-bash-logo
diff --git a/public/icons/docs/css/CSS3.sketch/Data b/public/icons/docs/css/CSS3.sketch/Data
new file mode 100644
index 00000000..ca0a9d40
Binary files /dev/null and b/public/icons/docs/css/CSS3.sketch/Data differ
diff --git a/public/icons/docs/css/CSS3.sketch/QuickLook/Preview.png b/public/icons/docs/css/CSS3.sketch/QuickLook/Preview.png
new file mode 100644
index 00000000..5a71807e
Binary files /dev/null and b/public/icons/docs/css/CSS3.sketch/QuickLook/Preview.png differ
diff --git a/public/icons/docs/css/CSS3.sketch/QuickLook/Thumbnail.png b/public/icons/docs/css/CSS3.sketch/QuickLook/Thumbnail.png
new file mode 100644
index 00000000..1cfc6283
Binary files /dev/null and b/public/icons/docs/css/CSS3.sketch/QuickLook/Thumbnail.png differ
diff --git a/public/icons/docs/css/CSS3.sketch/fonts b/public/icons/docs/css/CSS3.sketch/fonts
new file mode 100644
index 00000000..e69de29b
diff --git a/public/icons/docs/css/CSS3.sketch/version b/public/icons/docs/css/CSS3.sketch/version
new file mode 100644
index 00000000..9a037142
--- /dev/null
+++ b/public/icons/docs/css/CSS3.sketch/version
@@ -0,0 +1 @@
+10
\ No newline at end of file
diff --git a/public/icons/docs/dart/16.png b/public/icons/docs/dart/16.png
new file mode 100644
index 00000000..82dae43a
Binary files /dev/null and b/public/icons/docs/dart/16.png differ
diff --git a/public/icons/docs/dart/16@2x.png b/public/icons/docs/dart/16@2x.png
new file mode 100644
index 00000000..c27da76f
Binary files /dev/null and b/public/icons/docs/dart/16@2x.png differ
diff --git a/public/icons/docs/dart/SOURCE b/public/icons/docs/dart/SOURCE
new file mode 100644
index 00000000..dd21f7e7
--- /dev/null
+++ b/public/icons/docs/dart/SOURCE
@@ -0,0 +1 @@
+https://github.com/dart-lang/logos
diff --git a/public/icons/docs/dom/DOM.sketch/Data b/public/icons/docs/dom/DOM.sketch/Data
new file mode 100644
index 00000000..bab05f86
Binary files /dev/null and b/public/icons/docs/dom/DOM.sketch/Data differ
diff --git a/public/icons/docs/dom/DOM.sketch/QuickLook/Preview.png b/public/icons/docs/dom/DOM.sketch/QuickLook/Preview.png
new file mode 100644
index 00000000..9e1b9c1c
Binary files /dev/null and b/public/icons/docs/dom/DOM.sketch/QuickLook/Preview.png differ
diff --git a/public/icons/docs/dom/DOM.sketch/QuickLook/Thumbnail.png b/public/icons/docs/dom/DOM.sketch/QuickLook/Thumbnail.png
new file mode 100644
index 00000000..cb1d1457
Binary files /dev/null and b/public/icons/docs/dom/DOM.sketch/QuickLook/Thumbnail.png differ
diff --git a/public/icons/docs/dom/DOM.sketch/fonts b/public/icons/docs/dom/DOM.sketch/fonts
new file mode 100644
index 00000000..e69de29b
diff --git a/public/icons/docs/dom/DOM.sketch/version b/public/icons/docs/dom/DOM.sketch/version
new file mode 100644
index 00000000..9a037142
--- /dev/null
+++ b/public/icons/docs/dom/DOM.sketch/version
@@ -0,0 +1 @@
+10
\ No newline at end of file
diff --git a/public/icons/docs/dom_events/DOM_events.sketch/Data b/public/icons/docs/dom_events/DOM_events.sketch/Data
new file mode 100644
index 00000000..67380c3f
Binary files /dev/null and b/public/icons/docs/dom_events/DOM_events.sketch/Data differ
diff --git a/public/icons/docs/dom_events/DOM_events.sketch/QuickLook/Preview.png b/public/icons/docs/dom_events/DOM_events.sketch/QuickLook/Preview.png
new file mode 100644
index 00000000..08a4a059
Binary files /dev/null and b/public/icons/docs/dom_events/DOM_events.sketch/QuickLook/Preview.png differ
diff --git a/public/icons/docs/dom_events/DOM_events.sketch/QuickLook/Thumbnail.png b/public/icons/docs/dom_events/DOM_events.sketch/QuickLook/Thumbnail.png
new file mode 100644
index 00000000..0746b49b
Binary files /dev/null and b/public/icons/docs/dom_events/DOM_events.sketch/QuickLook/Thumbnail.png differ
diff --git a/public/icons/docs/dom_events/DOM_events.sketch/fonts b/public/icons/docs/dom_events/DOM_events.sketch/fonts
new file mode 100644
index 00000000..e69de29b
diff --git a/public/icons/docs/dom_events/DOM_events.sketch/version b/public/icons/docs/dom_events/DOM_events.sketch/version
new file mode 100644
index 00000000..9a037142
--- /dev/null
+++ b/public/icons/docs/dom_events/DOM_events.sketch/version
@@ -0,0 +1 @@
+10
\ No newline at end of file
diff --git a/public/icons/docs/express/16.pxm b/public/icons/docs/express/16.pxm
new file mode 100644
index 00000000..ba143aa3
Binary files /dev/null and b/public/icons/docs/express/16.pxm differ
diff --git a/public/icons/docs/express/16@2x.pxm b/public/icons/docs/express/16@2x.pxm
new file mode 100644
index 00000000..22a76768
Binary files /dev/null and b/public/icons/docs/express/16@2x.pxm differ
diff --git a/public/icons/docs/handlebars/16.png b/public/icons/docs/handlebars/16.png
new file mode 100644
index 00000000..b0bba8b0
Binary files /dev/null and b/public/icons/docs/handlebars/16.png differ
diff --git a/public/icons/docs/handlebars/16@2x.png b/public/icons/docs/handlebars/16@2x.png
new file mode 100644
index 00000000..c9ff8c34
Binary files /dev/null and b/public/icons/docs/handlebars/16@2x.png differ
diff --git a/public/icons/docs/handlebars/SOURCE b/public/icons/docs/handlebars/SOURCE
new file mode 100644
index 00000000..aa446ef6
--- /dev/null
+++ b/public/icons/docs/handlebars/SOURCE
@@ -0,0 +1 @@
+https://github.com/yahoo/formatjs-site/tree/master/public/img
diff --git a/public/icons/docs/html/HTML5.sketch/Data b/public/icons/docs/html/HTML5.sketch/Data
new file mode 100644
index 00000000..f41b4fd3
Binary files /dev/null and b/public/icons/docs/html/HTML5.sketch/Data differ
diff --git a/public/icons/docs/html/HTML5.sketch/QuickLook/Preview.png b/public/icons/docs/html/HTML5.sketch/QuickLook/Preview.png
new file mode 100644
index 00000000..606f5529
Binary files /dev/null and b/public/icons/docs/html/HTML5.sketch/QuickLook/Preview.png differ
diff --git a/public/icons/docs/html/HTML5.sketch/QuickLook/Thumbnail.png b/public/icons/docs/html/HTML5.sketch/QuickLook/Thumbnail.png
new file mode 100644
index 00000000..f2b458ee
Binary files /dev/null and b/public/icons/docs/html/HTML5.sketch/QuickLook/Thumbnail.png differ
diff --git a/public/icons/docs/html/HTML5.sketch/fonts b/public/icons/docs/html/HTML5.sketch/fonts
new file mode 100644
index 00000000..e69de29b
diff --git a/public/icons/docs/html/HTML5.sketch/version b/public/icons/docs/html/HTML5.sketch/version
new file mode 100644
index 00000000..9a037142
--- /dev/null
+++ b/public/icons/docs/html/HTML5.sketch/version
@@ -0,0 +1 @@
+10
\ No newline at end of file
diff --git a/public/icons/docs/http/16.pxm b/public/icons/docs/http/16.pxm
new file mode 100644
index 00000000..f5a8b1a9
Binary files /dev/null and b/public/icons/docs/http/16.pxm differ
diff --git a/public/icons/docs/http/16@2x.pxm b/public/icons/docs/http/16@2x.pxm
new file mode 100644
index 00000000..f26d5ea2
Binary files /dev/null and b/public/icons/docs/http/16@2x.pxm differ
diff --git a/public/icons/docs/javascript/16.pxm b/public/icons/docs/javascript/16.pxm
new file mode 100644
index 00000000..630384f6
Binary files /dev/null and b/public/icons/docs/javascript/16.pxm differ
diff --git a/public/icons/docs/javascript/16@2x.pxm b/public/icons/docs/javascript/16@2x.pxm
new file mode 100644
index 00000000..00118697
Binary files /dev/null and b/public/icons/docs/javascript/16@2x.pxm differ
diff --git a/public/icons/docs/knockout/16@2x.pxm b/public/icons/docs/knockout/16@2x.pxm
new file mode 100644
index 00000000..a986edbc
Binary files /dev/null and b/public/icons/docs/knockout/16@2x.pxm differ
diff --git a/public/icons/docs/leaflet/16.png b/public/icons/docs/leaflet/16.png
new file mode 100644
index 00000000..f0638e03
Binary files /dev/null and b/public/icons/docs/leaflet/16.png differ
diff --git a/public/icons/docs/leaflet/16@2x.png b/public/icons/docs/leaflet/16@2x.png
new file mode 100644
index 00000000..24f0150d
Binary files /dev/null and b/public/icons/docs/leaflet/16@2x.png differ
diff --git a/public/icons/docs/leaflet/SOURCE b/public/icons/docs/leaflet/SOURCE
new file mode 100644
index 00000000..80b6994d
--- /dev/null
+++ b/public/icons/docs/leaflet/SOURCE
@@ -0,0 +1 @@
+http://leafletjs.com/docs/images/favicon.ico
diff --git a/public/icons/docs/less/less.pxm b/public/icons/docs/less/less.pxm
new file mode 100644
index 00000000..325739df
Binary files /dev/null and b/public/icons/docs/less/less.pxm differ
diff --git a/public/icons/docs/moment/moment.sketch/Data b/public/icons/docs/moment/moment.sketch/Data
new file mode 100644
index 00000000..c8318681
Binary files /dev/null and b/public/icons/docs/moment/moment.sketch/Data differ
diff --git a/public/icons/docs/moment/moment.sketch/QuickLook/Preview.png b/public/icons/docs/moment/moment.sketch/QuickLook/Preview.png
new file mode 100644
index 00000000..79e2f717
Binary files /dev/null and b/public/icons/docs/moment/moment.sketch/QuickLook/Preview.png differ
diff --git a/public/icons/docs/moment/moment.sketch/QuickLook/Thumbnail.png b/public/icons/docs/moment/moment.sketch/QuickLook/Thumbnail.png
new file mode 100644
index 00000000..da0a81d7
Binary files /dev/null and b/public/icons/docs/moment/moment.sketch/QuickLook/Thumbnail.png differ
diff --git a/public/icons/docs/moment/moment.sketch/fonts b/public/icons/docs/moment/moment.sketch/fonts
new file mode 100644
index 00000000..e69de29b
diff --git a/public/icons/docs/moment/moment.sketch/metadata b/public/icons/docs/moment/moment.sketch/metadata
new file mode 100644
index 00000000..1491bff2
--- /dev/null
+++ b/public/icons/docs/moment/moment.sketch/metadata
@@ -0,0 +1,14 @@
+
+
+
+
+ app
+ com.bohemiancoding.sketch
+ build
+ 5302
+ commit
+ 9460a4bc62af5e9ba50dd4143578fd9401710ce5
+ version
+ 18
+
+
diff --git a/public/icons/docs/moment/moment.sketch/version b/public/icons/docs/moment/moment.sketch/version
new file mode 100644
index 00000000..25bf17fc
--- /dev/null
+++ b/public/icons/docs/moment/moment.sketch/version
@@ -0,0 +1 @@
+18
\ No newline at end of file
diff --git a/public/icons/docs/nokogiri/icon.pxm b/public/icons/docs/nokogiri/icon.pxm
new file mode 100644
index 00000000..5b60912f
Binary files /dev/null and b/public/icons/docs/nokogiri/icon.pxm differ
diff --git a/public/icons/docs/php/16@2x.pxm b/public/icons/docs/php/16@2x.pxm
new file mode 100644
index 00000000..f301c968
Binary files /dev/null and b/public/icons/docs/php/16@2x.pxm differ
diff --git a/public/icons/docs/puppeteer/16.png b/public/icons/docs/puppeteer/16.png
new file mode 100644
index 00000000..1a15e128
Binary files /dev/null and b/public/icons/docs/puppeteer/16.png differ
diff --git a/public/icons/docs/puppeteer/16@2x.png b/public/icons/docs/puppeteer/16@2x.png
new file mode 100644
index 00000000..cf0c0d8b
Binary files /dev/null and b/public/icons/docs/puppeteer/16@2x.png differ
diff --git a/public/icons/docs/puppeteer/SOURCE b/public/icons/docs/puppeteer/SOURCE
new file mode 100644
index 00000000..73bf4c33
--- /dev/null
+++ b/public/icons/docs/puppeteer/SOURCE
@@ -0,0 +1 @@
+https://github.com/GoogleChromeLabs/pptr.dev/tree/master/src/favicons
diff --git a/public/icons/docs/pygame/16.png b/public/icons/docs/pygame/16.png
new file mode 100644
index 00000000..bf491003
Binary files /dev/null and b/public/icons/docs/pygame/16.png differ
diff --git a/public/icons/docs/pygame/16@2x.png b/public/icons/docs/pygame/16@2x.png
new file mode 100644
index 00000000..10d68ab4
Binary files /dev/null and b/public/icons/docs/pygame/16@2x.png differ
diff --git a/public/icons/docs/qt/16.png b/public/icons/docs/qt/16.png
new file mode 100644
index 00000000..3c14a85f
Binary files /dev/null and b/public/icons/docs/qt/16.png differ
diff --git a/public/icons/docs/qt/16@2x.png b/public/icons/docs/qt/16@2x.png
new file mode 100644
index 00000000..858b2245
Binary files /dev/null and b/public/icons/docs/qt/16@2x.png differ
diff --git a/public/icons/docs/qt/SOURCE b/public/icons/docs/qt/SOURCE
new file mode 100644
index 00000000..ff6ed43f
--- /dev/null
+++ b/public/icons/docs/qt/SOURCE
@@ -0,0 +1 @@
+https://commons.wikimedia.org/wiki/File:Qt_logo_2016.svg
diff --git a/public/icons/docs/rails/rails.pxm b/public/icons/docs/rails/rails.pxm
new file mode 100644
index 00000000..a205ba83
Binary files /dev/null and b/public/icons/docs/rails/rails.pxm differ
diff --git a/public/icons/docs/sass/sass.pxm b/public/icons/docs/sass/sass.pxm
new file mode 100644
index 00000000..3836861d
Binary files /dev/null and b/public/icons/docs/sass/sass.pxm differ
diff --git a/public/icons/docs/support_tables/16.pxm b/public/icons/docs/support_tables/16.pxm
new file mode 100644
index 00000000..90c40891
Binary files /dev/null and b/public/icons/docs/support_tables/16.pxm differ
diff --git a/public/icons/docs/support_tables/16@2x.pxm b/public/icons/docs/support_tables/16@2x.pxm
new file mode 100644
index 00000000..e7e4f535
Binary files /dev/null and b/public/icons/docs/support_tables/16@2x.pxm differ
diff --git a/public/icons/docs/terraform/16.png b/public/icons/docs/terraform/16.png
new file mode 100644
index 00000000..71f60110
Binary files /dev/null and b/public/icons/docs/terraform/16.png differ
diff --git a/public/icons/docs/terraform/16@2x.png b/public/icons/docs/terraform/16@2x.png
new file mode 100644
index 00000000..42e046bf
Binary files /dev/null and b/public/icons/docs/terraform/16@2x.png differ
diff --git a/public/icons/docs/xpath/XPath.sketch/Data b/public/icons/docs/xpath/XPath.sketch/Data
new file mode 100644
index 00000000..f1b59897
Binary files /dev/null and b/public/icons/docs/xpath/XPath.sketch/Data differ
diff --git a/public/icons/docs/xpath/XPath.sketch/QuickLook/Preview.png b/public/icons/docs/xpath/XPath.sketch/QuickLook/Preview.png
new file mode 100644
index 00000000..623caddb
Binary files /dev/null and b/public/icons/docs/xpath/XPath.sketch/QuickLook/Preview.png differ
diff --git a/public/icons/docs/xpath/XPath.sketch/QuickLook/Thumbnail.png b/public/icons/docs/xpath/XPath.sketch/QuickLook/Thumbnail.png
new file mode 100644
index 00000000..dab52b27
Binary files /dev/null and b/public/icons/docs/xpath/XPath.sketch/QuickLook/Thumbnail.png differ
diff --git a/public/icons/docs/xpath/XPath.sketch/metadata b/public/icons/docs/xpath/XPath.sketch/metadata
new file mode 100644
index 00000000..56e62bc1
--- /dev/null
+++ b/public/icons/docs/xpath/XPath.sketch/metadata
@@ -0,0 +1,18 @@
+
+
+
+
+ app
+ com.bohemiancoding.sketch
+ build
+ 5355
+ commit
+ b7d299b0a34651d1a0e066786b75aa36168d5809
+ fonts
+
+ length
+ 22373
+ version
+ 18
+
+
diff --git a/public/icons/docs/xpath/XPath.sketch/version b/public/icons/docs/xpath/XPath.sketch/version
new file mode 100644
index 00000000..25bf17fc
--- /dev/null
+++ b/public/icons/docs/xpath/XPath.sketch/version
@@ -0,0 +1 @@
+18
\ No newline at end of file
diff --git a/public/images/apple-icon.pxm b/public/images/apple-icon.pxm
new file mode 100644
index 00000000..5526e344
Binary files /dev/null and b/public/images/apple-icon.pxm differ
diff --git a/public/images/fluid-icon.pxm b/public/images/fluid-icon.pxm
new file mode 100644
index 00000000..bf55c2d5
Binary files /dev/null and b/public/images/fluid-icon.pxm differ
diff --git a/public/images/icon.pxm b/public/images/icon.pxm
new file mode 100644
index 00000000..6a0ae734
Binary files /dev/null and b/public/images/icon.pxm differ
diff --git a/public/images/webapp-icon-512.png b/public/images/webapp-icon-512.png
new file mode 100644
index 00000000..1824be8f
Binary files /dev/null and b/public/images/webapp-icon-512.png differ
diff --git a/public/images/webapp-icon-small.pxm b/public/images/webapp-icon-small.pxm
new file mode 100644
index 00000000..46b54fac
Binary files /dev/null and b/public/images/webapp-icon-small.pxm differ
diff --git a/public/manifest.json b/public/manifest.json
index c3ddeca4..1faa5978 100644
--- a/public/manifest.json
+++ b/public/manifest.json
@@ -29,6 +29,11 @@
"src": "/images/webapp-icon-256.png",
"sizes": "256x256",
"type": "image/png"
+ },
+ {
+ "src": "/images/webapp-icon-512.png",
+ "sizes": "512x512",
+ "type": "image/png"
}
]
}
diff --git a/test/app_test.rb b/test/app_test.rb
index 5401e3ae..92a24acd 100644
--- a/test/app_test.rb
+++ b/test/app_test.rb
@@ -11,6 +11,21 @@ class AppTest < MiniTest::Spec
App
end
+ before do
+ current_session.env('HTTPS', 'on')
+ end
+
+ it 'redirects to HTTPS' do
+ get 'http://example.com/test?q=1', {}, 'HTTPS' => 'off'
+ assert last_response.redirect?
+ assert_equal 'https://example.com/test?q=1', last_response['Location']
+ end
+
+ it 'returns HSTS header' do
+ get 'https://example.com/test'
+ assert_equal 'max-age=31536000; includeSubDomains', last_response['Strict-Transport-Security']
+ end
+
describe "/" do
it "works" do
get '/'
@@ -20,13 +35,13 @@ class AppTest < MiniTest::Spec
it "redirects to /#q= when there is a 'q' query param" do
get '/search', q: 'foo'
assert last_response.redirect?
- assert_equal 'http://example.org/#q=foo', last_response['Location']
+ assert_equal 'https://example.org/#q=foo', last_response['Location']
end
it "redirects without the query string" do
get '/', foo: 'bar'
assert last_response.redirect?
- assert_equal 'http://example.org/', last_response['Location']
+ assert_equal 'https://example.org/', last_response['Location']
end
it "sets default size" do
@@ -45,6 +60,18 @@ class AppTest < MiniTest::Spec
get '/'
assert_includes last_response.body, ''
end
+
+ it "sets the theme from cookie" do
+ get '/'
+ assert_match %r{]*class="[^\"]*_theme-default}, last_response.body
+ refute_includes last_response.body, '_theme-dark'
+
+ set_cookie('dark=1')
+
+ get '/'
+ assert_match %r{]*class="[^\"]*_theme-dark}, last_response.body
+ refute_includes last_response.body, '_theme-default'
+ end
end
describe "/[static-page]" do
@@ -52,7 +79,7 @@ class AppTest < MiniTest::Spec
%w(offline about news help).each do |page|
get "/#{page}", {}, 'HTTP_USER_AGENT' => MODERN_BROWSER
assert last_response.redirect?
- assert_equal "http://example.org/#/#{page}", last_response['Location']
+ assert_equal "https://example.org/#/#{page}", last_response['Location']
end
end
@@ -61,7 +88,7 @@ class AppTest < MiniTest::Spec
set_cookie('foo=bar')
get "/#{page}", {}, 'HTTP_USER_AGENT' => MODERN_BROWSER
assert last_response.redirect?
- assert_equal 'http://example.org/', last_response['Location']
+ assert_equal 'https://example.org/', last_response['Location']
assert last_response['Set-Cookie'].start_with?("initial_path=%2F#{page}; path=/; expires=")
end
end
@@ -71,11 +98,11 @@ class AppTest < MiniTest::Spec
it "redirects to /#q=" do
get '/search'
assert last_response.redirect?
- assert_equal 'http://example.org/#q=', last_response['Location']
+ assert_equal 'https://example.org/#q=', last_response['Location']
get '/search', q: 'foo'
assert last_response.redirect?
- assert_equal 'http://example.org/#q=foo', last_response['Location']
+ assert_equal 'https://example.org/#q=foo', last_response['Location']
end
end
@@ -148,7 +175,7 @@ class AppTest < MiniTest::Spec
set_cookie('docs=html~5')
get '/html~5/', {}, 'HTTP_USER_AGENT' => MODERN_BROWSER
assert last_response.redirect?
- assert_equal 'http://example.org/', last_response['Location']
+ assert_equal 'https://example.org/', last_response['Location']
assert last_response['Set-Cookie'].start_with?("initial_path=%2Fhtml%7E5%2F; path=/; expires=")
end
@@ -161,13 +188,13 @@ class AppTest < MiniTest::Spec
set_cookie('docs=html~5')
get '/html/', {}, 'HTTP_USER_AGENT' => MODERN_BROWSER
assert last_response.redirect?
- assert_equal 'http://example.org/', last_response['Location']
+ assert_equal 'https://example.org/', last_response['Location']
assert last_response['Set-Cookie'].start_with?("initial_path=%2Fhtml%2F; path=/; expires=")
end
it "renders when the doc exists and is enabled, and the request is from Googlebot" do
set_cookie('docs=html')
- get '/html/', {}, 'HTTP_USER_AGENT' => 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'
+ get '/html/', {}, 'HTTP_USER_AGENT' => 'Mozilla/5.0 (compatible; Googlebot/2.1; +https://www.google.com/bot.html)'
assert last_response.ok?
end
@@ -187,17 +214,17 @@ class AppTest < MiniTest::Spec
it "redirects with trailing slash" do
get '/html'
assert last_response.redirect?
- assert_equal 'http://example.org/html/', last_response['Location']
+ assert_equal 'https://example.org/html/', last_response['Location']
get '/html', bar: 'baz'
assert last_response.redirect?
- assert_equal 'http://example.org/html/?bar=baz', last_response['Location']
+ assert_equal 'https://example.org/html/?bar=baz', last_response['Location']
end
it "redirects old docs" do
get '/iojs/'
assert last_response.redirect?
- assert_equal 'http://example.org/node/', last_response['Location']
+ assert_equal 'https://example.org/node/', last_response['Location']
end
end
@@ -232,17 +259,17 @@ class AppTest < MiniTest::Spec
it "redirects with trailing slash" do
get '/css-foo'
assert last_response.redirect?
- assert_equal 'http://example.org/css-foo/', last_response['Location']
+ assert_equal 'https://example.org/css-foo/', last_response['Location']
get '/css-foo', bar: 'baz'
assert last_response.redirect?
- assert_equal 'http://example.org/css-foo/?bar=baz', last_response['Location']
+ assert_equal 'https://example.org/css-foo/?bar=baz', last_response['Location']
end
it "redirects old docs" do
get '/yii1-foo/'
assert last_response.redirect?
- assert_equal 'http://example.org/yii~1.1-foo/', last_response['Location']
+ assert_equal 'https://example.org/yii~1.1-foo/', last_response['Location']
end
end
@@ -263,17 +290,17 @@ class AppTest < MiniTest::Spec
it "redirects without trailing slash" do
get '/css/foo/'
assert last_response.redirect?
- assert_equal 'http://example.org/css/foo', last_response['Location']
+ assert_equal 'https://example.org/css/foo', last_response['Location']
get '/css/foo/', bar: 'baz'
assert last_response.redirect?
- assert_equal 'http://example.org/css/foo?bar=baz', last_response['Location']
+ assert_equal 'https://example.org/css/foo?bar=baz', last_response['Location']
end
it "redirects old docs" do
get '/python2/foo'
assert last_response.redirect?
- assert_equal 'http://example.org/python~2.7/foo', last_response['Location']
+ assert_equal 'https://example.org/python~2.7/foo', last_response['Location']
end
end
@@ -281,7 +308,7 @@ class AppTest < MiniTest::Spec
it "returns to the asset path" do
get '/docs.json'
assert last_response.redirect?
- assert_equal 'http://example.org/assets/docs.json', last_response['Location']
+ assert_equal 'https://example.org/assets/docs.json', last_response['Location']
end
end
@@ -289,7 +316,7 @@ class AppTest < MiniTest::Spec
it "returns to the asset path" do
get '/application.js'
assert last_response.redirect?
- assert_equal 'http://example.org/assets/application.js', last_response['Location']
+ assert_equal 'https://example.org/assets/application.js', last_response['Location']
end
end
@@ -297,7 +324,7 @@ class AppTest < MiniTest::Spec
it "returns to the asset path" do
get '/application.css'
assert last_response.redirect?
- assert_equal 'http://example.org/assets/application.css', last_response['Location']
+ assert_equal 'https://example.org/assets/application.css', last_response['Location']
end
end
diff --git a/test/lib/docs/core/scrapers/file_scraper_test.rb b/test/lib/docs/core/scrapers/file_scraper_test.rb
index a017b1dc..7d90d262 100644
--- a/test/lib/docs/core/scrapers/file_scraper_test.rb
+++ b/test/lib/docs/core/scrapers/file_scraper_test.rb
@@ -2,16 +2,23 @@ require 'test_helper'
require 'docs'
class FileScraperTest < MiniTest::Spec
+ ROOT_PATH = File.expand_path('../../../../../../', __FILE__)
+
class Scraper < Docs::FileScraper
- self.dir = '/'
self.html_filters = Docs::FilterStack.new
self.text_filters = Docs::FilterStack.new
+
+ version 'version' do; end
end
let :scraper do
Scraper.new
end
+ let :versioned_scraper do
+ Scraper.versions.first.new
+ end
+
let :response do
OpenStruct.new body: 'body', url: Docs::URL.parse(Scraper.base_url)
end
@@ -22,9 +29,16 @@ class FileScraperTest < MiniTest::Spec
end
end
+ describe "#source_directory" do
+ it "returns the directory at docs/[slug]" do
+ assert_equal File.join(ROOT_PATH, 'docs', 'scraper'), scraper.source_directory
+ assert_equal File.join(ROOT_PATH, 'docs', 'scraper~version'), versioned_scraper.source_directory
+ end
+ end
+
describe "#request_one" do
let :path do
- File.join(Scraper.dir, 'path')
+ 'path'
end
let :result do
@@ -35,20 +49,34 @@ class FileScraperTest < MiniTest::Spec
stub(scraper).read_file
end
- it "reads a file" do
- mock(scraper).read_file(path)
- result
+ context "when the source directory doesn't exist" do
+ it "raises an error" do
+ assert_raises Docs::SetupError do
+ result
+ end
+ end
end
- describe "the returned response object" do
- it "has a #body" do
- stub(scraper).read_file { 'body' }
- assert_equal 'body', result.body
+ context "when the source directory exists" do
+ before do
+ stub(scraper).assert_source_directory_exists
+ end
+
+ it "reads a file" do
+ mock(scraper).read_file(path)
+ result
end
- it "has a #url" do
- assert_equal path, result.url.to_s
- assert_instance_of Docs::URL, result.url
+ describe "the returned response object" do
+ it "has a #body" do
+ stub(scraper).read_file { 'body' }
+ assert_equal 'body', result.body
+ end
+
+ it "has a #url" do
+ assert_equal path, result.url.to_s
+ assert_instance_of Docs::URL, result.url
+ end
end
end
end
@@ -58,49 +86,63 @@ class FileScraperTest < MiniTest::Spec
%w(one two)
end
- it "requests the given url" do
- mock(scraper).request_one('url')
- scraper.send(:request_all, 'url') {}
- end
-
- it "requests the given urls" do
- requests = []
- stub(scraper).request_one { |url| requests << url; nil }
- scraper.send(:request_all, urls) {}
- assert_equal urls, requests
- end
-
- it "yields the responses" do
- responses = []
- stub(scraper).request_one { |url| urls.index(url) }
- scraper.send(:request_all, urls) { |response| responses << response; nil }
- assert_equal (0...urls.length).to_a, responses
+ context "when the source directory doesn't exist" do
+ it "raises an error" do
+ assert_raises Docs::SetupError do
+ scraper.send(:request_all, urls) {}
+ end
+ end
end
- context "when the block returns an array" do
- let :next_urls do
- %w(three four)
+ context "when the source directory exists" do
+ before do
+ stub(scraper).assert_source_directory_exists
end
- let :all_urls do
- urls + %w(three four)
+ it "requests the given url" do
+ mock(scraper).request_one('url')
+ scraper.send(:request_all, 'url') {}
end
- it "requests the returned urls" do
+ it "requests the given urls" do
requests = []
- stub(scraper).request_one { |url| requests << url; url }
- scraper.send(:request_all, urls) { [next_urls.shift].compact }
- assert_equal all_urls, requests
+ stub(scraper).request_one { |url| requests << url; nil }
+ scraper.send(:request_all, urls) {}
+ assert_equal urls, requests
end
- it "yields their responses" do
+ it "yields the responses" do
responses = []
- stub(scraper).request_one { |url| all_urls.index(url) }
- scraper.send :request_all, urls do |response|
- responses << response
- [next_urls.shift].compact
+ stub(scraper).request_one { |url| urls.index(url) }
+ scraper.send(:request_all, urls) { |response| responses << response; nil }
+ assert_equal (0...urls.length).to_a, responses
+ end
+
+ context "when the block returns an array" do
+ let :next_urls do
+ %w(three four)
+ end
+
+ let :all_urls do
+ urls + %w(three four)
+ end
+
+ it "requests the returned urls" do
+ requests = []
+ stub(scraper).request_one { |url| requests << url; url }
+ scraper.send(:request_all, urls) { [next_urls.shift].compact }
+ assert_equal all_urls, requests
+ end
+
+ it "yields their responses" do
+ responses = []
+ stub(scraper).request_one { |url| all_urls.index(url) }
+ scraper.send :request_all, urls do |response|
+ responses << response
+ [next_urls.shift].compact
+ end
+ assert_equal (0...all_urls.length).to_a, responses
end
- assert_equal (0...all_urls.length).to_a, responses
end
end
end
@@ -126,13 +168,13 @@ class FileScraperTest < MiniTest::Spec
scraper.send :read_file, 'file'
end
- it "returns the file's content when the file exists" do
- stub(File).read('file') { 'content' }
+ it "returns the file's content when the file exists in the source directory" do
+ stub(File).read(File.join(ROOT_PATH, 'docs', 'scraper', 'file')) { 'content' }
assert_equal 'content', result
end
it "returns nil when the file doesn't exist" do
- stub(File).read('file') { raise }
+ stub(File).read(File.join(ROOT_PATH, 'docs', 'scraper', 'file')) { raise }
assert_nil result
end
end
diff --git a/views/index.erb b/views/index.erb
index ce743671..022e927f 100644
--- a/views/index.erb
+++ b/views/index.erb
@@ -1,5 +1,5 @@
- prefix="og: http://ogp.me/ns#" lang="en" class="_booting">
+ prefix="og: http://ogp.me/ns#" lang="en" class="_booting _theme-<%= app_theme %>">
@@ -30,7 +30,7 @@
-
+ <%= stylesheet_tag 'application' %>
>
diff --git a/views/other.erb b/views/other.erb
index f8c9eee6..ee9b8de1 100644
--- a/views/other.erb
+++ b/views/other.erb
@@ -1,5 +1,5 @@
-
+
@@ -11,7 +11,7 @@
-
+ <%= stylesheet_tag 'application' %>
data-doc="<%= CGI::escape_html @doc.to_json %>">
diff --git a/views/unsupported.erb b/views/unsupported.erb
index b64ffc3d..a01b7c7e 100644
--- a/views/unsupported.erb
+++ b/views/unsupported.erb
@@ -10,20 +10,17 @@
Your browser is unsupported, sorry.
DevDocs is an API documentation browser which supports the following browsers:
- - Recent versions of Chrome and Firefox
- - Safari 5.1+
- - Opera 12.1+
- - Internet Explorer 10+
- - iOS 6+
- - Android 4.1+
- - Windows Phone 8+
+ - Recent versions of Firefox, Chrome, or Opera
+ - Safari 9.1+
+ - Edge 16+
+ - iOS 10+
- If you're unable to upgrade, I apologize.
- I decided to prioritize speed and new features over support for older browsers.
+ If you're unable to upgrade, we apologize.
+ We decided to prioritize speed and new features over support for older browsers.