Closes #513.
Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -1,5 +1,8 @@ | ||
| 1 | 1 | [ |
| 2 | 2 | [ |
| 3 | + "2016-11-20", | |
| 4 | + "New documentation: <a href=\"/immutable/\">Immutable.js</a>" | |
| 5 | + ], [ | |
| 3 | 6 | "2016-10-10", |
| 4 | 7 | "New documentations: <a href=\"/scikit_learn/\">scikit-learn</a> and <a href=\"/statsmodels/\">Statsmodels</a>" |
| 5 | 8 | ], [ |
| @@ -254,6 +254,11 @@ credits = [ · 253 unmodified lines | ||
| 254 | 254 | '2005-2016 Haxe Foundation', |
| 255 | 255 | 'MIT', |
| 256 | 256 | 'http://haxe.org/foundation/open-source.html' |
| 257 | + ], [ | |
| 258 | + 'Immutable.js', | |
| 259 | + '2014-2016 Facebook, Inc.', | |
| 260 | + 'BSD', | |
| 261 | + 'https://raw.githubusercontent.com/facebook/immutable-js/master/LICENSE' | |
| 257 | 262 | ], [ |
| 258 | 263 | 'InfluxData', |
| 259 | 264 | '2015 InfluxData, Inc.', |
| @@ -22,6 +22,7 @@ app.views.ElixirPage = · 21 unmodified lines | ||
| 22 | 22 | app.views.EmberPage = |
| 23 | 23 | app.views.ExpressPage = |
| 24 | 24 | app.views.GoPage = |
| 25 | +app.views.ImmutablePage = | |
| 25 | 26 | app.views.InfluxdataPage = |
| 26 | 27 | app.views.KnockoutPage = |
| 27 | 28 | app.views.KotlinPage = |
| @@ -72,6 +72,7 @@ · 71 unmodified lines | ||
| 72 | 72 | ._icon-angularjs:before { background-position: -9rem -1rem; } |
| 73 | 73 | ._icon-coffeescript:before { background-position: 0 -2rem; @extend %darkIconFix !optional; } |
| 74 | 74 | ._icon-ember:before { background-position: -1rem -2rem; } |
| 75 | +._icon-immutable:before { background-position: -3rem -2rem; @extend %darkIconFix !optional; } | |
| 75 | 76 | ._icon-jqueryui:before { background-position: -4rem -2rem; } |
| 76 | 77 | ._icon-jquerymobile:before { background-position: -5rem -2rem; } |
| 77 | 78 | ._icon-lodash:before { background-position: -6rem -2rem; } |
| @@ -25,6 +25,7 @@ · 24 unmodified lines | ||
| 25 | 25 | ._gnu, |
| 26 | 26 | ._grunt, |
| 27 | 27 | ._haxe, |
| 28 | +._immutable, | |
| 28 | 29 | ._influxdata, |
| 29 | 30 | ._less, |
| 30 | 31 | ._lodash, |
| @@ -0,0 +1,48 @@ | ||
| 1 | +module Docs | |
| 2 | + class Immutable | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + css('section', 'span', 'div[data-reactid]').each do |node| | |
| 6 | + node.before(node.children).remove | |
| 7 | + end | |
| 8 | + | |
| 9 | + css('.codeBlock').each do |node| | |
| 10 | + node.name = 'pre' | |
| 11 | + node.content = node.content | |
| 12 | + node['data-language'] = 'js' | |
| 13 | + end | |
| 14 | + | |
| 15 | + css('*[data-reactid]').remove_attr('data-reactid') | |
| 16 | + css('a[target]').remove_attr('target') | |
| 17 | + | |
| 18 | + css('a[href^="#"]').each do |node| | |
| 19 | + node['href'] = node['href'].sub(/\A#\//, '#').gsub('/', '.').downcase | |
| 20 | + end | |
| 21 | + | |
| 22 | + type = type_id = nil | |
| 23 | + css('*').each do |node| | |
| 24 | + if node.name == 'h1' | |
| 25 | + node['id'] = type_id = node.content.strip.downcase | |
| 26 | + type = node.content.strip | |
| 27 | + elsif node.name == 'h3' | |
| 28 | + node['id'] = node.content.strip.downcase | |
| 29 | + node['id'] = node['id'].remove('()') unless node['id'] == "#{type_id}()" | |
| 30 | + | |
| 31 | + unless node['id'].start_with?(type_id) | |
| 32 | + node.content = "#{type}##{node.content}" | |
| 33 | + node['id'] = "#{type_id}.#{node['id']}" unless node['id'].start_with?("#{type_id}.") | |
| 34 | + end | |
| 35 | + end | |
| 36 | + end | |
| 37 | + | |
| 38 | + css('h4.groupTitle').each do |node| | |
| 39 | + node.name = 'h2' | |
| 40 | + end | |
| 41 | + | |
| 42 | + css('*[class]').remove_attr('class') | |
| 43 | + | |
| 44 | + doc | |
| 45 | + end | |
| 46 | + end | |
| 47 | + end | |
| 48 | +end | |
| @@ -0,0 +1,23 @@ | ||
| 1 | +module Docs | |
| 2 | + class Immutable | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + def additional_entries | |
| 5 | + entries = [] | |
| 6 | + type = nil | |
| 7 | + | |
| 8 | + css('*').each do |node| | |
| 9 | + if node.name == 'h1' | |
| 10 | + name = node.content | |
| 11 | + type = node.content.split('.').first | |
| 12 | + entries << [name, node['id'], type] | |
| 13 | + elsif node.name == 'h3' | |
| 14 | + name = node.content | |
| 15 | + entries << [name, node['id'], type] | |
| 16 | + end | |
| 17 | + end | |
| 18 | + | |
| 19 | + entries | |
| 20 | + end | |
| 21 | + end | |
| 22 | + end | |
| 23 | +end | |
| @@ -0,0 +1,58 @@ | ||
| 1 | +module Docs | |
| 2 | + class Immutable < UrlScraper | |
| 3 | + self.name = 'Immutable.js' | |
| 4 | + self.slug = 'immutable' | |
| 5 | + self.type = 'immutable' | |
| 6 | + self.release = '3.8.1' | |
| 7 | + self.base_url = 'https://facebook.github.io/immutable-js/docs/' | |
| 8 | + self.links = { | |
| 9 | + home: 'https://facebook.github.io/immutable-js/', | |
| 10 | + code: 'https://github.com/facebook/immutable-js' | |
| 11 | + } | |
| 12 | + | |
| 13 | + html_filters.push 'immutable/clean_html', 'immutable/entries', 'title' | |
| 14 | + | |
| 15 | + options[:skip_links] = true | |
| 16 | + options[:container] = '.docContents' | |
| 17 | + options[:root_title] = 'Immutable.js' | |
| 18 | + | |
| 19 | + options[:attribution] = <<-HTML | |
| 20 | + © 2014–2015 Facebook, Inc.<br> | |
| 21 | + Licensed under the 3-clause BSD License. | |
| 22 | + HTML | |
| 23 | + | |
| 24 | + stub '' do | |
| 25 | + capybara = load_capybara_selenium | |
| 26 | + capybara.app_host = 'https://facebook.github.io' | |
| 27 | + capybara.visit(URL.parse(self.base_url).path) | |
| 28 | + capybara.execute_script <<-JS | |
| 29 | + var content, event, links, link; | |
| 30 | + | |
| 31 | + event = document.createEvent('Event'); | |
| 32 | + event.initEvent('hashchange', false, false); | |
| 33 | + | |
| 34 | + content = document.querySelector('.docContents section').cloneNode(true); | |
| 35 | + links = Array.prototype.slice.call(document.querySelectorAll('.sideBar .scrollContent a')); | |
| 36 | + | |
| 37 | + while (link = links.shift()) { | |
| 38 | + if (!document.body.contains(link)) { | |
| 39 | + document.body.appendChild(link); | |
| 40 | + } | |
| 41 | + | |
| 42 | + link.click(); | |
| 43 | + dispatchEvent(event); | |
| 44 | + content.innerHTML += document.querySelector('.docContents').innerHTML; | |
| 45 | + | |
| 46 | + document.querySelectorAll('.sideBar .scrollContent .groupTitle').forEach(function(el) { | |
| 47 | + if (el.textContent == 'Types') { | |
| 48 | + Array.prototype.unshift.apply(links, Array.prototype.slice.call(el.parentNode.querySelectorAll('a'))); | |
| 49 | + } | |
| 50 | + }); | |
| 51 | + } | |
| 52 | + | |
| 53 | + document.querySelector('.docContents').innerHTML = content.innerHTML; | |
| 54 | + JS | |
| 55 | + capybara.html | |
| 56 | + end | |
| 57 | + end | |
| 58 | +end | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://raw.githubusercontent.com/facebook/immutable-js/master/pages/src/static/favicon.png | |