Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | [ |
| 2 | 2 | [ "2014-12-21", |
| 3 | − "New <a href=\"/react/\">React</a> and <a href=\"/rethinkdb/\">RethinkDB</a> documentations" | |
| 3 | + "New <a href=\"/react/\">React</a>, <a href=\"/rethinkdb/\">RethinkDB</a> and <a href=\"/socketio/\">Socket.IO</a> documentations" | |
| 4 | 4 | ], [ |
| 5 | 5 | "2014-11-30", |
| 6 | 6 | "New <a href=\"/phpunit/\">PHPUnit</a> and <a href=\"/nokogiri/\">Nokogiri</a> documentations" |
| @@ -293,6 +293,11 @@ credits = [ · 292 unmodified lines | ||
| 293 | 293 | '2010-2014 Christian Johansen', |
| 294 | 294 | 'BSD', |
| 295 | 295 | 'https://raw.githubusercontent.com/cjohansen/Sinon.JS/master/LICENSE' |
| 296 | + ], [ | |
| 297 | + 'Socket.io', | |
| 298 | + '2014 Automattic', | |
| 299 | + 'MIT', | |
| 300 | + 'https://raw.githubusercontent.com/Automattic/socket.io/master/LICENSE' | |
| 296 | 301 | ], [ |
| 297 | 302 | 'Underscore.js', |
| 298 | 303 | '2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors', |
| @@ -0,0 +1,4 @@ | ||
| 1 | +#= require views/pages/base | |
| 2 | +#= require views/pages/requirejs | |
| 3 | + | |
| 4 | +app.views.SocketioPage = app.views.RequirejsPage | |
| @@ -63,6 +63,7 @@ · 62 unmodified lines | ||
| 63 | 63 | 'pages/rethinkdb', |
| 64 | 64 | 'pages/rfc', |
| 65 | 65 | 'pages/sinon', |
| 66 | + 'pages/socketio', | |
| 66 | 67 | 'pages/sphinx', |
| 67 | 68 | 'pages/underscore', |
| 68 | 69 | 'pages/yard', |
| @@ -74,3 +74,4 @@ · 73 unmodified lines | ||
| 74 | 74 | ._icon-nokogiri:before { background-position: -4rem -11rem; } |
| 75 | 75 | ._icon-rethinkdb:before { background-position: 0 -12rem; } |
| 76 | 76 | ._icon-react:before { background-position: -1rem -12rem; } |
| 77 | +._icon-socketio:before { background-position: -2rem -12rem; } | |
| @@ -0,0 +1,24 @@ | ||
| 1 | +._socketio { | |
| 2 | + > h2 { @extend %block-heading; } | |
| 3 | + > h3 { @extend %block-label, %label-blue; } | |
| 4 | + > h2, > h3 { clear: both; } | |
| 5 | + h4 { font-size: 1em; } | |
| 6 | + | |
| 7 | + .ezcol-one-half { | |
| 8 | + margin: .5em 0 1.5em; | |
| 9 | + float: left; | |
| 10 | + width: 50%; | |
| 11 | + padding-right: .5em; | |
| 12 | + @extend %border-box; | |
| 13 | + | |
| 14 | + &.ezcol-last { | |
| 15 | + float: right; | |
| 16 | + padding: 0 0 0 .5em; | |
| 17 | + } | |
| 18 | + | |
| 19 | + > h4 { margin: 0 0 1em; } | |
| 20 | + > pre { margin: 1em 0 0; } | |
| 21 | + } | |
| 22 | + | |
| 23 | + code { @extend %label; } | |
| 24 | +} | |
| @@ -0,0 +1,25 @@ | ||
| 1 | +module Docs | |
| 2 | + class Socketio | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + @doc = at_css('.entry-content') | |
| 6 | + | |
| 7 | + css('p > br').each do |node| | |
| 8 | + node.remove unless node.next.content =~ /\s*\-/ | |
| 9 | + end | |
| 10 | + | |
| 11 | + css('h1, h2, h3').each do |node| | |
| 12 | + next if node == doc.first_element_child | |
| 13 | + node.name = node.name.sub(/\d/) { |i| i.to_i + 1 } | |
| 14 | + node['id'] = node.content.strip.parameterize | |
| 15 | + end | |
| 16 | + | |
| 17 | + css('pre').each do |node| | |
| 18 | + node.content = node.content | |
| 19 | + end | |
| 20 | + | |
| 21 | + doc | |
| 22 | + end | |
| 23 | + end | |
| 24 | + end | |
| 25 | +end | |
| @@ -0,0 +1,27 @@ | ||
| 1 | +module Docs | |
| 2 | + class Socketio | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + at_css('h1').content | |
| 6 | + end | |
| 7 | + | |
| 8 | + def get_type | |
| 9 | + 'Guides' | |
| 10 | + end | |
| 11 | + | |
| 12 | + def additional_entries | |
| 13 | + return [] unless slug.end_with?('api') | |
| 14 | + | |
| 15 | + css('h3').each_with_object([]) do |node, entries| | |
| 16 | + name = node.content | |
| 17 | + name.remove! %r{\(.*} | |
| 18 | + name.remove! %r{\:.*} | |
| 19 | + | |
| 20 | + unless entries.any? { |entry| entry[0] == name } | |
| 21 | + entries << [name, node['id'], self.name.remove(' API')] | |
| 22 | + end | |
| 23 | + end | |
| 24 | + end | |
| 25 | + end | |
| 26 | + end | |
| 27 | +end | |
| @@ -0,0 +1,20 @@ | ||
| 1 | +module Docs | |
| 2 | + class Socketio < UrlScraper | |
| 3 | + self.name = 'Socket.IO' | |
| 4 | + self.slug = 'socketio' | |
| 5 | + self.type = 'socketio' | |
| 6 | + self.version = '1.2.1' | |
| 7 | + self.base_url = 'http://socket.io/docs/' | |
| 8 | + | |
| 9 | + html_filters.push 'socketio/clean_html', 'socketio/entries' | |
| 10 | + | |
| 11 | + options[:container] = '#content' | |
| 12 | + options[:trailing_slash] = false | |
| 13 | + options[:skip] = %w(faq) | |
| 14 | + | |
| 15 | + options[:attribution] = <<-HTML | |
| 16 | + © 2014 Automattic<br> | |
| 17 | + Licensed under the MIT License. | |
| 18 | + HTML | |
| 19 | + end | |
| 20 | +end | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +http://socket.io/ | |