Update Socket.IO documentation (4.5.2)

pull/1824/head
Simon Legner 2 years ago
parent 06c37d52d7
commit d98cd6effa

@ -115,7 +115,6 @@
'pages/sanctuary', 'pages/sanctuary',
'pages/scala', 'pages/scala',
'pages/sinon', 'pages/sinon',
'pages/socketio',
'pages/sphinx', 'pages/sphinx',
'pages/sphinx_simple', 'pages/sphinx_simple',
'pages/sqlite', 'pages/sqlite',

@ -1,24 +0,0 @@
._socketio {
> h2 { @extend %block-heading; }
> h3 { @extend %block-label, %label-blue; }
> h2, > h3 { clear: both; }
h4 { font-size: 1em; }
.ezcol-one-half {
margin: .5em 0 1.5em;
float: left;
width: 50%;
padding-right: .5em;
@extend %border-box;
&.ezcol-last {
float: right;
padding: 0 0 0 .5em;
}
> h4 { margin: 0 0 1em; }
> pre { margin: 1em 0 0; }
}
code { @extend %label; }
}

@ -2,26 +2,30 @@ module Docs
class Socketio class Socketio
class CleanHtmlFilter < Filter class CleanHtmlFilter < Filter
def call def call
@doc = at_css('article') @doc = at_css('article .theme-doc-markdown')
css('p > br').each do |node| css('p > br').each do |node|
node.remove unless node.next.content =~ /\s*\-/ node.remove unless node.next.content =~ /\s*\-/
end end
# version documentation message css('header h1').each do |node|
css('.warning').remove node.parent.replace(node)
end
css('footer', 'aside').remove
css('header', 'footer', 'aside').remove css('.theme-doc-version-badge', '.theme-doc-toc-mobile', '.admonition-heading', '.hash-link').remove
css('pre').each do |node| css('pre').each do |node|
if node.at_css('.line').nil? node.content = node.css('.token-line').map(&:content).join("\n")
node.content = node.content node.remove_attribute('style')
else
node.content = node.css('.line').map(&:content).join("\n")
end
node['data-language'] = node.content =~ /\A\s*</ ? 'html' : 'javascript' node['data-language'] = node.content =~ /\A\s*</ ? 'html' : 'javascript'
node.ancestors('.theme-code-block').first.replace(node)
end end
css('.themedImage--dark_oUvU').remove
css('*[class]').remove_attribute('class')
doc doc
end end
end end

@ -2,13 +2,13 @@ module Docs
class Socketio < UrlScraper class Socketio < UrlScraper
self.name = 'Socket.IO' self.name = 'Socket.IO'
self.slug = 'socketio' self.slug = 'socketio'
self.type = 'socketio' self.type = 'sphinx'
self.links = { self.links = {
home: 'http://socket.io/', home: 'https://socket.io/',
code: 'https://github.com/socketio/socket.io' code: 'https://github.com/socketio/socket.io'
} }
html_filters.push 'socketio/clean_html', 'socketio/entries' html_filters.push 'socketio/clean_html', 'socketio/entries', 'sphinx/clean_html'
options[:trailing_slash] = false options[:trailing_slash] = false
options[:skip] = %w(/faq /glossary) options[:skip] = %w(/faq /glossary)
@ -19,7 +19,7 @@ module Docs
HTML HTML
version '4' do version '4' do
self.release = '4.1.2' self.release = '4.5.2'
self.base_url = "https://socket.io/docs/v#{version}" self.base_url = "https://socket.io/docs/v#{version}"
end end

Loading…
Cancel
Save