History

Update Socket.IO documentation (4.5.2)

Simon Legner committed 4 years ago

Commit d98cd6e1 parent 06c37d54 files · +17 −38Browse files

Unified · Split

4 files
  1. assets/stylesheets/application.css.scss +0 −1
  2. assets/stylesheets/pages/_socketio.scss +0 −24
  3. lib/docs/filters/socketio/clean_html.rb +13 −9
  4. lib/docs/scrapers/socketio.rb +4 −4
assets/stylesheets/application.css.scss+0−1
@@ -115,7 +115,6 @@ · 114 unmodified lines
115115 'pages/sanctuary',
116116 'pages/scala',
117117 'pages/sinon',
118− 'pages/socketio',
119118 'pages/sphinx',
120119 'pages/sphinx_simple',
121120 'pages/sqlite',
assets/stylesheets/pages/_socketio.scss+0−24
@@ -1,24 +0,0 @@
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−}
lib/docs/filters/socketio/clean_html.rb+13−9
@@ -2,26 +2,30 @@ module Docs · 1 unmodified line
22 class Socketio
33 class CleanHtmlFilter < Filter
44 def call
5− @doc = at_css('article')
5+ @doc = at_css('article .theme-doc-markdown')
66
77 css('p > br').each do |node|
88 node.remove unless node.next.content =~ /\s*\-/
99 end
1010
11− # version documentation message
12− css('.warning').remove
11+ css('header h1').each do |node|
12+ node.parent.replace(node)
13+ end
14+ css('footer', 'aside').remove
1315
14− css('header', 'footer', 'aside').remove
16+ css('.theme-doc-version-badge', '.theme-doc-toc-mobile', '.admonition-heading', '.hash-link').remove
1517
1618 css('pre').each do |node|
17− if node.at_css('.line').nil?
18− node.content = node.content
19− else
20− node.content = node.css('.line').map(&:content).join("\n")
21− end
19+ node.content = node.css('.token-line').map(&:content).join("\n")
20+ node.remove_attribute('style')
2221 node['data-language'] = node.content =~ /\A\s*</ ? 'html' : 'javascript'
22+ node.ancestors('.theme-code-block').first.replace(node)
2323 end
2424
25+ css('.themedImage--dark_oUvU').remove
26+
27+ css('*[class]').remove_attribute('class')
28+
2529 doc
2630 end
2731 end
lib/docs/scrapers/socketio.rb+4−4
@@ -2,13 +2,13 @@ module Docs · 1 unmodified line
22 class Socketio < UrlScraper
33 self.name = 'Socket.IO'
44 self.slug = 'socketio'
5− self.type = 'socketio'
5+ self.type = 'sphinx'
66 self.links = {
7− home: 'http://socket.io/',
7+ home: 'https://socket.io/',
88 code: 'https://github.com/socketio/socket.io'
99 }
1010
11− html_filters.push 'socketio/clean_html', 'socketio/entries'
11+ html_filters.push 'socketio/clean_html', 'socketio/entries', 'sphinx/clean_html'
1212
1313 options[:trailing_slash] = false
1414 options[:skip] = %w(/faq /glossary)
@@ -19,7 +19,7 @@ module Docs · 4 unmodified lines
1919 HTML
2020
2121 version '4' do
22− self.release = '4.1.2'
22+ self.release = '4.5.2'
2323 self.base_url = "https://socket.io/docs/v#{version}"
2424 end
2525