[devdocsgjs/main: 52/64] kubernetes: improve
- From: Andy Holmes <andyholmes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devdocsgjs/main: 52/64] kubernetes: improve
- Date: Fri, 6 May 2022 23:47:33 +0000 (UTC)
commit bcbf31e71595b12c16587344ec61552ef8d11d33
Author: Simon Legner <Simon Legner gmail com>
Date: Tue May 3 20:40:44 2022 +0200
kubernetes: improve
lib/docs/filters/kubernetes/clean_html.rb | 4 ++++
lib/docs/filters/kubernetes/entries.rb | 4 +++-
lib/docs/scrapers/kubernetes.rb | 11 +----------
3 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/lib/docs/filters/kubernetes/clean_html.rb b/lib/docs/filters/kubernetes/clean_html.rb
index 3f38ae78..33adb7ae 100644
--- a/lib/docs/filters/kubernetes/clean_html.rb
+++ b/lib/docs/filters/kubernetes/clean_html.rb
@@ -9,6 +9,10 @@ module Docs
# and all the preceding elements
css('#Operations ~ *').remove
css('#Operations').remove
+ # remove horizontal rules
+ css('hr').remove
+ # remove footer (1.20)
+ css('.pre-footer').remove
doc
end
diff --git a/lib/docs/filters/kubernetes/entries.rb b/lib/docs/filters/kubernetes/entries.rb
index 85e240a9..5dfc0f3d 100644
--- a/lib/docs/filters/kubernetes/entries.rb
+++ b/lib/docs/filters/kubernetes/entries.rb
@@ -7,11 +7,13 @@ module Docs
end
def get_type
- name
+ @doc.parent.css('nav .breadcrumb-item:not(.active)')[-1].content
end
def additional_entries
entries = css('h2').to_a()
+ # remove the Feedback section
+ entries.filter! {|node| node.content.strip != 'Feedback' }
# remove the Operations section
entries.filter! {|node| node['id'] != 'Operations' }
# remove the ObjectList section
diff --git a/lib/docs/scrapers/kubernetes.rb b/lib/docs/scrapers/kubernetes.rb
index eb910846..a9c24eee 100644
--- a/lib/docs/scrapers/kubernetes.rb
+++ b/lib/docs/scrapers/kubernetes.rb
@@ -7,12 +7,10 @@ module Docs
home: 'https://kubernetes.io/',
code: 'https://github.com/kubernetes/kubernetes'
}
- self.release = "1.23"
# https://kubernetes.io/docs/reference/kubernetes-api/
html_filters.push 'kubernetes/entries', 'kubernetes/clean_html'
- # options[:max_image_size] = 300_000
options[:container] = '.td-content'
options[:attribution] = <<-HTML
@@ -28,14 +26,7 @@ module Docs
version '1.20' do
self.release = "#{version}"
- verStr = version.sub('.', '-')
- self.base_url = "https://v#{verStr}.docs.kubernetes.io/docs/reference/kubernetes-api/"
- end
-
- version '1.19' do
- self.release = "#{version}"
- verStr = version.sub('.', '-')
- self.base_url = "https://v#{verStr}.docs.kubernetes.io/docs/reference/kubernetes-api/"
+ self.base_url = "https://v#{version.sub('.', '-')}.docs.kubernetes.io/docs/reference/kubernetes-api/"
end
def get_latest_version(opts)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]