From d98cd6effaa43646698c6190d9d519da031d1040 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Tue, 20 Sep 2022 23:24:00 +0200 Subject: [PATCH] Update Socket.IO documentation (4.5.2) --- assets/stylesheets/application.css.scss | 1 - assets/stylesheets/pages/_socketio.scss | 24 ------------------------ lib/docs/filters/socketio/clean_html.rb | 22 +++++++++++++--------- lib/docs/scrapers/socketio.rb | 8 ++++---- 4 files changed, 17 insertions(+), 38 deletions(-) delete mode 100644 assets/stylesheets/pages/_socketio.scss diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index 66569d69..8a6221b6 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -115,7 +115,6 @@ 'pages/sanctuary', 'pages/scala', 'pages/sinon', - 'pages/socketio', 'pages/sphinx', 'pages/sphinx_simple', 'pages/sqlite', diff --git a/assets/stylesheets/pages/_socketio.scss b/assets/stylesheets/pages/_socketio.scss deleted file mode 100644 index 633dcbb2..00000000 --- a/assets/stylesheets/pages/_socketio.scss +++ /dev/null @@ -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; } -} diff --git a/lib/docs/filters/socketio/clean_html.rb b/lib/docs/filters/socketio/clean_html.rb index ec7da521..bd74a9a6 100644 --- a/lib/docs/filters/socketio/clean_html.rb +++ b/lib/docs/filters/socketio/clean_html.rb @@ -2,26 +2,30 @@ module Docs class Socketio class CleanHtmlFilter < Filter def call - @doc = at_css('article') + @doc = at_css('article .theme-doc-markdown') css('p > br').each do |node| node.remove unless node.next.content =~ /\s*\-/ end - # version documentation message - css('.warning').remove + css('header h1').each do |node| + 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| - if node.at_css('.line').nil? - node.content = node.content - else - node.content = node.css('.line').map(&:content).join("\n") - end + node.content = node.css('.token-line').map(&:content).join("\n") + node.remove_attribute('style') node['data-language'] = node.content =~ /\A\s*