[devdocsgjs/main: 620/1867] Cleanup redundant bits
- From: Andy Holmes <andyholmes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devdocsgjs/main: 620/1867] Cleanup redundant bits
- Date: Fri, 19 Nov 2021 23:47:19 +0000 (UTC)
commit 6c12d53a465e47da1ab7e6325862eef4f7c666af
Author: Emil Maruszczak <emilekm gmail com>
Date: Thu May 2 17:25:34 2019 +0200
Cleanup redundant bits
assets/stylesheets/pages/_mkdocs.scss | 6 +-----
lib/docs/filters/mkdocs/clean_html.rb | 1 -
lib/docs/filters/rest_framework/clean_html.rb | 13 +++----------
3 files changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/assets/stylesheets/pages/_mkdocs.scss b/assets/stylesheets/pages/_mkdocs.scss
index e70ff66c..e374474c 100644
--- a/assets/stylesheets/pages/_mkdocs.scss
+++ b/assets/stylesheets/pages/_mkdocs.scss
@@ -1,4 +1,4 @@
-%mkdocs {
+._mkdocs {
h2 { @extend %block-heading; }
h3 { @extend %block-label, %label-blue; }
h4 { @extend %block-label; }
@@ -9,7 +9,3 @@
p > code, li > code { @extend %label; }
}
-
-._mkdocs {
- @extend %mkdocs;
-}
diff --git a/lib/docs/filters/mkdocs/clean_html.rb b/lib/docs/filters/mkdocs/clean_html.rb
index c346d23e..2eef9cdc 100644
--- a/lib/docs/filters/mkdocs/clean_html.rb
+++ b/lib/docs/filters/mkdocs/clean_html.rb
@@ -4,7 +4,6 @@ module Docs
def call
css('.toclink').each do |node|
node.parent.content = node.content
- node.remove
end
css('pre').each do |node|
diff --git a/lib/docs/filters/rest_framework/clean_html.rb b/lib/docs/filters/rest_framework/clean_html.rb
index 007b33b2..87d048b9 100644
--- a/lib/docs/filters/rest_framework/clean_html.rb
+++ b/lib/docs/filters/rest_framework/clean_html.rb
@@ -4,17 +4,11 @@ module Docs
def call
css('hr').remove
- css('.badges').each do |node|
- node.remove
- end
+ css('.badges').remove
- css('pre').each do |node|
- node['data-language'] = 'python'
- end
+ css('pre').attr('data-language', 'python')
- css('h1').each do |node|
- node['style'] = nil
- end
+ css('h1').attr('style', nil)
# Translate source files links to DevDocs links
links = Nokogiri::XML::Node.new('p', doc)
@@ -23,7 +17,6 @@ module Docs
css('a.github').each do |node|
span = node.at_css('span')
node.content = span.content
- span.remove
node['class'] = '_links-link'
links.add_child(node)
end
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]