diff --git a/lib/docs/filters/socketio/clean_html.rb b/lib/docs/filters/socketio/clean_html.rb
index bbe404f7..98f8d164 100644
--- a/lib/docs/filters/socketio/clean_html.rb
+++ b/lib/docs/filters/socketio/clean_html.rb
@@ -2,17 +2,19 @@ module Docs
class Socketio
class CleanHtmlFilter < Filter
def call
- @doc = at_css('.entry-content')
css('p > br').each do |node|
node.remove unless node.next.content =~ /\s*\-/
end
- css('h1, h2, h3').each do |node|
- next if node == doc.first_element_child
- node.name = node.name.sub(/\d/) { |i| i.to_i + 1 }
- node['id'] = node.content.strip.parameterize
- end
+ # version documentation message
+ css('.warning').remove
+
+ css('header').remove
+
+ css('aside').remove
+
+ css('footer').remove
css('pre').each do |node|
node.content = node.content
diff --git a/lib/docs/filters/socketio/entries.rb b/lib/docs/filters/socketio/entries.rb
index 656931a2..ee76d4dd 100644
--- a/lib/docs/filters/socketio/entries.rb
+++ b/lib/docs/filters/socketio/entries.rb
@@ -6,7 +6,11 @@ module Docs
end
def get_type
- 'Guides'
+ if slug =~ /events|room|emit/ && version.eql?('3')
+ 'Events'
+ else
+ 'Guides'
+ end
end
def additional_entries
diff --git a/lib/docs/scrapers/socketio.rb b/lib/docs/scrapers/socketio.rb
index e9bc264a..f3fc8fee 100644
--- a/lib/docs/scrapers/socketio.rb
+++ b/lib/docs/scrapers/socketio.rb
@@ -3,8 +3,6 @@ module Docs
self.name = 'Socket.IO'
self.slug = 'socketio'
self.type = 'socketio'
- self.release = '1.4.5'
- self.base_url = 'http://socket.io/docs/'
self.links = {
home: 'http://socket.io/',
code: 'https://github.com/socketio/socket.io'
@@ -12,17 +10,27 @@ module Docs
html_filters.push 'socketio/clean_html', 'socketio/entries'
- options[:container] = '#content'
options[:trailing_slash] = false
- options[:skip] = %w(faq)
+ options[:skip] = %w(/faq /glossary)
options[:attribution] = <<-HTML
- © 2014–2015 Automattic
+ © 2014–2020 Automattic
Licensed under the MIT License.
HTML
+ version '3' do
+ self.release = '3.0.5'
+ self.base_url = "https://socket.io/docs/v#{version}"
+ end
+
+ version '2' do
+ self.release = '2.4.0'
+ self.base_url = "https://socket.io/docs/v#{version}"
+ end
+
def get_latest_version(opts)
get_npm_version('socket.io', opts)
end
+
end
end