Unified · Split
| @@ -482,6 +482,11 @@ credits = [ · 481 unmodified lines | ||
| 482 | 482 | '2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors', |
| 483 | 483 | 'Apache', |
| 484 | 484 | 'https://raw.githubusercontent.com/JetBrains/kotlin/master/license/LICENSE.txt' |
| 485 | + ], [ | |
| 486 | + 'Kubernetes', | |
| 487 | + '2022 The Kubernetes Authors and The Linux Foundation', | |
| 488 | + 'Apache License 2.0', | |
| 489 | + 'https://github.com/kubernetes/kubernetes/blob/master/LICENSE' | |
| 485 | 490 | ], [ |
| 486 | 491 | 'Laravel', |
| 487 | 492 | 'Taylor Otwell', |
| @@ -74,6 +74,7 @@ · 73 unmodified lines | ||
| 74 | 74 | 'pages/julia', |
| 75 | 75 | 'pages/knockout', |
| 76 | 76 | 'pages/kotlin', |
| 77 | + 'pages/kubernetes', | |
| 77 | 78 | 'pages/laravel', |
| 78 | 79 | 'pages/liquid', |
| 79 | 80 | 'pages/love', |
| @@ -0,0 +1,4 @@ | ||
| 1 | +._kubernetes { | |
| 2 | + @extend %simple; | |
| 3 | + | |
| 4 | +} | |
| @@ -0,0 +1,18 @@ | ||
| 1 | +module Docs | |
| 2 | + class Kubernetes | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + | |
| 5 | + def call | |
| 6 | + | |
| 7 | + # remove the API Operations section from the docs | |
| 8 | + # by removing the h2 of id=Opetations | |
| 9 | + # and all the preceding elements | |
| 10 | + css('#Operations ~ *').remove | |
| 11 | + css('#Operations').remove | |
| 12 | + | |
| 13 | + doc | |
| 14 | + end | |
| 15 | + | |
| 16 | + end | |
| 17 | + end | |
| 18 | +end | |
| @@ -0,0 +1,35 @@ | ||
| 1 | +module Docs | |
| 2 | + class Kubernetes | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + | |
| 5 | + def get_name | |
| 6 | + at_css('h1').content | |
| 7 | + end | |
| 8 | + | |
| 9 | + def get_type | |
| 10 | + name | |
| 11 | + end | |
| 12 | + | |
| 13 | + def additional_entries | |
| 14 | + entries = css('h2').to_a() | |
| 15 | + # remove the Operations section | |
| 16 | + entries.filter! {|node| node['id'] != 'Operations' } | |
| 17 | + # remove the ObjectList section | |
| 18 | + entries.filter! {|node| node['id'] != name + 'List' } | |
| 19 | + # remove the Object section, most of the documents start with (h1.Pod => h2.Pod h2.PodSpec ...) | |
| 20 | + entries.filter! {|node| node['id'] != name } | |
| 21 | + | |
| 22 | + entries.map do |node| | |
| 23 | + # split all names into YAML object notation (ConfigMapSpec) ==> (ConfigMap.Spec) | |
| 24 | + child_name = node.content | |
| 25 | + if child_name.starts_with?(name) && child_name.length > name.length | |
| 26 | + child_name = name + child_name.sub(name, '.') | |
| 27 | + end | |
| 28 | + | |
| 29 | + [child_name, node['id']] | |
| 30 | + end | |
| 31 | + end | |
| 32 | + | |
| 33 | + end | |
| 34 | + end | |
| 35 | +end | |
| @@ -0,0 +1,46 @@ | ||
| 1 | +module Docs | |
| 2 | + class Kubernetes < UrlScraper | |
| 3 | + self.name = 'Kubernetes' | |
| 4 | + self.type = 'kubernetes' | |
| 5 | + self.root_path = '/' | |
| 6 | + self.links = { | |
| 7 | + home: 'https://kubernetes.io/', | |
| 8 | + code: 'https://github.com/kubernetes/kubernetes' | |
| 9 | + } | |
| 10 | + self.release = "1.23" | |
| 11 | + | |
| 12 | + # https://kubernetes.io/docs/reference/kubernetes-api/ | |
| 13 | + html_filters.push 'kubernetes/entries', 'kubernetes/clean_html' | |
| 14 | + | |
| 15 | + # options[:max_image_size] = 300_000 | |
| 16 | + options[:container] = '.td-content' | |
| 17 | + | |
| 18 | + options[:attribution] = <<-HTML | |
| 19 | + © 2022 The Kubernetes Authors | Documentation Distributed under CC BY 4.0 <br> | |
| 20 | + Copyright © 2022 The Linux Foundation ®. All rights reserved. | |
| 21 | + HTML | |
| 22 | + | |
| 23 | + # latest version has a special URL that does not include the version identifier | |
| 24 | + version '1.23' do | |
| 25 | + self.release = "#{version}" | |
| 26 | + self.base_url = "https://kubernetes.io/docs/reference/kubernetes-api/" | |
| 27 | + end | |
| 28 | + | |
| 29 | + version '1.20' do | |
| 30 | + self.release = "#{version}" | |
| 31 | + verStr = version.sub('.', '-') | |
| 32 | + self.base_url = "https://v#{verStr}.docs.kubernetes.io/docs/reference/kubernetes-api/" | |
| 33 | + end | |
| 34 | + | |
| 35 | + version '1.19' do | |
| 36 | + self.release = "#{version}" | |
| 37 | + verStr = version.sub('.', '-') | |
| 38 | + self.base_url = "https://v#{verStr}.docs.kubernetes.io/docs/reference/kubernetes-api/" | |
| 39 | + end | |
| 40 | + | |
| 41 | + def get_latest_version(opts) | |
| 42 | + get_latest_github_release('kubernetes', 'kubernetes', opts) | |
| 43 | + end | |
| 44 | + | |
| 45 | + end | |
| 46 | +end | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://cncf-branding.netlify.app/projects/kubernetes/ | |