├── website ├── themes │ └── zzodoc │ │ ├── layouts │ │ ├── robots.txt │ │ ├── partials │ │ │ ├── header │ │ │ │ ├── custom-header.html │ │ │ │ ├── taxo-header.html │ │ │ │ ├── blog-header.html │ │ │ │ ├── site-header.html │ │ │ │ ├── blog-header-text.html │ │ │ │ └── blog-header-img.html │ │ │ ├── head │ │ │ │ ├── services.html │ │ │ │ ├── styles.html │ │ │ │ └── meta_json_ld.html │ │ │ ├── comments │ │ │ │ ├── commento.html │ │ │ │ ├── isso.html │ │ │ │ ├── livere.html │ │ │ │ ├── gitalk.html │ │ │ │ ├── disqus.html │ │ │ │ ├── comments.html │ │ │ │ ├── valine.html │ │ │ │ ├── gitment.html │ │ │ │ ├── changyan.html │ │ │ │ └── utterances.html │ │ │ ├── side │ │ │ │ └── toc.html │ │ │ ├── navbar │ │ │ │ ├── menu │ │ │ │ │ ├── navbar-menu-collapse.html │ │ │ │ │ ├── navbar-menu-mobile.html │ │ │ │ │ └── navbar-menu.html │ │ │ │ ├── logo │ │ │ │ │ ├── navbar-logo-mobile.html │ │ │ │ │ ├── navbar-logo-tablet.html │ │ │ │ │ └── navbar-logo.html │ │ │ │ ├── icons │ │ │ │ │ ├── navbar-icons.html │ │ │ │ │ ├── light-dark-toggle.html │ │ │ │ │ └── select-lang.html │ │ │ │ └── search │ │ │ │ │ ├── site-search.html │ │ │ │ │ └── site-search-mobile.html │ │ │ ├── main │ │ │ │ ├── component │ │ │ │ │ ├── toc.html │ │ │ │ │ ├── edit-this-page.html │ │ │ │ │ ├── article-meta.html │ │ │ │ │ ├── toggle-sidebar.html │ │ │ │ │ ├── breadcrumb.html │ │ │ │ │ ├── pagination.html │ │ │ │ │ └── pagination-single.html │ │ │ │ ├── home.html │ │ │ │ ├── landing │ │ │ │ │ ├── home-social.html │ │ │ │ │ └── home-sections.html │ │ │ │ ├── sections │ │ │ │ │ ├── list-section.html │ │ │ │ │ └── list-main.html │ │ │ │ ├── header.html │ │ │ │ ├── list.html │ │ │ │ └── single.html │ │ │ ├── svgs │ │ │ │ ├── arrow-down.svg │ │ │ │ ├── arrow-left.svg │ │ │ │ ├── arrow-right.svg │ │ │ │ ├── calendar.svg │ │ │ │ ├── light-mode.svg │ │ │ │ ├── home.svg │ │ │ │ ├── menu.svg │ │ │ │ ├── arrow-back.svg │ │ │ │ ├── arrow-forward.svg │ │ │ │ ├── edit.svg │ │ │ │ ├── dark-mode.svg │ │ │ │ ├── cancel.svg │ │ │ │ ├── invert-colors.svg │ │ │ │ ├── close.svg │ │ │ │ ├── search.svg │ │ │ │ ├── time.svg │ │ │ │ ├── avatar.svg │ │ │ │ ├── github.svg │ │ │ │ ├── translate.svg │ │ │ │ └── hand-with-pen.svg │ │ │ ├── drawer │ │ │ │ ├── drawer-section.html │ │ │ │ └── drawer.html │ │ │ └── footer │ │ │ │ └── footer.html │ │ ├── shortcodes │ │ │ ├── box.html │ │ │ ├── color.html │ │ │ ├── notice.html │ │ │ ├── alert.html │ │ │ ├── expand.html │ │ │ └── img.html │ │ ├── 404.html │ │ ├── _default │ │ │ ├── _markup │ │ │ │ ├── render-image.html │ │ │ │ └── render-link.html │ │ │ ├── single.html │ │ │ ├── section.html │ │ │ ├── list.searchindex.json │ │ │ ├── single.searchindex.json │ │ │ ├── terms.searchindex.json │ │ │ ├── sitemap.xml │ │ │ ├── baseof.html │ │ │ ├── summary.html │ │ │ ├── taxonomy.html │ │ │ └── rss.xml │ │ ├── index.html │ │ ├── index.json │ │ └── blog │ │ │ ├── section.html │ │ │ └── single.html │ │ ├── data │ │ ├── font.toml │ │ ├── color.toml │ │ ├── flowchartjs.json │ │ └── lib.toml │ │ ├── images │ │ ├── tn.png │ │ └── screenshot.png │ │ ├── static │ │ ├── logo.png │ │ ├── images │ │ │ ├── mountain.jpg │ │ │ ├── landscape.jpg │ │ │ ├── mountains.jpg │ │ │ └── section │ │ │ │ ├── keyboard.png │ │ │ │ ├── processor.png │ │ │ │ └── root-server.png │ │ ├── fonts │ │ │ ├── montserrat-bold.woff │ │ │ ├── muli-latin-200.woff │ │ │ ├── muli-latin-200.woff2 │ │ │ ├── muli-latin-300.woff │ │ │ ├── muli-latin-300.woff2 │ │ │ ├── muli-latin-400.woff │ │ │ ├── muli-latin-400.woff2 │ │ │ ├── muli-latin-600.woff │ │ │ ├── muli-latin-600.woff2 │ │ │ ├── muli-latin-700.woff │ │ │ ├── muli-latin-700.woff2 │ │ │ ├── muli-latin-800.woff │ │ │ ├── muli-latin-800.woff2 │ │ │ ├── muli-latin-900.woff │ │ │ ├── muli-latin-900.woff2 │ │ │ ├── montserrat-black.woff │ │ │ ├── montserrat-black.woff2 │ │ │ ├── montserrat-bold.woff2 │ │ │ ├── montserrat-regular.woff │ │ │ ├── montserrat-regular.woff2 │ │ │ ├── muli-latin-200italic.woff │ │ │ ├── muli-latin-300italic.woff │ │ │ ├── muli-latin-400italic.woff │ │ │ ├── muli-latin-600italic.woff │ │ │ ├── muli-latin-700italic.woff │ │ │ ├── muli-latin-800italic.woff │ │ │ ├── muli-latin-900italic.woff │ │ │ ├── muli-latin-200italic.woff2 │ │ │ ├── muli-latin-300italic.woff2 │ │ │ ├── muli-latin-400italic.woff2 │ │ │ ├── muli-latin-600italic.woff2 │ │ │ ├── muli-latin-700italic.woff2 │ │ │ ├── muli-latin-800italic.woff2 │ │ │ └── muli-latin-900italic.woff2 │ │ └── manifest.json │ │ ├── assets │ │ ├── sass │ │ │ ├── components │ │ │ │ ├── _lib.scss │ │ │ │ ├── _bgcolor.scss │ │ │ │ ├── _modal.scss │ │ │ │ ├── _dropdown.scss │ │ │ │ ├── _tag.scss │ │ │ │ ├── _breadcrumb.scss │ │ │ │ ├── _switch.scss │ │ │ │ ├── _drawer.scss │ │ │ │ ├── _language.scss │ │ │ │ ├── _toc.scss │ │ │ │ ├── _alert.scss │ │ │ │ ├── _button.scss │ │ │ │ ├── _expand.scss │ │ │ │ ├── _pagination.scss │ │ │ │ └── _summary.scss │ │ │ ├── syntax │ │ │ │ └── _syntax.scss │ │ │ ├── themes │ │ │ │ ├── _theme.scss │ │ │ │ ├── _darkcode.scss │ │ │ │ ├── _lightcode.scss │ │ │ │ ├── _light.scss │ │ │ │ └── _dark.scss │ │ │ ├── layout │ │ │ │ ├── _main.scss │ │ │ │ ├── _footer.scss │ │ │ │ ├── _header.scss │ │ │ │ └── _grid.scss │ │ │ ├── abstracts │ │ │ │ ├── _functions.scss │ │ │ │ └── _variables.scss │ │ │ ├── pages │ │ │ │ ├── _blog.scss │ │ │ │ ├── _list.scss │ │ │ │ └── _home.scss │ │ │ ├── base │ │ │ │ ├── _animation.scss │ │ │ │ ├── _helpers.scss │ │ │ │ └── _typography.scss │ │ │ └── main.scss │ │ └── js │ │ │ └── helper │ │ │ ├── prop.js │ │ │ ├── next.js │ │ │ ├── prev.js │ │ │ ├── closest.js │ │ │ ├── fadeinout.js │ │ │ └── getParents.js │ │ ├── archetypes │ │ └── default.md │ │ ├── i18n │ │ ├── ko.toml │ │ └── en.toml │ │ ├── theme.toml │ │ └── LICENSE.md ├── config │ ├── k8sref-io │ │ └── config.toml │ ├── dev-k8sref-io │ │ └── config.toml │ └── _default │ │ ├── languages.toml │ │ ├── menus.en.toml │ │ ├── params.toml │ │ └── config.toml ├── static │ ├── logo.png │ ├── favicon │ │ ├── favicon.ico │ │ ├── apple-icon.png │ │ ├── kubernetes.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-96x96.png │ │ ├── ms-icon-70x70.png │ │ ├── apple-icon-57x57.png │ │ ├── apple-icon-60x60.png │ │ ├── apple-icon-72x72.png │ │ ├── apple-icon-76x76.png │ │ ├── ms-icon-144x144.png │ │ ├── ms-icon-150x150.png │ │ ├── ms-icon-310x310.png │ │ ├── android-icon-36x36.png │ │ ├── android-icon-48x48.png │ │ ├── android-icon-72x72.png │ │ ├── android-icon-96x96.png │ │ ├── apple-icon-114x114.png │ │ ├── apple-icon-120x120.png │ │ ├── apple-icon-144x144.png │ │ ├── apple-icon-152x152.png │ │ ├── apple-icon-180x180.png │ │ ├── android-icon-144x144.png │ │ ├── android-icon-192x192.png │ │ ├── android-icon-512x512.png │ │ └── apple-icon-precomposed.png │ ├── images │ │ ├── shortcodes │ │ │ ├── box.png │ │ │ ├── tab.png │ │ │ ├── alert.png │ │ │ ├── expand.png │ │ │ ├── notice.png │ │ │ └── codetab.png │ │ └── configuration │ │ │ ├── linkpreview.png │ │ │ └── codeblock-with-title.png │ └── manifest.json ├── data │ ├── font.toml │ └── grid.toml ├── resources │ └── _gen │ │ └── assets │ │ └── scss │ │ └── sass │ │ └── main.scss_b4f67ac5085b89b62b54c1923e5a9145.json ├── firebase.json └── content │ └── en │ └── _index.md ├── cmd ├── main.go └── cli │ ├── showtoc.go │ ├── docbook.go │ ├── gvkeysmap.go │ ├── helpers.go │ ├── resourceslist.go │ ├── hugo.go │ ├── kwebsite.go │ └── cli.go ├── tools ├── firebase │ ├── Dockerfile │ └── cloudbuild.yaml └── docbook │ ├── cloudbuild.yaml │ └── Dockerfile ├── pkg ├── kubernetes │ ├── apikind.go │ ├── linkend.go │ ├── apigroup_test.go │ ├── apigroup.go │ ├── key.go │ ├── spec_test.go │ ├── extensions_test.go │ ├── resource.go │ └── parmeters.go ├── config │ ├── helpers.go │ ├── categories.go │ └── toc_test.go ├── openapi │ ├── openapi.go │ └── openapi_test.go ├── outputs │ ├── hugo │ │ ├── links.go │ │ ├── part.go │ │ ├── hugo.go │ │ └── chapter.go │ ├── kwebsite │ │ ├── links.go │ │ ├── part.go │ │ ├── kwebsite.go │ │ └── chapter.go │ ├── docbook │ │ ├── part.go │ │ └── chapter.go │ └── interface.go └── formats │ └── markdown │ └── markdown.go ├── go.mod ├── .gitignore ├── Dockerfile ├── cloudbuild.yaml ├── xsl └── api.xsl ├── README.md └── Makefile /website/themes/zzodoc/layouts/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * -------------------------------------------------------------------------------- /website/config/k8sref-io/config.toml: -------------------------------------------------------------------------------- 1 | baseURL = "https://www.k8sref.io" 2 | -------------------------------------------------------------------------------- /website/config/dev-k8sref-io/config.toml: -------------------------------------------------------------------------------- 1 | baseURL = "https://dev-k8sref-io.web.app" 2 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/header/custom-header.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/shortcodes/box.html: -------------------------------------------------------------------------------- 1 |
{{.Inner | markdownify}}
-------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/head/services.html: -------------------------------------------------------------------------------- 1 | {{ template "_internal/google_analytics.html" . }} 2 | -------------------------------------------------------------------------------- /website/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/logo.png -------------------------------------------------------------------------------- /website/themes/zzodoc/data/font.toml: -------------------------------------------------------------------------------- 1 | title_font = "\"Montserrat\", sans-serif" 2 | content_font = "\"muli\", sans-serif" -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/404.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |
3 | Page not found 4 |
5 | {{ end }} -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/shortcodes/color.html: -------------------------------------------------------------------------------- 1 | {{.Inner | markdownify}} -------------------------------------------------------------------------------- /website/static/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/favicon.ico -------------------------------------------------------------------------------- /website/themes/zzodoc/images/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/images/tn.png -------------------------------------------------------------------------------- /website/static/favicon/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/apple-icon.png -------------------------------------------------------------------------------- /website/static/favicon/kubernetes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/kubernetes.png -------------------------------------------------------------------------------- /website/themes/zzodoc/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/logo.png -------------------------------------------------------------------------------- /website/data/font.toml: -------------------------------------------------------------------------------- 1 | title_font = "\"Montserrat\", sans-serif" 2 | content_font = "\"Merriweather\", serif" 3 | cursive_font = "\"Courgette\", cursive" -------------------------------------------------------------------------------- /website/resources/_gen/assets/scss/sass/main.scss_b4f67ac5085b89b62b54c1923e5a9145.json: -------------------------------------------------------------------------------- 1 | {"Target":"css/main.min.css","MediaType":"text/css","Data":{}} -------------------------------------------------------------------------------- /website/static/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /website/static/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /website/static/favicon/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/favicon-96x96.png -------------------------------------------------------------------------------- /website/static/favicon/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/ms-icon-70x70.png -------------------------------------------------------------------------------- /website/static/images/shortcodes/box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/images/shortcodes/box.png -------------------------------------------------------------------------------- /website/static/images/shortcodes/tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/images/shortcodes/tab.png -------------------------------------------------------------------------------- /website/static/favicon/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/apple-icon-57x57.png -------------------------------------------------------------------------------- /website/static/favicon/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/apple-icon-60x60.png -------------------------------------------------------------------------------- /website/static/favicon/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/apple-icon-72x72.png -------------------------------------------------------------------------------- /website/static/favicon/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/apple-icon-76x76.png -------------------------------------------------------------------------------- /website/static/favicon/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/ms-icon-144x144.png -------------------------------------------------------------------------------- /website/static/favicon/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/ms-icon-150x150.png -------------------------------------------------------------------------------- /website/static/favicon/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/ms-icon-310x310.png -------------------------------------------------------------------------------- /website/static/images/shortcodes/alert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/images/shortcodes/alert.png -------------------------------------------------------------------------------- /website/static/images/shortcodes/expand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/images/shortcodes/expand.png -------------------------------------------------------------------------------- /website/static/images/shortcodes/notice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/images/shortcodes/notice.png -------------------------------------------------------------------------------- /website/themes/zzodoc/images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/images/screenshot.png -------------------------------------------------------------------------------- /cmd/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/feloy/kubernetes-api-reference/cmd/cli" 5 | ) 6 | 7 | func main() { 8 | cli.Run() 9 | } 10 | -------------------------------------------------------------------------------- /website/static/favicon/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/android-icon-36x36.png -------------------------------------------------------------------------------- /website/static/favicon/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/android-icon-48x48.png -------------------------------------------------------------------------------- /website/static/favicon/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/android-icon-72x72.png -------------------------------------------------------------------------------- /website/static/favicon/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/android-icon-96x96.png -------------------------------------------------------------------------------- /website/static/favicon/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/apple-icon-114x114.png -------------------------------------------------------------------------------- /website/static/favicon/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/apple-icon-120x120.png -------------------------------------------------------------------------------- /website/static/favicon/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/apple-icon-144x144.png -------------------------------------------------------------------------------- /website/static/favicon/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/apple-icon-152x152.png -------------------------------------------------------------------------------- /website/static/favicon/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/apple-icon-180x180.png -------------------------------------------------------------------------------- /website/static/images/shortcodes/codetab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/images/shortcodes/codetab.png -------------------------------------------------------------------------------- /website/static/favicon/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/android-icon-144x144.png -------------------------------------------------------------------------------- /website/static/favicon/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/android-icon-192x192.png -------------------------------------------------------------------------------- /website/static/favicon/android-icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/android-icon-512x512.png -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/comments/commento.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | -------------------------------------------------------------------------------- /website/themes/zzodoc/static/images/mountain.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/images/mountain.jpg -------------------------------------------------------------------------------- /website/static/favicon/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/favicon/apple-icon-precomposed.png -------------------------------------------------------------------------------- /website/themes/zzodoc/static/images/landscape.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/images/landscape.jpg -------------------------------------------------------------------------------- /website/themes/zzodoc/static/images/mountains.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/images/mountains.jpg -------------------------------------------------------------------------------- /website/static/images/configuration/linkpreview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/images/configuration/linkpreview.png -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/montserrat-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/montserrat-bold.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-200.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-200.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-200.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-200.woff2 -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-300.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-300.woff2 -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-400.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-400.woff2 -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-600.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-600.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-600.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-600.woff2 -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-700.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-700.woff2 -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-800.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-800.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-800.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-800.woff2 -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-900.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-900.woff2 -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/components/_lib.scss: -------------------------------------------------------------------------------- 1 | // mermaid 2 | .mermaid { 3 | width: 100%; 4 | text-align: center; 5 | margin-bottom: 1rem; 6 | overflow: auto; 7 | } 8 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/shortcodes/notice.html: -------------------------------------------------------------------------------- 1 |
2 | {{ .Inner | markdownify }} 3 |
-------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/montserrat-black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/montserrat-black.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/montserrat-black.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/montserrat-black.woff2 -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/montserrat-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/montserrat-bold.woff2 -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/montserrat-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/montserrat-regular.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/images/section/keyboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/images/section/keyboard.png -------------------------------------------------------------------------------- /website/themes/zzodoc/static/images/section/processor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/images/section/processor.png -------------------------------------------------------------------------------- /website/config/_default/languages.toml: -------------------------------------------------------------------------------- 1 | [en] 2 | title = "Kubernetes Reference" 3 | languageName = "English" 4 | weight = 1 5 | languagedir = "ltr" 6 | contentdir = "content/en" 7 | -------------------------------------------------------------------------------- /website/static/images/configuration/codeblock-with-title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/static/images/configuration/codeblock-with-title.png -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/montserrat-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/montserrat-regular.woff2 -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-200italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-200italic.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-300italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-300italic.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-400italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-400italic.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-600italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-600italic.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-700italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-700italic.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-800italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-800italic.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-900italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-900italic.woff -------------------------------------------------------------------------------- /website/themes/zzodoc/static/images/section/root-server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/images/section/root-server.png -------------------------------------------------------------------------------- /tools/firebase/Dockerfile: -------------------------------------------------------------------------------- 1 | # use latest Node LTS (Erbium) 2 | FROM node:erbium 3 | # install Firebase CLI 4 | RUN npm install -g firebase-tools 5 | 6 | ENTRYPOINT ["/usr/local/bin/firebase"] 7 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/js/helper/prop.js: -------------------------------------------------------------------------------- 1 | var prop = function (node, name, value) { 2 | if (typeof value === 'undefined') { 3 | return node[name]; 4 | } 5 | node[name] = value; 6 | }; -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/side/toc.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-200italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-200italic.woff2 -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-300italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-300italic.woff2 -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-400italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-400italic.woff2 -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-600italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-600italic.woff2 -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-700italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-700italic.woff2 -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-800italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-800italic.woff2 -------------------------------------------------------------------------------- /website/themes/zzodoc/static/fonts/muli-latin-900italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feloy/kubernetes-resources-reference/HEAD/website/themes/zzodoc/static/fonts/muli-latin-900italic.woff2 -------------------------------------------------------------------------------- /tools/docbook/cloudbuild.yaml: -------------------------------------------------------------------------------- 1 | steps: 2 | - name: 'gcr.io/cloud-builders/docker' 3 | args: [ 'build', '-t', 'eu.gcr.io/$PROJECT_ID/docbook', '.' ] 4 | images: 5 | - 'eu.gcr.io/$PROJECT_ID/docbook' 6 | -------------------------------------------------------------------------------- /tools/firebase/cloudbuild.yaml: -------------------------------------------------------------------------------- 1 | steps: 2 | - name: 'gcr.io/cloud-builders/docker' 3 | args: [ 'build', '-t', 'eu.gcr.io/$PROJECT_ID/firebase', '.' ] 4 | images: 5 | - 'eu.gcr.io/$PROJECT_ID/firebase' 6 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/_default/_markup/render-image.html: -------------------------------------------------------------------------------- 1 |

2 | {{ .Text }} 3 |

-------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ define "header" }} 2 | {{ partial "main/header.html" . }} 3 | {{ end }} 4 | {{ define "main" }} 5 | {{ partial "main/single.html" . }} 6 | {{ end }} -------------------------------------------------------------------------------- /pkg/kubernetes/apikind.go: -------------------------------------------------------------------------------- 1 | package kubernetes 2 | 3 | // APIKind represents the Kind of a Kubernetes resource 4 | type APIKind string 5 | 6 | func (o APIKind) String() string { 7 | return string(o) 8 | } 9 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/navbar/menu/navbar-menu-collapse.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | draft: false 5 | weight: 0 6 | enableToc: true 7 | tocLevels: ["h2", "h3", "h4"] 8 | --- 9 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/main/component/toc.html: -------------------------------------------------------------------------------- 1 |
2 |
{{ i18n "toc-label" }}
3 |
4 | {{ .TableOfContents }} 5 |
6 |
-------------------------------------------------------------------------------- /pkg/config/helpers.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import "strings" 4 | 5 | func getEscapedFirstPhrase(s string) string { 6 | description := strings.Split(s, ".")[0] + "." 7 | return strings.ReplaceAll(description, "\"", "\\\"") 8 | } 9 | -------------------------------------------------------------------------------- /tools/docbook/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y \ 5 | make \ 6 | xsltproc \ 7 | docbook-xsl \ 8 | fop \ 9 | && rm -rf /var/lib/apt/lists/* 10 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/syntax/_syntax.scss: -------------------------------------------------------------------------------- 1 | 2 | @import 'duotonelight'; 3 | @import 'dracula'; 4 | 5 | .theme__light { 6 | @include chroma-duotonelight; 7 | } 8 | 9 | .theme__dark { 10 | @include chroma-dracula; 11 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/_default/_markup/render-link.html: -------------------------------------------------------------------------------- 1 | {{ .Text | safeHTML }} -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/main/home.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ partial "main/landing/home-landing.html" . }} 4 |
5 | {{ partial "main/landing/home-sections.html" . }} 6 |
7 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/js/helper/next.js: -------------------------------------------------------------------------------- 1 | function next(node, selector) { 2 | if (selector && document.querySelector(selector) !== node.nextElementSibling) { 3 | return null; 4 | } 5 | 6 | return node.nextElementSibling; 7 | } 8 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/js/helper/prev.js: -------------------------------------------------------------------------------- 1 | var prev = function(node, selector) { 2 | if (selector && document.querySelector(selector) !== node.previousElementSibling) { 3 | return null; 4 | } 5 | 6 | return node.previousElementSibling; 7 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/index.html: -------------------------------------------------------------------------------- 1 | {{ define "title" }}{{ .Site.Title }}{{ end }} 2 | {{ define "header" }} 3 | {{ partial "header/site-header.html" . }} 4 | {{ end }} 5 | {{ define "main" }} 6 | {{ partial "main/home.html" . }} 7 | {{ end }} 8 | -------------------------------------------------------------------------------- /website/config/_default/menus.en.toml: -------------------------------------------------------------------------------- 1 | [[main]] 2 | identifier = "resources" 3 | name = "Resources" 4 | url = "docs" 5 | weight = 1 6 | 7 | #[[main]] 8 | # identifier = "kubectl" 9 | # name = "kubectl" 10 | # url = "kubectl" 11 | # weight = 2 12 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/header/taxo-header.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ .Title }} 4 |
5 |
-------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/themes/_theme.scss: -------------------------------------------------------------------------------- 1 | @import 'dark'; 2 | @import 'light'; 3 | 4 | @import 'darkcode'; 5 | @import 'lightcode'; 6 | 7 | $themes: ( 8 | dark: $dark, 9 | light: $light, 10 | ); 11 | 12 | $codeblock: ( 13 | dark: $darkcode, 14 | light: $lightcode, 15 | ); -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/navbar/logo/navbar-logo-mobile.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/_default/section.html: -------------------------------------------------------------------------------- 1 | {{ define "header" }} 2 | {{ partial "main/header.html" . }} 3 | {{ end }} 4 | {{ define "main" }} 5 | {{ $section_to_display := .Sections | default .Pages }} 6 | {{ partial "main/list.html" (dict "context" . "section_to_display" $section_to_display) }} 7 | {{ end }} 8 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/comments/isso.html: -------------------------------------------------------------------------------- 1 | {{- $scriptSrc := .Site.Params.isso.scriptSrc -}} 2 | {{- $dataAttrs := .Site.Params.isso.dataAttrs -}} 3 | 4 | 5 | 6 |
-------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/components/_bgcolor.scss: -------------------------------------------------------------------------------- 1 | .bgcolor { 2 | @include themify($themes) { 3 | &__header { 4 | background-color: themed('single-header-title-background-color'); 5 | } 6 | 7 | &__breadcrumb { 8 | background-color: themed('breadcrumb-background-color'); 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/themes/_darkcode.scss: -------------------------------------------------------------------------------- 1 | $darkcode: ( 2 | content-code-color: #fcfcfa, 3 | content-pre-color: #eee, 4 | content-pre-number-color: #666, 5 | content-pre-background-color: #2A2C37, 6 | content-pre-header-background-color: #1D1E26, 7 | content-pre-border-background-color: #595B5C, 8 | content-pre-header-color: #FCFCFA, 9 | ); -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/arrow-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/arrow-left.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/arrow-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/layout/_main.scss: -------------------------------------------------------------------------------- 1 | .mid { 2 | @include themify($themes) { 3 | background-color: themed('back-background-color'); 4 | } 5 | } 6 | .main { 7 | width: 100%; 8 | 9 | @include flexbox(); 10 | @include justify-content(center); 11 | @include themify($themes) { 12 | background-color: themed('back-background-color'); 13 | } 14 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/calendar.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/shortcodes/alert.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pkg/openapi/openapi.go: -------------------------------------------------------------------------------- 1 | package openapi 2 | 3 | import ( 4 | "github.com/go-openapi/loads" 5 | "github.com/go-openapi/spec" 6 | ) 7 | 8 | // LoadOpenAPISpec loads the open-api document 9 | func LoadOpenAPISpec(filename string) (*spec.Swagger, error) { 10 | d, err := loads.JSONSpec(filename) 11 | if err != nil { 12 | return nil, err 13 | } 14 | return d.Spec(), nil 15 | } 16 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/themes/_lightcode.scss: -------------------------------------------------------------------------------- 1 | $lightcode: ( 2 | content-code-color: #607d8b, 3 | content-pre-color: #344952, 4 | content-pre-number-color: #aaa, 5 | content-pre-background-color: #f7f8f9, 6 | content-pre-border-background-color: darken(#eceff1, 7%), 7 | content-pre-header-background-color: darken(#eceff1, 3.5%), 8 | content-pre-header-color: #344952, 9 | ); -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/header/blog-header.html: -------------------------------------------------------------------------------- 1 | {{ if and ($.Param "blogHeaderType") (eq ($.Param "blogHeaderType") "img") }} 2 | {{ partial "header/blog-header-img" . }} 3 | {{ else if and ($.Param "blogHeaderType") (eq ($.Param "blogHeaderType") "text") }} 4 | {{ partial "header/blog-header-text" . }} 5 | {{ else }} 6 | {{ partial "header/custom-header" . }} 7 | {{ end }} -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/light-mode.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/components/_modal.scss: -------------------------------------------------------------------------------- 1 | .modal { 2 | position: fixed; 3 | z-index: z('modal'); 4 | left: -100%; 5 | top: 0; 6 | right: 0; 7 | bottom: 0; 8 | width: 100%; /* Full width */ 9 | height: 100%; /* Full height */ 10 | overflow: hidden; 11 | opacity: 0; 12 | background: rgba(0,0,0,0.6); 13 | 14 | @include transition(opacity, 0.25s, ease-in-out); 15 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/home.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/abstracts/_functions.scss: -------------------------------------------------------------------------------- 1 | @function z($name) { 2 | @if index($z-indexes, $name) { 3 | @return (length($z-indexes) - index($z-indexes, $name)) + 1; 4 | } @else { 5 | @warn 'There is no item "#{$name}" in this list; choose one of: #{$z-indexes}'; 6 | @return null; 7 | } 8 | } 9 | 10 | @function themed($key) { 11 | @return map-get($theme-map, $key); 12 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/main/component/edit-this-page.html: -------------------------------------------------------------------------------- 1 | {{ if $.Param "enableEditBtn" }} 2 | 3 | 6 | 7 | {{ end }} -------------------------------------------------------------------------------- /website/data/grid.toml: -------------------------------------------------------------------------------- 1 | grid_max_width = "769" 2 | grid_max_unit = "px" # "px", "\"%\"" Using% is limited to using full width. 3 | grid_main_main_width = "5" 4 | grid_main_main_unit = "fr" # "fr", "px" 5 | grid_main_side_width = "2" 6 | grid_main_side_unit = "fr" # "fr", "px" 7 | grid_column_gap_width = "32" 8 | grid_column_gap_unit = "px" # "px" 9 | grid_navbar_height = "50px" # "px" 10 | grid_row_gap = "0" 11 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/main/landing/home-social.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 10 |
11 |
-------------------------------------------------------------------------------- /website/themes/zzodoc/i18n/ko.toml: -------------------------------------------------------------------------------- 1 | [toc-label] 2 | other = "목차" 3 | 4 | [tooltip-written] 5 | other = "작성일" 6 | 7 | [tooltip-modified] 8 | other = "수정일" 9 | 10 | [tooltip-reading-time] 11 | other = "읽는 시간" 12 | 13 | [summary-dateformat] 14 | other = "2006년 01월 02일" 15 | 16 | [reading-time] 17 | other = "min read" 18 | 19 | [single-writtenBy] 20 | other = "글쓴이" 21 | 22 | [edit-this-page] 23 | other = "이 페이지 수정하기" -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/menu.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pkg/kubernetes/linkend.go: -------------------------------------------------------------------------------- 1 | package kubernetes 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // LinkEnds maps definition key to a link-end 8 | type LinkEnds map[Key][]string 9 | 10 | // Add a new map between key and linkend 11 | func (o LinkEnds) Add(key Key, linkend []string) { 12 | o[key] = linkend 13 | } 14 | 15 | func (o LinkEnds) Debug() { 16 | for k, v := range o { 17 | fmt.Printf("%s: %v\n", k, v) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/arrow-back.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/arrow-forward.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/edit.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/shortcodes/expand.html: -------------------------------------------------------------------------------- 1 |
2 | 8 |
9 | {{.Inner | markdownify}} 10 |
11 |
-------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/header/site-header.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | {{ if $.Param "updatesBanner" }} 6 |
7 | {{ ($.Param "updatesBanner") | markdownify }} 8 |
9 | {{ end }} 10 |
11 |
12 |
13 |
-------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/dark-mode.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/js/helper/closest.js: -------------------------------------------------------------------------------- 1 | var closest = function(node, selector) { 2 | return (node.closest || function (_selector) { 3 | do { 4 | if ((node.matches || node.msMatchesSelector).call(node, _selector)) { 5 | return node; 6 | } 7 | node = node.parentElement || node.parentNode; 8 | } while (node !== null && node.nodeType === 1); 9 | 10 | return null; 11 | }).call(node, selector); 12 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/main/sections/list-section.html: -------------------------------------------------------------------------------- 1 | {{ $.context.Content }} 2 |
3 | {{ range .section_to_display }} 4 |
5 | 6 | {{ .Title }} 7 | 8 |
9 | {{ .Description }} 10 |
11 |
12 | {{ end }} 13 |
-------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/feloy/kubernetes-api-reference 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/go-openapi/jsonreference v0.19.3 7 | github.com/go-openapi/loads v0.19.5 8 | github.com/go-openapi/spec v0.19.8 9 | github.com/shabbyrobe/xmlwriter v0.0.0-20200208144257-9fca06d00ffa 10 | github.com/spf13/cobra v1.0.0 11 | github.com/spf13/viper v1.7.0 12 | github.com/tektoncd/pipeline v0.12.1 // indirect 13 | gopkg.in/yaml.v2 v2.2.8 14 | ) 15 | -------------------------------------------------------------------------------- /website/themes/zzodoc/i18n/en.toml: -------------------------------------------------------------------------------- 1 | [toc-label] 2 | other = "What's on this Page" 3 | 4 | [tooltip-written] 5 | other = "Written At" 6 | 7 | [tooltip-modified] 8 | other = "Modified At" 9 | 10 | [tooltip-reading-time] 11 | other = "Reading Time" 12 | 13 | [summary-dateformat] 14 | other = "Jan 2, 2006" 15 | 16 | [reading-time] 17 | other = "min read" 18 | 19 | [single-writtenBy] 20 | other = "WRITTEN BY" 21 | 22 | [edit-this-page] 23 | other = "EDIT THIS PAGE" -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/cancel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/invert-colors.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | 17 | .firebase 18 | .firebaserc 19 | 20 | /website/content/en/docs/ 21 | /website/public 22 | /build/ 23 | .vscode/launch.json 24 | -------------------------------------------------------------------------------- /website/themes/zzodoc/data/color.toml: -------------------------------------------------------------------------------- 1 | dark_active_font_color = "#aed581" 2 | dark_link_color = "#FFD866" 3 | dark_link_hover_color = "#FF6188" 4 | dark_nav_logo_color = "#FCFCFA" 5 | dark_nav_menu_color = "#FCFCFA" 6 | dark_nav_icon_color = "#ccc" 7 | 8 | 9 | light_active_font_color = "#007d9c" 10 | light_link_color = "#007d9c" 11 | light_link_hover_color = "#00ACD7" 12 | light_nav_logo_color = "#242729" 13 | light_nav_menu_color = "#242729" 14 | light_nav_icon_color = "#535a61" -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/main/sections/list-main.html: -------------------------------------------------------------------------------- 1 |
2 | {{ if eq .Type "blog" }} 3 |
4 | {{ .Title }} 5 |
6 |
7 | {{ partial "main/component/article-meta.html" . }} 8 |
9 | {{ end }} 10 | 11 |
12 | {{ .Content }} 13 |
14 |
-------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/close.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/components/_dropdown.scss: -------------------------------------------------------------------------------- 1 | .dropdown { 2 | position: relative; 3 | display: inline-block; 4 | height: 100%; 5 | } 6 | 7 | .dropdown-content { 8 | display: none; 9 | position: absolute; 10 | z-index: z('dropdown'); 11 | } 12 | 13 | .dropdown-content a { 14 | padding: 0.3rem 0.5rem; 15 | text-decoration: none; 16 | display: block; 17 | @include truncate2(120px); 18 | } 19 | 20 | .dropdown:hover .dropdown-content { 21 | display: block; 22 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/navbar/icons/navbar-icons.html: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /pkg/openapi/openapi_test.go: -------------------------------------------------------------------------------- 1 | package openapi_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/feloy/kubernetes-api-reference/pkg/openapi" 7 | ) 8 | 9 | func TestLoadOpenAPISpecV118(t *testing.T) { 10 | spec, err := openapi.LoadOpenAPISpec("../../api/v1.18/swagger.json") 11 | if err != nil { 12 | t.Errorf("Failed to load spec") 13 | } 14 | if len(spec.Definitions) != 600 { 15 | t.Errorf("Spec should contain %d definition but contains %d", 600, len(spec.Definitions)) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/pages/_blog.scss: -------------------------------------------------------------------------------- 1 | .blog { 2 | @include themify($themes) { 3 | background-color: themed('body-background-color'); 4 | } 5 | 6 | &__bg { 7 | @include themify($themes) { 8 | background-color: themed('body-background-color'); 9 | } 10 | } 11 | 12 | &__header { 13 | @include flexbox(); 14 | @include justify-content(center); 15 | @include align-items(center); 16 | } 17 | 18 | .subtitle { 19 | margin: 0.25rem 0; 20 | } 21 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/index.json: -------------------------------------------------------------------------------- 1 | {{ .Scratch.Delete "searchindex" }} 2 | {{- $.Scratch.Add "searchindex" slice -}} 3 | {{- range $index, $element := (where .Site.Pages "Kind" "page") -}} 4 | {{ with $element.Plain }} 5 | {{- $.Scratch.Add "searchindex" (dict "id" $index "title" $element.Title "uri" $element.Permalink "tags" $element.Params.tags "section" $element.Section "content" $element.Plain "description" $element.Description) -}} 6 | {{ end }} 7 | {{- end -}} 8 | {{- $.Scratch.Get "searchindex" | jsonify -}} -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/search.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/navbar/menu/navbar-menu-mobile.html: -------------------------------------------------------------------------------- 1 | 2 | 10 | {{ partial "navbar/menu/navbar-menu-collapse.html" . }} 11 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/base/_animation.scss: -------------------------------------------------------------------------------- 1 | // -- Slide Animations -- // 2 | 3 | @include keyframes(slide-in-down) { 4 | 0% { 5 | transform: translate(0,-12%); 6 | opacity: 0; 7 | } 8 | 9 | 100% { 10 | transform: translate(0,0); 11 | opacity: 1; 12 | } 13 | } 14 | 15 | // Slide in Left to Center 16 | @include keyframes(slide-in-left) { 17 | 0% { 18 | transform: translate(-12%,0); 19 | opacity: 0; 20 | } 21 | 22 | 100% { 23 | transform: translate(0,0); 24 | opacity: 1; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/_default/list.searchindex.json: -------------------------------------------------------------------------------- 1 | {{ .Scratch.Delete "searchindex" }} 2 | {{- $.Scratch.Add "searchindex" slice -}} 3 | {{- range $index, $element := (where .Site.Pages "Kind" "page") -}} 4 | {{ with $element.Plain }} 5 | {{- $.Scratch.Add "searchindex" (dict "id" $index "title" $element.Title "uri" $element.Permalink "tags" $element.Params.tags "section" $element.Section "content" $element.Plain "description" $element.Description) -}} 6 | {{ end }} 7 | {{- end -}} 8 | {{- $.Scratch.Get "searchindex" | jsonify -}} -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/_default/single.searchindex.json: -------------------------------------------------------------------------------- 1 | {{ .Scratch.Delete "searchindex" }} 2 | {{- $.Scratch.Add "searchindex" slice -}} 3 | {{- range $index, $element := (where .Site.Pages "Kind" "page") -}} 4 | {{ with $element.Plain }} 5 | {{- $.Scratch.Add "searchindex" (dict "id" $index "title" $element.Title "uri" $element.Permalink "tags" $element.Params.tags "section" $element.Section "content" $element.Plain "description" $element.Description) -}} 6 | {{ end }} 7 | {{- end -}} 8 | {{- $.Scratch.Get "searchindex" | jsonify -}} -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/_default/terms.searchindex.json: -------------------------------------------------------------------------------- 1 | {{ .Scratch.Delete "searchindex" }} 2 | {{- $.Scratch.Add "searchindex" slice -}} 3 | {{- range $index, $element := (where .Site.Pages "Kind" "page") -}} 4 | {{ with $element.Plain }} 5 | {{- $.Scratch.Add "searchindex" (dict "id" $index "title" $element.Title "uri" $element.Permalink "tags" $element.Params.tags "section" $element.Section "content" $element.Plain "description" $element.Description) -}} 6 | {{ end }} 7 | {{- end -}} 8 | {{- $.Scratch.Get "searchindex" | jsonify -}} -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/main/component/article-meta.html: -------------------------------------------------------------------------------- 1 | {{ partial "svgs/calendar.svg" (dict "width" 16 "height" 16) }}    {{ partial "svgs/time.svg" (dict "width" 16 "height" 16) }} {{ .ReadingTime }} {{ i18n "reading-time" }}{{ with .Params.Author }}    {{ partial "svgs/avatar.svg" (dict "width" 16 "height" 16) }} {{ . }}{{ end }} -------------------------------------------------------------------------------- /website/themes/zzodoc/theme.toml: -------------------------------------------------------------------------------- 1 | name = "Zdoc" 2 | description = "Simple Hugo documentation theme." 3 | homepage = "https://zzodocs.netlify.com" 4 | license = "MIT" 5 | licenselink = "https://github.com/zzossig/hugo-theme-zdoc/blob/master/LICENSE.md" 6 | tags = ["accessible", "multilingual", "responsive", "documentation", "search", "simple", "light", "dark", "mobile"] 7 | features = ["accessible", "multilingual", "responsive", "grid", "sass", "search", "fast"] 8 | min_version = "0.60.0" 9 | 10 | [author] 11 | name = "zzossig" 12 | homepage = "https://zzossig.io" -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/main/landing/home-sections.html: -------------------------------------------------------------------------------- 1 | {{ range .Params.sections }} 2 |
3 |
4 |
5 | {{ if eq .type "card" }} 6 | {{ partial "main/landing/section-card.html" . }} 7 | {{ else if eq .type "normal" }} 8 | {{ partial "main/landing/section-normal" . }} 9 | {{ else }} 10 | {{ printf "%#v" "Not supported type" }} 11 | {{ end }} 12 |
13 |
14 |
15 | {{ end }} -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/main/component/toggle-sidebar.html: -------------------------------------------------------------------------------- 1 | {{ if $.Param "enableTocSwitch" }} 2 | 13 | {{ end }} -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/navbar/search/site-search.html: -------------------------------------------------------------------------------- 1 | {{ if $.Param "enableSearch" }} 2 | 3 | 13 | 14 | {{ end }} -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/drawer/drawer-section.html: -------------------------------------------------------------------------------- 1 | {{ $current := . }} 2 | {{ range .Site.Menus.main }} 3 | {{ $active := or ($current.IsMenuCurrent "main" .) ($current.HasMenuCurrent "main" .) }} 4 | {{ $active = or $active (eq .Name $current.Title) }} 5 | {{ $active = or $active (eq (lower .URL) (lower $current.Title)) }} 6 | {{ $active = or $active (eq (lower .URL) (lower $current.Type)) }} 7 | 10 | {{ end }} -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/base/_helpers.scss: -------------------------------------------------------------------------------- 1 | .clearfix::after { 2 | clear: both; 3 | content: ''; 4 | display: table; 5 | } 6 | 7 | .capitalize { 8 | text-transform: capitalize; 9 | } 10 | 11 | .hide { 12 | display: none; 13 | } 14 | 15 | .grow { 16 | @include flex-grow(1); 17 | } 18 | 19 | .flexbox { 20 | @include flexbox(); 21 | } 22 | 23 | .flexcolumn { 24 | @include flexbox(); 25 | @include flex-direction(column); 26 | } 27 | 28 | .jc-center { 29 | @include justify-content(center); 30 | } 31 | 32 | .ai-center { 33 | @include align-items(center); 34 | } 35 | 36 | .flex-wrap { 37 | @include flex-wrap(wrap); 38 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/time.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/navbar/logo/navbar-logo-tablet.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/avatar.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/components/_tag.scss: -------------------------------------------------------------------------------- 1 | .tag { 2 | display: inline-block; 3 | margin: 0.25rem 0.4rem; 4 | text-decoration: none !important; 5 | 6 | @include themify($themes) { 7 | color: darken(themed('subtitle-color'), 5%); 8 | @include on-event { 9 | color: themed('link-hover'); 10 | } 11 | } 12 | 13 | &__wrapper { 14 | padding: 0.3rem 0; 15 | margin: auto 0; 16 | } 17 | 18 | &__text { 19 | font-size: 0.95rem; 20 | font-weight: bold; 21 | color: inherit; 22 | } 23 | 24 | &__num { 25 | font-size: 0.75rem; 26 | font-weight: bold; 27 | color: inherit; 28 | } 29 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/comments/livere.html: -------------------------------------------------------------------------------- 1 |
2 | 15 | 17 |
-------------------------------------------------------------------------------- /pkg/kubernetes/apigroup_test.go: -------------------------------------------------------------------------------- 1 | package kubernetes_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/feloy/kubernetes-api-reference/pkg/kubernetes" 7 | ) 8 | 9 | func TestAPIGroupReplaces(t *testing.T) { 10 | tests := []struct { 11 | Group1 kubernetes.APIGroup 12 | Group2 kubernetes.APIGroup 13 | Expected bool 14 | }{ 15 | {"networking", "extensions", true}, 16 | {"events.k8s.io", "", true}, 17 | } 18 | 19 | for _, test := range tests { 20 | result := test.Group1.Replaces(test.Group2) 21 | if result != test.Expected { 22 | t.Errorf("%s replaces %s: expected %v but got %v", test.Group1, test.Group2, test.Expected, result) 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/navbar/menu/navbar-menu.html: -------------------------------------------------------------------------------- 1 | {{ $current := . }} 2 | {{ range .Site.Menus.main }} 3 | {{ $active := or ($current.IsMenuCurrent "main" .) ($current.HasMenuCurrent "main" .) }} 4 | {{ $active = or $active (eq .Name $current.Title) }} 5 | {{ $active = or $active (eq (lower .URL) (lower $current.Title)) }} 6 | {{ $active = or $active (eq (lower .URL) (lower $current.Type)) }} 7 | 10 | {{ end }} -------------------------------------------------------------------------------- /website/firebase.json: -------------------------------------------------------------------------------- 1 | { 2 | "hosting": [ 3 | { 4 | "site": "k8sref-io", 5 | "public": "public", 6 | "ignore": [ 7 | "firebase.json", 8 | "**/.*", 9 | "**/node_modules/**" 10 | ], 11 | "rewrites": [ 12 | { 13 | "source": "**", 14 | "destination": "/index.html" 15 | } 16 | ] 17 | }, 18 | { 19 | "site": "dev-k8sref-io", 20 | "public": "public", 21 | "ignore": [ 22 | "firebase.json", 23 | "**/.*", 24 | "**/node_modules/**" 25 | ], 26 | "rewrites": [ 27 | { 28 | "source": "**", 29 | "destination": "/index.html" 30 | } 31 | ] 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/main/header.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |

{{ .Title }}

6 |
7 |
8 |
9 | 10 |
11 |
12 |
13 | {{ if $.Param "enableBreadcrumb" }} 14 | {{ partial "main/component/breadcrumb.html" . }} 15 | {{ end }} 16 |
17 | {{ partial "main/component/edit-this-page.html" . }} 18 |
19 |
20 |
21 |
-------------------------------------------------------------------------------- /pkg/kubernetes/apigroup.go: -------------------------------------------------------------------------------- 1 | package kubernetes 2 | 3 | // APIGroup represents the group of a Kubernetes API 4 | type APIGroup string 5 | 6 | func (o APIGroup) String() string { 7 | return string(o) 8 | } 9 | 10 | // Replaces returns true if 'o' group is replaced by 'p' group 11 | func (o APIGroup) Replaces(p APIGroup) bool { 12 | // * replaces extensions 13 | if o.String() != "extensions" && p.String() == "extensions" { 14 | return true 15 | } 16 | 17 | // events replaces core 18 | if o.String() == "events.k8s.io" && p.String() == "" { 19 | return true 20 | } 21 | 22 | // autoscaling replaces apps 23 | if o.String() == "autoscaling" && p.String() == "apps" { 24 | return true 25 | } 26 | 27 | return false 28 | } 29 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/head/styles.html: -------------------------------------------------------------------------------- 1 | {{ $main_options := (dict "targetPath" "css/main.css" "outputStyle" "compressed") }} 2 | {{ $main_template := resources.Get "sass/main.scss" }} 3 | {{ $main_style := $main_template | resources.ExecuteAsTemplate "main_parsed.scss" . | toCSS $main_options | resources.Minify }} 4 | 5 | 6 | {{ if .Site.Params.custom_css }} 7 | {{ range .Site.Params.custom_css }} 8 | {{ $custom_template := resources.Get . }} 9 | {{ if $custom_template }} 10 | {{ $custom_style := $custom_template | resources.ToCSS | resources.Minify }} 11 | 12 | {{ end }} 13 | {{ end }} 14 | {{ end }} -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/navbar/search/site-search-mobile.html: -------------------------------------------------------------------------------- 1 | {{ if $.Param "enableSearch" }} 2 |
3 | {{ partial "svgs/search.svg" (dict "width" 22 "height" 22) }} 4 |
5 | 6 | 17 | {{ end }} -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.13-buster AS builder 2 | 3 | WORKDIR /app 4 | 5 | ADD go.mod go.sum /app/ 6 | RUN go mod download 7 | 8 | ADD api /app/api 9 | ADD config /app/config 10 | 11 | ADD pkg /app/pkg 12 | ADD cmd /app/cmd 13 | 14 | # Run unit tests 15 | RUN go test ./... 16 | 17 | # Build binary 18 | RUN GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o /kubernetes-api-reference cmd/main.go 19 | 20 | # Verify that resourceslist.txt is up to date 21 | RUN /kubernetes-api-reference resourceslist -f api/v1.19/swagger.json > /tmp/resourceslist.txt 22 | RUN diff /tmp/resourceslist.txt api/v1.19/resourceslist.txt 23 | 24 | # final stage 25 | FROM eu.gcr.io/k8sref-io/docbook 26 | 27 | WORKDIR /root 28 | 29 | COPY --from=builder /kubernetes-api-reference /usr/local/bin/ 30 | -------------------------------------------------------------------------------- /pkg/outputs/hugo/links.go: -------------------------------------------------------------------------------- 1 | package hugo 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | // LinkEnd returns a link to a section in a part/chapter 9 | // s is an array containing partname / chaptername 10 | func (o *Hugo) LinkEnd(s []string, name string) string { 11 | typename := name 12 | mapprefix := "" 13 | array := "" 14 | 15 | if strings.HasPrefix(typename, "map[string]") { 16 | mapprefix = "map[string]" 17 | typename = strings.TrimPrefix(name, mapprefix) 18 | } 19 | 20 | if strings.HasPrefix(typename, "[]") { 21 | array = "[]" 22 | typename = strings.TrimPrefix(name, array) 23 | } 24 | 25 | return fmt.Sprintf("%s%s}}\">%s", mapprefix, array, escapeName(s[0]), escapeName(s[1]), escapeName(typename), typename) 26 | } 27 | -------------------------------------------------------------------------------- /pkg/outputs/kwebsite/links.go: -------------------------------------------------------------------------------- 1 | package kwebsite 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | // LinkEnd returns a link to a section in a part/chapter 9 | // s is an array containing partname / chaptername 10 | func (o *KWebsite) LinkEnd(s []string, name string) string { 11 | typename := name 12 | mapprefix := "" 13 | array := "" 14 | 15 | if strings.HasPrefix(typename, "map[string]") { 16 | mapprefix = "map[string]" 17 | typename = strings.TrimPrefix(name, mapprefix) 18 | } 19 | 20 | if strings.HasPrefix(typename, "[]") { 21 | array = "[]" 22 | typename = strings.TrimPrefix(name, array) 23 | } 24 | 25 | return fmt.Sprintf("%s%s}}\">%s", mapprefix, array, escapeName(s[0]), escapeName(s[1]), escapeName(typename), typename) 26 | } 27 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/base/_typography.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Basic typography style for copy text 3 | */ 4 | 5 | html { 6 | font-family: sans-serif; 7 | -ms-text-size-adjust: 100%; 8 | -webkit-text-size-adjust: 100%; 9 | } 10 | 11 | body { 12 | font-size: 1rem; 13 | font-family: $text-font-stack; 14 | } 15 | 16 | code, 17 | pre { 18 | font-size: 0.85rem; 19 | font-family: $code-font-stack; 20 | } 21 | 22 | .h1 { 23 | font-size: 4rem; 24 | } 25 | 26 | .h2 { 27 | font-size: 3.5rem; 28 | } 29 | 30 | .h3 { 31 | font-size: 3rem; 32 | } 33 | 34 | .h4 { 35 | font-size: 2.5rem; 36 | } 37 | 38 | .h5 { 39 | font-size: 2rem; 40 | } 41 | 42 | .h6 { 43 | font-size: 1.5rem; 44 | } 45 | 46 | .p1 { 47 | font-size: 1.2rem; 48 | } 49 | 50 | .p2 { 51 | font-size: 1rem; 52 | } 53 | 54 | .caption { 55 | font-size: 0.8rem; 56 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/navbar/logo/navbar-logo.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/github.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/translate.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cmd/cli/showtoc.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/spf13/cobra" 8 | ) 9 | 10 | // ShowTOCCmd defines the `showtoc` subcommand 11 | func ShowTOCCmd() *cobra.Command { 12 | cmd := &cobra.Command{ 13 | Use: "showtoc", 14 | Short: "show the table of contents", 15 | Long: "list the parts and chapter of the documentation", 16 | SilenceErrors: true, 17 | SilenceUsage: true, 18 | RunE: func(cmd *cobra.Command, args []string) error { 19 | toc, err := prepareTOC(cmd) 20 | if err != nil { 21 | return fmt.Errorf("Unable to load specs and/or toc config: %v", err) 22 | } 23 | toc.ToMarkdown(os.Stdout) 24 | return nil 25 | }, 26 | } 27 | cmd.Flags().StringP(configDirOption, "c", "", "Directory containing documentation configuration") 28 | cmd.MarkFlagRequired(configDirOption) 29 | 30 | return cmd 31 | } 32 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/svgs/hand-with-pen.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/comments/gitalk.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 17 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/comments/disqus.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/comments/comments.html: -------------------------------------------------------------------------------- 1 | {{ if $.Param "enableComment" }} 2 | {{ if $.Param "disqus_shortname" }} 3 | {{ partial "comments/disqus.html" . }} 4 | {{ else if $.Param "commento" }} 5 | {{ partial "comments/commento.html" . }} 6 | {{ else if $.Param "valine.enable" }} 7 | {{ partial "comments/valine.html" . }} 8 | {{ else if $.Param "changyan.changyanAppid" }} 9 | {{ partial "comments/changyan.html" . }} 10 | {{ else if $.Param "livere.livereUID" }} 11 | {{ partial "comments/livere.html" . }} 12 | {{ else if $.Param "gitment.owner" }} 13 | {{ partial "comments/gitment.html" . }} 14 | {{ else if $.Param "gitalk.owner" }} 15 | {{ partial "comments/gitalk.html" . }} 16 | {{ else if $.Param "utterances.owner" }} 17 | {{ partial "comments/utterances.html" . }} 18 | {{ else if $.Param "isso.enable" }} 19 | {{ partial "comments/isso.html" . }} 20 | {{ end }} 21 | {{ end }} -------------------------------------------------------------------------------- /cmd/cli/docbook.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/spf13/cobra" 8 | ) 9 | 10 | // Docbook defines the `docbook` subcommand 11 | func Docbook() *cobra.Command { 12 | cmd := &cobra.Command{ 13 | Use: "docbook", 14 | Short: "output specification in Docbook format", 15 | Long: "output the specification in Docbook format", 16 | SilenceErrors: true, 17 | SilenceUsage: true, 18 | RunE: func(cmd *cobra.Command, args []string) error { 19 | toc, err := prepareTOC(cmd) 20 | if err != nil { 21 | return fmt.Errorf("Unable to load specs and/or toc config: %v", err) 22 | } 23 | 24 | err = toc.ToDocbook(os.Stdout) 25 | if err != nil { 26 | return err 27 | } 28 | return nil 29 | }, 30 | } 31 | cmd.Flags().StringP(configDirOption, "c", "", "Directory containing documentation configuration") 32 | cmd.MarkFlagRequired(configDirOption) 33 | return cmd 34 | } 35 | -------------------------------------------------------------------------------- /website/config/_default/params.toml: -------------------------------------------------------------------------------- 1 | logo = true 2 | logoText = "Kubernetes Reference" 3 | logoType = "short" # long, short 4 | description = "Kubernetes Reference" 5 | editBaseURL = "" 6 | themeOptions = ["light", "dark"] 7 | 8 | useFaviconGenerator = false # https://www.favicon-generator.org/ 9 | 10 | enableTocSwitch = true 11 | enableLandingBackground = true 12 | enableSearch = false 13 | enableSearchHighlight = false 14 | enableLangChange = false 15 | enableDarkMode = true 16 | enableBreadcrumb = true 17 | enableBlogBreadcrumb = true 18 | enableEditBtn = false 19 | enableToc = true 20 | enableMenu = true 21 | enableNavbar = true 22 | enableFooter = true 23 | showPoweredBy = true 24 | 25 | tocLevels = ["h2", "h3", "h4"] 26 | paginateWindow = 1 27 | taxoPaginate = 13 28 | taxoGroupByDate = "2006" # "2006-01": group by month, "2006": group by year 29 | 30 | github = "https://github.com/feloy/kubernetes-resources-reference" 31 | 32 | enableComment = false 33 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/navbar/icons/light-dark-toggle.html: -------------------------------------------------------------------------------- 1 | {{ if $.Param "enableDarkMode" }} 2 | 5 | 8 | 21 | {{ end }} -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/comments/valine.html: -------------------------------------------------------------------------------- 1 | {{- if .Site.Params.valine.visitor -}} 2 | 3 | 文章阅读量 4 | 0 5 |

6 |
7 | {{- end }} 8 |
9 | 10 | 11 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/main/component/breadcrumb.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/comments/gitment.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 19 | -------------------------------------------------------------------------------- /pkg/kubernetes/key.go: -------------------------------------------------------------------------------- 1 | package kubernetes 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | // Key of the resource in the OpenAPI definition (e.g. io.k8s.api.core.v1.Pod) 8 | type Key string 9 | 10 | // GoImportPrefix returns the path to use for this group in go import 11 | func (o Key) GoImportPrefix() string { 12 | parts := strings.Split(o.String(), ".") 13 | return parts[1] + "." + parts[0] + "/" + strings.Join(parts[2:len(parts)-1], "/") 14 | } 15 | 16 | // RemoveResourceName removes the last part of the key corresponding to the resource name 17 | func (o Key) RemoveResourceName() string { 18 | parts := strings.Split(o.String(), ".") 19 | return strings.Join(parts[:len(parts)-1], ".") 20 | } 21 | 22 | // ResourceName returns the resource name part of a key 23 | func (o Key) ResourceName() string { 24 | parts := strings.Split(o.String(), ".") 25 | return parts[len(parts)-1] 26 | } 27 | 28 | // String returns a string representation of the Key 29 | func (o Key) String() string { 30 | return string(o) 31 | } 32 | -------------------------------------------------------------------------------- /pkg/outputs/docbook/part.go: -------------------------------------------------------------------------------- 1 | package docbook 2 | 3 | import ( 4 | "github.com/feloy/kubernetes-api-reference/pkg/formats/dbxml" 5 | "github.com/feloy/kubernetes-api-reference/pkg/kubernetes" 6 | "github.com/feloy/kubernetes-api-reference/pkg/outputs" 7 | x "github.com/shabbyrobe/xmlwriter" 8 | ) 9 | 10 | // DocbookPart represents a Part of the Docbook output 11 | type DocbookPart struct { 12 | w *x.Writer 13 | } 14 | 15 | // AddChapter adds a chapter to the Docbook part 16 | func (o DocbookPart) AddChapter(i int, name string, gv string, version *kubernetes.APIVersion, description string, importPrefix string) (outputs.Chapter, error) { 17 | if i > 0 { 18 | o.w.EndToDepth(chapterDepth, x.ElemNode, "chapter") 19 | } 20 | id := name + " " + version.String() 21 | 22 | chapterName := name 23 | if version != nil && version.Stage != kubernetes.StageGA { 24 | chapterName += " " + version.String() 25 | } 26 | 27 | chapter := dbxml.Section("chapter", chapterName) 28 | return DocbookChapter{id: id, w: o.w}, o.w.StartElem(chapter) 29 | } 30 | -------------------------------------------------------------------------------- /pkg/kubernetes/spec_test.go: -------------------------------------------------------------------------------- 1 | package kubernetes_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/feloy/kubernetes-api-reference/pkg/kubernetes" 7 | ) 8 | 9 | func TestSpecV118(t *testing.T) { 10 | spec, err := kubernetes.NewSpec("../../api/v1.18/swagger.json") 11 | if err != nil { 12 | t.Errorf("NewSpec should not return an errors but returns %s", err) 13 | } 14 | if len(*spec.Resources) != 114 { 15 | t.Errorf("Spec should contain %d resources but contains %d", 114, len(*spec.Resources)) 16 | } 17 | } 18 | 19 | func TestGetResourceV118(t *testing.T) { 20 | spec, err := kubernetes.NewSpec("../../api/v1.18/swagger.json") 21 | if err != nil { 22 | t.Errorf("NewSpec should not return an errors but returns %s", err) 23 | } 24 | v1 := newAPIVersionAssert(t, "v1") 25 | _, res := spec.GetResource("", *v1, "Pod", false) 26 | if res.Description != "Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts." { 27 | t.Error("Error getting definition of Pod") 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/_default/sitemap.xml: -------------------------------------------------------------------------------- 1 | {{ printf "" | safeHTML }} 2 | 4 | {{ range .Data.Pages }} 5 | 6 | {{ .Permalink }}{{ if not .Lastmod.IsZero }} 7 | {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} 8 | {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} 9 | {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} 10 | {{ end }} 15 | {{ end }} 20 | 21 | {{ end }} 22 | -------------------------------------------------------------------------------- /cloudbuild.yaml: -------------------------------------------------------------------------------- 1 | steps: 2 | 3 | - id: build-image 4 | name: 'gcr.io/cloud-builders/docker' 5 | args: [ 'build', '-t', 'eu.gcr.io/$PROJECT_ID/build:$BUILD_ID', '.' ] 6 | 7 | - id: build 8 | waitFor: 9 | - build-image 10 | name: 'eu.gcr.io/$PROJECT_ID/build:$BUILD_ID' 11 | entrypoint: "/bin/bash" 12 | args: 13 | - -c 14 | - | 15 | mkdir -p website/content/en/docs 16 | kubernetes-api-reference hugo --file api/v1.19/swagger.json --config-dir config/v1.19 --output-dir website/content/en/docs 17 | 18 | - id: hugo 19 | waitFor: 20 | - build 21 | name: 'klakegg/hugo' 22 | entrypoint: "/bin/sh" 23 | args: 24 | - -c 25 | - | 26 | cd website 27 | hugo --environment ${_HOSTING} 28 | tar zcf public.tgz public 29 | 30 | - id: deploy 31 | waitFor: ['hugo'] 32 | name: 'eu.gcr.io/$PROJECT_ID/firebase' 33 | args: 34 | - 'deploy' 35 | - '-P' 36 | - '$PROJECT_ID' 37 | - '--only' 38 | - 'hosting:${_HOSTING}' 39 | dir: website 40 | 41 | artifacts: 42 | objects: 43 | location: 'gs://$PROJECT_ID/${BRANCH_NAME}${TAG_NAME}/' 44 | paths: 45 | - "website/public.tgz" 46 | -------------------------------------------------------------------------------- /pkg/kubernetes/extensions_test.go: -------------------------------------------------------------------------------- 1 | package kubernetes 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/go-openapi/spec" 7 | ) 8 | 9 | func TestGetGVKExtension(t *testing.T) { 10 | definition := spec.Schema{ 11 | VendorExtensible: spec.VendorExtensible{ 12 | Extensions: spec.Extensions{ 13 | "x-kubernetes-group-version-kind": []interface{}{ 14 | map[string]interface{}{ 15 | "group": "apps", 16 | "version": "v1", 17 | "kind": "Deployment", 18 | }, 19 | }, 20 | }, 21 | }, 22 | } 23 | extension, found, err := getGVKExtension(definition.Extensions) 24 | if !found { 25 | t.Errorf("Extension should be found") 26 | } 27 | if err != nil { 28 | t.Errorf("Extension should be found without error") 29 | } 30 | if extension.Group != "apps" { 31 | t.Errorf("Group should be %s but is %s", "apps", extension.Group) 32 | } 33 | if extension.Version.String() != "v1" { 34 | t.Errorf("Version should be %s but is %s", "v1", extension.Version.String()) 35 | } 36 | if extension.Kind != "Deployment" { 37 | t.Errorf("Kind should be %s but is %s", "Deployment", extension.Kind) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /website/config/_default/config.toml: -------------------------------------------------------------------------------- 1 | baseURL = "http://localhost:8000" 2 | title = "Kubernetes Reference" 3 | theme = "zzodoc" 4 | 5 | defaultContentLanguage = "en" 6 | defaultContentLanguageInSubdir = false 7 | hasCJKLanguage = false 8 | 9 | copyright = "© 2020 The Kubernetes Authors" 10 | timeout = 10000 11 | enableEmoji = true 12 | paginate = 13 13 | rssLimit = 100 14 | 15 | googleAnalytics = "UA-169221756-1" 16 | 17 | disableKinds = ["taxonomyTerm"] 18 | 19 | [markup] 20 | [markup.goldmark] 21 | [markup.goldmark.renderer] 22 | hardWraps = true 23 | unsafe = true 24 | xHTML = true 25 | [markup.highlight] 26 | codeFences = true 27 | lineNos = true 28 | lineNumbersInTable = true 29 | noClasses = false 30 | [markup.tableOfContents] 31 | endLevel = 4 32 | ordered = false 33 | startLevel = 2 34 | 35 | [outputs] 36 | home = ["HTML", "RSS", "SearchIndex"] 37 | 38 | [outputFormats] 39 | [outputFormats.SearchIndex] 40 | mediaType = "application/json" 41 | baseName = "index" 42 | isPlainText = true 43 | notAlternative = true 44 | 45 | [taxonomies] 46 | tag = "tags" 47 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/js/helper/fadeinout.js: -------------------------------------------------------------------------------- 1 | var fadeOut = function(node, duration) { 2 | node.style.opacity = 1; 3 | 4 | var start = performance.now(); 5 | 6 | requestAnimationFrame(function tick(timestamp) { 7 | var easing = (timestamp - start) / duration; 8 | node.style.opacity = Math.max(1 - easing, 0); 9 | 10 | if (easing < 1) { 11 | requestAnimationFrame(tick); 12 | } else { 13 | node.style.opacity = ''; 14 | node.style.display = 'none'; 15 | } 16 | }); 17 | } 18 | 19 | var fadeIn = function (node, duration) { 20 | if (getComputedStyle(node).display !== 'none') return; 21 | 22 | if (node.style.display === 'none') { 23 | node.style.display = ''; 24 | } else { 25 | node.style.display = 'block'; 26 | } 27 | node.style.opacity = 0; 28 | 29 | var start = performance.now(); 30 | 31 | requestAnimationFrame(function tick(timestamp) { 32 | var easing = (timestamp - start) / duration; 33 | node.style.opacity = Math.min(easing, 1); 34 | 35 | if (easing < 1) { 36 | requestAnimationFrame(tick); 37 | } else { 38 | node.style.opacity = ''; 39 | } 40 | }); 41 | } -------------------------------------------------------------------------------- /pkg/outputs/hugo/part.go: -------------------------------------------------------------------------------- 1 | package hugo 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/feloy/kubernetes-api-reference/pkg/kubernetes" 7 | "github.com/feloy/kubernetes-api-reference/pkg/outputs" 8 | ) 9 | 10 | // Part of a Hugo output 11 | // implements the outputs.Part interface 12 | type Part struct { 13 | hugo *Hugo 14 | name string 15 | } 16 | 17 | // AddChapter adds a chapter to the Part 18 | func (o Part) AddChapter(i int, name string, gv string, version *kubernetes.APIVersion, description string, importPrefix string) (outputs.Chapter, error) { 19 | title := name 20 | if version != nil && version.Stage != kubernetes.StageGA { 21 | title += " " + version.String() 22 | } 23 | chaptername, err := o.hugo.addChapter(o.name, name, version.String(), map[string]interface{}{ 24 | "title": title, 25 | "description": description, 26 | "draft": false, 27 | "collapsible": false, 28 | "weight": i + 1, 29 | }) 30 | if err != nil { 31 | return Chapter{}, fmt.Errorf("Error creating chapter %s/%s: %s", o.name, name, err) 32 | } 33 | 34 | return Chapter{ 35 | hugo: o.hugo, 36 | part: &o, 37 | name: chaptername, 38 | }, nil 39 | } 40 | -------------------------------------------------------------------------------- /website/themes/zzodoc/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2020 zzossig 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /cmd/cli/gvkeysmap.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "fmt" 5 | "sort" 6 | 7 | "github.com/feloy/kubernetes-api-reference/pkg/kubernetes" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | // GVKeysMap defines the `gvkeysmap` subcommand 12 | func GVKeysMap() *cobra.Command { 13 | cmd := &cobra.Command{ 14 | Use: "gvkeysmap", 15 | Short: "show the map between group/version and definition keys", 16 | Long: "show the map between group/version and definition keys", 17 | SilenceErrors: true, 18 | SilenceUsage: true, 19 | RunE: func(cmd *cobra.Command, args []string) error { 20 | file := cmd.Flag(fileOption).Value.String() 21 | spec, err := kubernetes.NewSpec(file) 22 | if err != nil { 23 | return err 24 | } 25 | gvs := make([]string, len(spec.GVToKey)) 26 | i := 0 27 | for gv := range spec.GVToKey { 28 | gvs[i] = gv 29 | i++ 30 | } 31 | sort.Strings(gvs) 32 | for _, gv := range gvs { 33 | keys := spec.GVToKey[gv] 34 | fmt.Printf("%s\n", gv) 35 | for _, key := range keys { 36 | fmt.Printf("\t%s\n", key) 37 | } 38 | } 39 | return nil 40 | }, 41 | } 42 | return cmd 43 | } 44 | -------------------------------------------------------------------------------- /cmd/cli/helpers.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "path" 5 | 6 | "github.com/feloy/kubernetes-api-reference/pkg/config" 7 | "github.com/feloy/kubernetes-api-reference/pkg/kubernetes" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | // prepareTOC loads Spec and Toc config, and completes TOC 12 | // by adding associates resources and not specifed resources in TOC 13 | func prepareTOC(cmd *cobra.Command) (*config.TOC, error) { 14 | file := cmd.Flag(fileOption).Value.String() 15 | spec, err := kubernetes.NewSpec(file) 16 | if err != nil { 17 | return nil, err 18 | } 19 | 20 | configDir := cmd.Flag(configDirOption).Value.String() 21 | toc, err := config.LoadTOC(path.Join(configDir, "toc.yaml")) 22 | err = toc.PopulateAssociates(spec) 23 | if err != nil { 24 | return nil, err 25 | } 26 | 27 | toc.AddOtherResources(spec) 28 | toc.Definitions = &spec.Swagger.Definitions 29 | toc.Actions = spec.Actions 30 | toc.Actions.Sort() 31 | 32 | // TODO browse directory 33 | categories, err := config.LoadCategories([]string{path.Join(configDir, "fields.yaml")}) 34 | if err != nil { 35 | return nil, err 36 | } 37 | toc.Categories = categories 38 | 39 | return toc, nil 40 | } 41 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/layout/_footer.scss: -------------------------------------------------------------------------------- 1 | .bot { 2 | @include themify($themes) { 3 | background-color: themed('navbar-background-color'); 4 | } 5 | } 6 | .footer { 7 | @include themify($themes) { 8 | border-top: 1px solid themed('border-line-color'); 9 | } 10 | 11 | padding: 1rem; 12 | text-align: center; 13 | 14 | &__section { 15 | @include flexbox(); 16 | @include flex-direction(column); 17 | @include flex-grow(1); 18 | @include align-items(flex-start); 19 | 20 | &--wrapper { 21 | @include flexbox(); 22 | @media only screen and (max-width: 600px) { 23 | @include flex-direction(column); 24 | } 25 | } 26 | 27 | &--title { 28 | font-family: $title-font; 29 | font-size: 1rem; 30 | font-weight: bold; 31 | margin: 1rem 0 0.5rem 0; 32 | } 33 | 34 | &--link { 35 | display: block; 36 | text-align: left; 37 | padding: 0.15rem 0.35rem; 38 | } 39 | } 40 | 41 | &__contents { 42 | width: 100%; 43 | margin: 2rem 0; 44 | 45 | @include flexbox(); 46 | @include align-items(flex-start); 47 | @include flex-direction(column); 48 | } 49 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/header/blog-header-text.html: -------------------------------------------------------------------------------- 1 | {{ if .Params.header }} 2 | {{ range .Params.header }} 3 | {{ if eq .type "text" }} 4 |
5 | {{ $header := . }} 6 | {{ if .title }} 7 | {{ range .title }} 8 |
9 | {{ . }} 10 |
11 | {{ end }} 12 | {{ end }} 13 | {{ if .spaceBetweenTitleSubtitle }} 14 |
15 | {{ end }} 16 | {{ if .subtitle }} 17 | {{ range .subtitle }} 18 |
19 | {{ . }} 20 |
21 | {{ end }} 22 | {{ end }} 23 |
24 | {{ end }} 25 | {{ end }} 26 | {{ end }} -------------------------------------------------------------------------------- /cmd/cli/resourceslist.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "fmt" 5 | "sort" 6 | 7 | "github.com/feloy/kubernetes-api-reference/pkg/kubernetes" 8 | "github.com/spf13/cobra" 9 | ) 10 | 11 | // ResourceslistCmd defines the `resourceslist` subcommand 12 | func ResourceslistCmd() *cobra.Command { 13 | cmd := &cobra.Command{ 14 | Use: "resourceslist", 15 | Short: "list k8s resources", 16 | Long: "list Kubernetes resources in the specification", 17 | SilenceErrors: true, 18 | SilenceUsage: true, 19 | RunE: func(cmd *cobra.Command, args []string) error { 20 | file := cmd.Flag(fileOption).Value.String() 21 | spec, err := kubernetes.NewSpec(file) 22 | if err != nil { 23 | return err 24 | } 25 | 26 | resources := spec.Resources 27 | i := 0 28 | keys := make([]string, len(*resources)) 29 | for k := range *resources { 30 | keys[i] = k.String() 31 | i++ 32 | } 33 | sort.Strings(keys) 34 | for _, k := range keys { 35 | rs := (*resources)[kubernetes.APIKind(k)] 36 | fmt.Println(k) 37 | for _, r := range rs { 38 | fmt.Println("\t" + r.GetGV()) 39 | } 40 | } 41 | return nil 42 | }, 43 | } 44 | return cmd 45 | } 46 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/_default/baseof.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{ block "title" . }}{{ .Title }} – {{ .Site.Title }}{{ end }} 8 | {{ partial "head/scripts" . }} 9 | {{ partialCached "head/styles" . }} 10 | {{ partial "head/meta" . }} 11 | {{ partial "head/meta_json_ld" . }} 12 | {{ partial "head/services" . }} 13 | 14 | 15 | 16 | 22 | 23 |
24 | {{ partial "drawer/drawer.html" . }} 25 | {{ partial "navbar/navbar.html" . }} 26 | {{ block "header" . }}{{ end }} 27 | {{ block "main" . }}{{ end }} 28 | {{ partial "footer/footer.html" . }} 29 |
30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/navbar/icons/select-lang.html: -------------------------------------------------------------------------------- 1 | {{ if $.Param "enableLangChange" }} 2 | 28 | {{ end }} -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/components/_breadcrumb.scss: -------------------------------------------------------------------------------- 1 | .breadcrumb { 2 | &[data-is-blog="true"] { 3 | margin: 1.5rem 1rem 0 1rem; 4 | padding-bottom: 1.5rem; 5 | 6 | @include themify($themes) { 7 | border-bottom: 1px solid themed('hr-color'); 8 | background-color: themed('breadcrumb-background-color'); 9 | } 10 | } 11 | 12 | &[data-is-blog="false"] { 13 | margin: auto 1rem; 14 | padding: 0.5rem 0; 15 | } 16 | 17 | ol { 18 | @include flexbox(); 19 | @include align-items(center); 20 | @include flex-wrap(wrap); 21 | } 22 | 23 | li { 24 | display: inline; 25 | font-size: 0.9rem; 26 | 27 | @include truncate(300px); 28 | 29 | a { 30 | @include themify($themes) { 31 | color: themed('breadcrumb-item-color'); 32 | @include on-event { 33 | color: themed('link-hover'); 34 | } 35 | } 36 | } 37 | 38 | &:last-child { 39 | @include themify($themes) { 40 | color: themed('breadcrumb-item-active-color'); 41 | } 42 | } 43 | } 44 | 45 | li+li:before { 46 | padding: 0.5rem; 47 | content: "»"; 48 | @include themify($themes) { 49 | color: themed('breadcrumb-item-color'); 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/pages/_list.scss: -------------------------------------------------------------------------------- 1 | #list-main { 2 | position: relative; 3 | 4 | @include flexbox(); 5 | @include flex-direction(column); 6 | @include themify($themes) { 7 | background-color: themed('body-background-color'); 8 | 9 | &[data-dir="ltr"] { 10 | border-right: 1px solid themed('border-line-color'); 11 | } 12 | 13 | &[data-dir="rtl"] { 14 | border-left: 1px solid themed('border-line-color'); 15 | } 16 | } 17 | } 18 | 19 | #list-menu { 20 | position: relative; 21 | 22 | @include themify($themes) { 23 | &[data-dir="ltr"] { 24 | border-right: 1px solid themed('border-line-color'); 25 | } 26 | 27 | &[data-dir="rtl"] { 28 | border-left: 1px solid themed('border-line-color'); 29 | } 30 | } 31 | } 32 | 33 | #list-side { 34 | position: relative; 35 | } 36 | 37 | .list-section { 38 | &__item { 39 | margin: auto; 40 | padding: 0.25rem 0; 41 | width: 95%; 42 | border-radius: 0.2rem; 43 | 44 | &--link { 45 | display: inline-block; 46 | font-size: 1rem; 47 | font-family: $title-font; 48 | margin-top: 0.5rem; 49 | margin-bottom: 0.125rem; 50 | } 51 | 52 | &--desc { 53 | font-size: 1rem; 54 | margin: 0.25rem 0; 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/abstracts/_variables.scss: -------------------------------------------------------------------------------- 1 | @import "../themes/theme"; 2 | 3 | $text-font-stack: 'Muli', 4 | avenir, 5 | 'helvetica neue', helvetica, 6 | ubuntu, 7 | roboto, noto, 8 | 'segoe ui', arial, 9 | sans-serif !default; 10 | $code-font-stack: Consolas, 11 | Monaco, 12 | Menlo, 13 | "DejaVu Sans Mono", 14 | "Bitstream Vera Sans Mono", 15 | "Courier New", 16 | "Lucida Console", 17 | "Lucida Sans Typewriter", 18 | "Liberation Mono", 19 | "Nimbus Mono L", 20 | Monaco, 21 | Courier, 22 | monospace !default; 23 | 24 | $z-indexes: ("drawer", "modal", "dropdown", "navbar", "header", "gtt", "clipboard", "grid", "search-btn", "search", "menu", "content", "landing", "footer", "taxo", "toc", "gallery-mask", "section-title", "highlight"); 25 | 26 | $breakpoints: ( 27 | 'xs': 0, 28 | 'sm': 600px, 29 | 'md': 960px, 30 | 'lg': 1280px, 31 | 'xl': 1960px, 32 | ); 33 | 34 | $grid-max-width: 1289px; 35 | $grid-nav-height: 50px; 36 | $grid-body-width: 769px; 37 | $grid-side-width: 240px; 38 | $drawer-width: 240px; 39 | $menu-title-height: 30px; -------------------------------------------------------------------------------- /pkg/formats/markdown/markdown.go: -------------------------------------------------------------------------------- 1 | package markdown 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | // Code returns 's' as code 9 | func Code(s string) string { 10 | return fmt.Sprintf("`%s`", s) 11 | } 12 | 13 | // Italic returns text s in italic 14 | func Italic(s string) string { 15 | return fmt.Sprintf("*%s*", s) 16 | } 17 | 18 | // Chapter returns a Level 2 mark 19 | func Chapter(name string) string { 20 | return fmt.Sprintf("\n## %s\n\n", name) 21 | } 22 | 23 | // Section returns a Level 3 mark 24 | func Section(name string) string { 25 | return fmt.Sprintf("\n### %s\n\n", name) 26 | } 27 | 28 | // Subsection returns a Level 4 mark 29 | func Subsection(name string) string { 30 | return fmt.Sprintf("\n#### %s\n", name) 31 | } 32 | 33 | // ListEntry returns a list entry 34 | func ListEntry(title string, content string, indentLevel int, nl bool) string { 35 | titleIndent := strings.Repeat(" ", indentLevel) + "- " 36 | descIndent := strings.Repeat(" ", indentLevel) + " " 37 | 38 | // Indent all lines 39 | parts := strings.Split(content, "\n") 40 | for i := range parts { 41 | parts[i] = descIndent + parts[i] 42 | } 43 | 44 | separator := "\n" 45 | if nl { 46 | separator = "\n\n" 47 | } 48 | return fmt.Sprintf("%s%s%s%s\n", titleIndent, title, separator, strings.Join(parts, "\n")) 49 | } 50 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/comments/changyan.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/main/component/pagination.html: -------------------------------------------------------------------------------- 1 | {{ $pag := $.Paginator }} 2 | {{ $window := $.Site.Params.paginateWindow | default 1 }} 3 | {{ if gt $pag.TotalPages 1 }} 4 | {{ $total := $pag.TotalPages }} 5 | {{ $size := add 5 (add $window $window) }} 6 | {{ $cur := $pag.PageNumber }} 7 | {{ if gt $total $size }} 8 | {{ if lt $cur (sub $size (add $window 1)) }} 9 | {{ $.Scratch.Set "show" (seq 1 (sub $size 2)) }} 10 | {{ else if lt (sub $total $cur) (sub $size (add $window 2)) }} 11 | {{ $.Scratch.Set "show" (seq (add (sub $total $size) 3) $total) }} 12 | {{ else }} 13 | {{ $.Scratch.Set "show" (seq (sub $cur $window) (add $cur $window)) }} 14 | {{ end }} 15 | {{ $.Scratch.Add "show" 1 }} 16 | {{ $.Scratch.Add "show" $total }} 17 | {{ else }} 18 | {{ $.Scratch.Set "show" (seq 1 $total) }} 19 | {{ end }} 20 | 31 | {{ end }} -------------------------------------------------------------------------------- /pkg/outputs/interface.go: -------------------------------------------------------------------------------- 1 | package outputs 2 | 3 | import ( 4 | "github.com/feloy/kubernetes-api-reference/pkg/kubernetes" 5 | ) 6 | 7 | // Output is an interface for output formats 8 | type Output interface { 9 | Prepare() error 10 | AddPart(i int, name string) (Part, error) 11 | Terminate() error 12 | } 13 | 14 | // Part is an interface to a part of an output 15 | type Part interface { 16 | AddChapter(i int, name string, gv string, version *kubernetes.APIVersion, description string, importPrefix string) (Chapter, error) 17 | } 18 | 19 | // Chapter is an interface to a chapter of an output 20 | type Chapter interface { 21 | SetAPIVersion(s string) error 22 | SetGoImport(s string) error 23 | AddSection(i int, name string, apiVersion *string) (Section, error) 24 | } 25 | 26 | // Section is an interface to a section of an output 27 | type Section interface { 28 | AddContent(s string) error 29 | AddTypeDefinition(s string) error 30 | StartPropertyList() error 31 | AddFieldCategory(name string) error 32 | AddProperty(name string, property *kubernetes.Property, linkend []string, indent bool, defname string, shortName string) error 33 | EndProperty() error 34 | EndPropertyList() error 35 | AddOperation(operation *kubernetes.ActionInfo, linkends kubernetes.LinkEnds) error 36 | AddDefinitionIndexEntry(d string) error 37 | } 38 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/components/_switch.scss: -------------------------------------------------------------------------------- 1 | /* The switch - the box around the slider */ 2 | .switch { 3 | position: absolute; 4 | right: -2rem; 5 | top: 1.75rem; 6 | display: inline-block; 7 | width: 30px; 8 | height: 16px; 9 | z-index: z('gtt'); 10 | } 11 | 12 | /* Hide default HTML checkbox */ 13 | .switch input { 14 | opacity: 0; 15 | width: 0; 16 | height: 0; 17 | } 18 | 19 | /* The slider */ 20 | .slider { 21 | position: absolute; 22 | cursor: pointer; 23 | top: 0; 24 | left: 0; 25 | right: 0; 26 | bottom: 0; 27 | background-color: transparent; 28 | -webkit-transition: .2s; 29 | transition: .2s; 30 | 31 | &:before { 32 | position: absolute; 33 | content: ""; 34 | height: 12px; 35 | width: 13px; 36 | left: 2px; 37 | bottom: 2px; 38 | -webkit-transition: .2s; 39 | transition: .2s; 40 | } 41 | 42 | &__icon { 43 | padding: 0.5rem; 44 | } 45 | } 46 | 47 | // input:checked + .slider { 48 | // @include themify($themes) { 49 | // background-color: transparent; 50 | // } 51 | // } 52 | 53 | // input:focus + .slider { 54 | // @include themify($themes) { 55 | // background-color: transparent; 56 | // } 57 | // } 58 | 59 | input:checked + .slider:before { 60 | -webkit-transform: translateX(13px); 61 | -ms-transform: translateX(13px); 62 | transform: translateX(13px); 63 | } -------------------------------------------------------------------------------- /pkg/outputs/hugo/hugo.go: -------------------------------------------------------------------------------- 1 | package hugo 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/feloy/kubernetes-api-reference/pkg/outputs" 7 | ) 8 | 9 | // Hugo output 10 | // implements the Output interface 11 | type Hugo struct { 12 | Directory string 13 | } 14 | 15 | // NewHugo returns a new Hugo 16 | func NewHugo(dir string) *Hugo { 17 | return &Hugo{Directory: dir} 18 | } 19 | 20 | // Prepare a new output 21 | func (o *Hugo) Prepare() error { 22 | err := o.addIndex("", map[string]interface{}{ 23 | "title": "Resources", 24 | }) 25 | if err != nil { 26 | return fmt.Errorf("Error writing index file in %s: %s", o.Directory, err) 27 | } 28 | return nil 29 | } 30 | 31 | // AddPart adds a part to the output 32 | func (o *Hugo) AddPart(i int, name string) (outputs.Part, error) { 33 | partname, err := o.addPart(name) 34 | if err != nil { 35 | return Part{}, fmt.Errorf("Error creating part %s: %s", name, err) 36 | } 37 | err = o.addIndex(partname, map[string]interface{}{ 38 | "title": name, 39 | "draft": false, 40 | "collapsible": true, 41 | "weight": i + 1, 42 | }) 43 | if err != nil { 44 | return Part{}, fmt.Errorf("Error writing index file for part %s: %s", name, err) 45 | } 46 | return Part{ 47 | hugo: o, 48 | name: partname, 49 | }, nil 50 | } 51 | 52 | // Terminate hugo document 53 | func (o *Hugo) Terminate() error { 54 | return nil 55 | } 56 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/comments/utterances.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 30 | -------------------------------------------------------------------------------- /pkg/outputs/kwebsite/part.go: -------------------------------------------------------------------------------- 1 | package kwebsite 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/feloy/kubernetes-api-reference/pkg/kubernetes" 7 | "github.com/feloy/kubernetes-api-reference/pkg/outputs" 8 | ) 9 | 10 | // Part of a KWebsite output 11 | // implements the outputs.Part interface 12 | type Part struct { 13 | kwebsite *KWebsite 14 | name string 15 | } 16 | 17 | // AddChapter adds a chapter to the Part 18 | func (o Part) AddChapter(i int, name string, gv string, version *kubernetes.APIVersion, description string, importPrefix string) (outputs.Chapter, error) { 19 | title := name 20 | if version != nil && version.Stage != kubernetes.StageGA { 21 | title += " " + version.String() 22 | } 23 | chaptername, err := o.kwebsite.addChapter(o.name, name, version.String(), map[string]interface{}{ 24 | "api_metadata": map[string]interface{}{ 25 | "apiVersion": gv, 26 | "import": importPrefix, 27 | "kind": name, 28 | }, 29 | "collapsible": false, 30 | "content_type": "api_reference", 31 | "description": description, 32 | "draft": false, 33 | "title": title, 34 | "weight": i + 1, 35 | }) 36 | if err != nil { 37 | return Chapter{}, fmt.Errorf("Error creating chapter %s/%s: %s", o.name, name, err) 38 | } 39 | 40 | return Chapter{ 41 | kwebsite: o.kwebsite, 42 | part: &o, 43 | name: chaptername, 44 | }, nil 45 | } 46 | -------------------------------------------------------------------------------- /cmd/cli/hugo.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/spf13/cobra" 7 | ) 8 | 9 | // Hugo defines the `hugo` subcommand 10 | func Hugo() *cobra.Command { 11 | cmd := &cobra.Command{ 12 | Use: "hugo", 13 | Short: "output specification for Hugo website", 14 | Long: "output the specification in a format usable for a Hugo website", 15 | SilenceErrors: true, 16 | SilenceUsage: true, 17 | RunE: func(cmd *cobra.Command, args []string) error { 18 | toc, err := prepareTOC(cmd) 19 | if err != nil { 20 | return fmt.Errorf("Unable to load specs and/or toc config: %v", err) 21 | } 22 | 23 | outputDir := cmd.Flag(outputDirOption).Value.String() 24 | err = toc.ToHugo(outputDir) 25 | if err != nil { 26 | return err 27 | } 28 | 29 | show, err := cmd.Flags().GetBool(showDefinitionsOption) 30 | if err != nil { 31 | return err 32 | } 33 | if show { 34 | toc.OutputDocumentedDefinitions() 35 | } 36 | return nil 37 | }, 38 | } 39 | cmd.Flags().StringP(configDirOption, "c", "", "Directory containing documentation configuration") 40 | cmd.MarkFlagRequired(configDirOption) 41 | cmd.Flags().StringP(outputDirOption, "o", "", "Directory to write markdown files") 42 | cmd.MarkFlagRequired(outputDirOption) 43 | cmd.Flags().Bool(showDefinitionsOption, false, "Show where definitions are defined on output") 44 | return cmd 45 | } 46 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/drawer/drawer.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | {{ .Site.Params.logoText }} 5 | 6 |
7 |
8 | {{ partial "svgs/close.svg" (dict "width" 22 "height" 22) }} 9 |
10 |
11 | 12 |
13 | {{ partial "main/sections/list-menu.html" . }} 14 |
15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/header/blog-header-img.html: -------------------------------------------------------------------------------- 1 | {{ if .Params.header }} 2 | {{ range .Params.header }} 3 | {{ if eq .type "img" }} 4 | 25 | {{ end }} 26 | {{ end }} 27 | {{ end }} -------------------------------------------------------------------------------- /pkg/config/categories.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "io/ioutil" 5 | 6 | "github.com/feloy/kubernetes-api-reference/pkg/kubernetes" 7 | "gopkg.in/yaml.v2" 8 | ) 9 | 10 | // FieldCategory is a list of fields regrouped in the same category 11 | type FieldCategory struct { 12 | Name string `yaml:"name"` 13 | Fields []string `yaml:"fields"` 14 | } 15 | 16 | // Category is the list of fields categories for a specific definition 17 | type Category struct { 18 | Definition kubernetes.Key `yaml:"definition"` 19 | FieldCategories []FieldCategory `yaml:"field_categories"` 20 | } 21 | 22 | // Categories is the list of fields categories for all definitions 23 | type Categories []Category 24 | 25 | // LoadCategories from a configuration file 26 | func LoadCategories(filenames []string) (Categories, error) { 27 | var result Categories 28 | for _, filename := range filenames { 29 | var fileCats Categories 30 | content, err := ioutil.ReadFile(filename) 31 | if err != nil { 32 | return result, err 33 | } 34 | err = yaml.Unmarshal(content, &fileCats) 35 | if err != nil { 36 | return result, err 37 | } 38 | result = append(result, fileCats...) 39 | } 40 | return result, nil 41 | } 42 | 43 | func (o Categories) Find(key kubernetes.Key) []FieldCategory { 44 | for _, category := range o { 45 | if category.Definition == key { 46 | return category.FieldCategories 47 | } 48 | } 49 | return nil 50 | } 51 | -------------------------------------------------------------------------------- /pkg/outputs/hugo/chapter.go: -------------------------------------------------------------------------------- 1 | package hugo 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/feloy/kubernetes-api-reference/pkg/formats/markdown" 7 | "github.com/feloy/kubernetes-api-reference/pkg/outputs" 8 | ) 9 | 10 | // Chapter of a Hugo output 11 | // implements the outputs.Chapter interface 12 | type Chapter struct { 13 | hugo *Hugo 14 | part *Part 15 | name string 16 | } 17 | 18 | // SetAPIVersion writes the APIVersion for a chapter 19 | func (o Chapter) SetAPIVersion(s string) error { 20 | err := o.hugo.addContent(o.part.name, o.name, markdown.Code("apiVersion: "+s)) 21 | if err != nil { 22 | return fmt.Errorf("Error adding GV for chapter %s/%s: %s", o.part.name, o.name, err) 23 | } 24 | return nil 25 | } 26 | 27 | // SetGoImport writes the Go import for a chapter 28 | func (o Chapter) SetGoImport(s string) error { 29 | err := o.hugo.addContent(o.part.name, o.name, markdown.Code("import \""+s+"\"")) 30 | if err != nil { 31 | return fmt.Errorf("Error adding Go Import for chapter %s/%s: %s", o.part.name, o.name, err) 32 | } 33 | return nil 34 | } 35 | 36 | // AddSection adds a section to the chapter 37 | func (o Chapter) AddSection(i int, name string, apiVersion *string) (outputs.Section, error) { 38 | err := o.hugo.addSection(o.part.name, o.name, name) 39 | if err != nil { 40 | return Section{}, err 41 | } 42 | return Section{ 43 | hugo: o.hugo, 44 | part: o.part, 45 | chapter: &o, 46 | }, nil 47 | } 48 | -------------------------------------------------------------------------------- /cmd/cli/kwebsite.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/spf13/cobra" 7 | ) 8 | 9 | // Hugo defines the `kwebsite` subcommand 10 | func KWebsite() *cobra.Command { 11 | cmd := &cobra.Command{ 12 | Use: "kwebsite", 13 | Short: "output specification for k/website", 14 | Long: "output the specification in a format usable for the Kubernetes website", 15 | SilenceErrors: true, 16 | SilenceUsage: true, 17 | RunE: func(cmd *cobra.Command, args []string) error { 18 | toc, err := prepareTOC(cmd) 19 | if err != nil { 20 | return fmt.Errorf("Unable to load specs and/or toc config: %v", err) 21 | } 22 | 23 | outputDir := cmd.Flag(outputDirOption).Value.String() 24 | err = toc.ToKWebsite(outputDir) 25 | if err != nil { 26 | return err 27 | } 28 | 29 | show, err := cmd.Flags().GetBool(showDefinitionsOption) 30 | if err != nil { 31 | return err 32 | } 33 | if show { 34 | toc.OutputDocumentedDefinitions() 35 | } 36 | return nil 37 | }, 38 | } 39 | cmd.Flags().StringP(configDirOption, "c", "", "Directory containing documentation configuration") 40 | cmd.MarkFlagRequired(configDirOption) 41 | cmd.Flags().StringP(outputDirOption, "o", "", "Directory to write markdown files") 42 | cmd.MarkFlagRequired(outputDirOption) 43 | cmd.Flags().Bool(showDefinitionsOption, false, "Show where definitions are defined on output") 44 | return cmd 45 | } 46 | -------------------------------------------------------------------------------- /pkg/outputs/kwebsite/kwebsite.go: -------------------------------------------------------------------------------- 1 | package kwebsite 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/feloy/kubernetes-api-reference/pkg/outputs" 7 | ) 8 | 9 | // KWebsite output 10 | // implements the Output interface 11 | type KWebsite struct { 12 | Directory string 13 | } 14 | 15 | // NewKWebsite returns a new KWebsite 16 | func NewKWebsite(dir string) *KWebsite { 17 | return &KWebsite{Directory: dir} 18 | } 19 | 20 | // Prepare a new output 21 | func (o *KWebsite) Prepare() error { 22 | err := o.addIndex("", map[string]interface{}{ 23 | "title": "Resources", 24 | }) 25 | if err != nil { 26 | return fmt.Errorf("Error writing index file in %s: %s", o.Directory, err) 27 | } 28 | return nil 29 | } 30 | 31 | // AddPart adds a part to the output 32 | func (o *KWebsite) AddPart(i int, name string) (outputs.Part, error) { 33 | partname, err := o.addPart(name) 34 | if err != nil { 35 | return Part{}, fmt.Errorf("Error creating part %s: %s", name, err) 36 | } 37 | err = o.addIndex(partname, map[string]interface{}{ 38 | "title": name, 39 | "draft": false, 40 | "collapsible": true, 41 | "weight": i + 1, 42 | }) 43 | if err != nil { 44 | return Part{}, fmt.Errorf("Error writing index file for part %s: %s", name, err) 45 | } 46 | return Part{ 47 | kwebsite: o, 48 | name: partname, 49 | }, nil 50 | } 51 | 52 | // Terminate kwebsite document 53 | func (o *KWebsite) Terminate() error { 54 | return nil 55 | } 56 | -------------------------------------------------------------------------------- /pkg/config/toc_test.go: -------------------------------------------------------------------------------- 1 | package config_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/feloy/kubernetes-api-reference/pkg/config" 7 | "github.com/feloy/kubernetes-api-reference/pkg/kubernetes" 8 | ) 9 | 10 | func TestLoadTOCv118(t *testing.T) { 11 | toc, err := config.LoadTOC("../../config/v1.18/toc.yaml") 12 | if err != nil { 13 | t.Errorf("should not get an error but got: %s", err) 14 | } 15 | if len(toc.Parts) != 9 { 16 | t.Errorf("Should get %d parts but got %d", 9, len(toc.Parts)) 17 | } 18 | } 19 | 20 | func TestPopulateAssociatesv118(t *testing.T) { 21 | spec, err := kubernetes.NewSpec("../../api/v1.18/swagger.json") 22 | if err != nil { 23 | t.Errorf("Error loding swagger file") 24 | } 25 | 26 | if len(spec.Swagger.Definitions) != 600 { 27 | t.Errorf("Spec should contain %d definition but contains %d", 600, len(spec.Swagger.Definitions)) 28 | } 29 | 30 | toc, err := config.LoadTOC("../../config/v1.18/toc.yaml") 31 | if err != nil { 32 | t.Errorf("Error loding toc file") 33 | } 34 | 35 | err = toc.PopulateAssociates(spec) 36 | if err != nil { 37 | t.Errorf("%s", err) 38 | } 39 | 40 | l := len(toc.Parts[0].Chapters[0].Sections) 41 | if l != 4 { 42 | t.Errorf("Pod chapter should contain %d sections but contains %d sections", 4, l) 43 | } 44 | 45 | if toc.Parts[0].Chapters[0].Key != "io.k8s.api.core.v1.Pod" { 46 | t.Errorf("Key of first chapter sould be %s but is %s", "io.k8s.api.core.v1.Pod", toc.Parts[0].Chapters[0].Key) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /pkg/outputs/kwebsite/chapter.go: -------------------------------------------------------------------------------- 1 | package kwebsite 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/feloy/kubernetes-api-reference/pkg/formats/markdown" 7 | "github.com/feloy/kubernetes-api-reference/pkg/outputs" 8 | ) 9 | 10 | // Chapter of a KWebsite output 11 | // implements the outputs.Chapter interface 12 | type Chapter struct { 13 | kwebsite *KWebsite 14 | part *Part 15 | name string 16 | } 17 | 18 | // SetAPIVersion writes the APIVersion for a chapter 19 | func (o Chapter) SetAPIVersion(s string) error { 20 | err := o.kwebsite.addContent(o.part.name, o.name, markdown.Code("apiVersion: "+s)+"\n") 21 | if err != nil { 22 | return fmt.Errorf("Error adding GV for chapter %s/%s: %s", o.part.name, o.name, err) 23 | } 24 | return nil 25 | } 26 | 27 | // SetGoImport writes the Go import for a chapter 28 | func (o Chapter) SetGoImport(s string) error { 29 | err := o.kwebsite.addContent(o.part.name, o.name, markdown.Code("import \""+s+"\"")+"\n") 30 | if err != nil { 31 | return fmt.Errorf("Error adding Go Import for chapter %s/%s: %s", o.part.name, o.name, err) 32 | } 33 | return nil 34 | } 35 | 36 | // AddSection adds a section to the chapter 37 | func (o Chapter) AddSection(i int, name string, apiVersion *string) (outputs.Section, error) { 38 | err := o.kwebsite.addSection(o.part.name, o.name, name) 39 | if err != nil { 40 | return Section{}, err 41 | } 42 | return Section{ 43 | kwebsite: o.kwebsite, 44 | part: o.part, 45 | chapter: &o, 46 | }, nil 47 | } 48 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/components/_drawer.scss: -------------------------------------------------------------------------------- 1 | .drawer { 2 | position: fixed; 3 | top: 0; 4 | left: -100%; 5 | z-index: z('drawer'); 6 | width: $drawer-width; 7 | height: 100%; 8 | 9 | @include transition(all, 0.3s, ease-out); 10 | @include themify($themes) { 11 | background-color: themed('body-background-color'); 12 | } 13 | 14 | &__header { 15 | height: $grid-nav-height; 16 | width: 100%; 17 | 18 | @include flexbox(); 19 | @include themify($themes) { 20 | background-color: themed('navbar-background-color'); 21 | box-shadow: 0 1px 0 rgba(12,13,14,0.1), 0 1px 6px rgba(60,65,70,0.1); 22 | } 23 | 24 | &--text { 25 | width: 100%; 26 | height: 100%; 27 | padding: 1rem; 28 | 29 | @include flexbox(); 30 | @include align-items(center); 31 | @include justify-content(flex-start); 32 | @include themify($themes) { 33 | color: themed('title-color'); 34 | } 35 | } 36 | } 37 | 38 | &__body { 39 | height: 100%; 40 | width: 100%; 41 | overflow-y: auto; 42 | } 43 | 44 | &__close { 45 | width: $grid-nav-height; 46 | height: 100%; 47 | cursor: pointer; 48 | 49 | @include flexbox(); 50 | @include align-items(center); 51 | @include justify-content(center); 52 | @include themify($themes) { 53 | color: themed('body-color'); 54 | @include on-event { 55 | color: themed('active-font-color'); 56 | } 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/layout/_header.scss: -------------------------------------------------------------------------------- 1 | .top { 2 | @include themify($themes) { 3 | background-color: themed('single-header-title-background-color'); 4 | } 5 | } 6 | 7 | .header { 8 | @include flexbox(); 9 | @include justify-content(center); 10 | @include align-items(center); 11 | @include flex-direction(column); 12 | 13 | &__wrapper { 14 | @include themify($themes) { 15 | border-bottom: 1px solid themed('border-line-color'); 16 | } 17 | 18 | .title { 19 | font-size: 3rem; 20 | font-weight: 900; 21 | font-family: $title-font; 22 | line-height: 3rem; 23 | overflow-wrap: break-word; 24 | margin: 2rem 1.5rem; 25 | 26 | @include themify($themes) { 27 | color: themed("title-color"); 28 | } 29 | } 30 | } 31 | } 32 | 33 | .blog-header { 34 | @include flexbox(); 35 | @include justify-content(center); 36 | @include flex-direction(column); 37 | 38 | &__title { 39 | line-height: 1.1; 40 | font-weight: 900; 41 | font-family: $title-font; 42 | font-size: 3rem; 43 | line-height: 3rem; 44 | overflow-wrap: break-word; 45 | 46 | @include themify($themes) { 47 | color: themed("title-color"); 48 | } 49 | } 50 | 51 | &__subtitle { 52 | line-height: 1.2; 53 | } 54 | 55 | &__align-left { 56 | @include align-items(flex-start); 57 | } 58 | 59 | &__align-center { 60 | @include align-items(center); 61 | } 62 | 63 | &__align-right { 64 | @include align-items(flex-end); 65 | } 66 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/components/_language.scss: -------------------------------------------------------------------------------- 1 | .lang { 2 | width: 100%; 3 | font-size: 17.2px; 4 | 5 | @include flexbox(); 6 | @include justify-content(space-between); 7 | @include align-items(center); 8 | 9 | &__dropdown { 10 | outline: none; 11 | cursor: pointer; 12 | border: none; 13 | 14 | @include flexbox(); 15 | @include align-items(center); 16 | @include justify-content(center); 17 | 18 | &--content { 19 | padding: 0.25rem 0; 20 | max-width: 120px; 21 | border-radius: 0.175rem; 22 | 23 | @include truncate(120px); 24 | @include box-shadow(0, 1px, 3px, 0, rgba(0, 0, 0, 0.4)); 25 | @include themify($themes) { 26 | background-color: themed('dropdown-background-color'); 27 | a { 28 | text-decoration: none; 29 | color: themed('body-color'); 30 | 31 | @include on-event { 32 | color: inherit; 33 | background-color: themed('dropdown-hover-background-color'); 34 | } 35 | 36 | &.active { 37 | font-weight: bold; 38 | color: themed('active-font-color'); 39 | background-color: themed('dropdown-item-active-background-color'); 40 | } 41 | } 42 | } 43 | } 44 | 45 | &--item { 46 | padding: 0.25rem 0.75rem; 47 | width: 100%; 48 | height: 100%; 49 | text-decoration: none; 50 | display: block; 51 | font-size: 1rem; 52 | 53 | @include truncate(120px); 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/data/flowchartjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "x": 0, 3 | "y": 0, 4 | "line-width": 3, 5 | "line-length": 50, 6 | "text-margin": 10, 7 | "font-size": 14, 8 | "font-color": "black", 9 | "line-color": "black", 10 | "element-color": "black", 11 | "fill": "white", 12 | "yes-text": "yes", 13 | "no-text": "no", 14 | "arrow-end": "block", 15 | "scale": 1, 16 | "symbols": { 17 | "start": { 18 | "font-color": "red", 19 | "element-color": "green", 20 | "fill": "yellow" 21 | }, 22 | "end": { 23 | "class": "end-element" 24 | } 25 | }, 26 | "flowstate": { 27 | "past": { 28 | "fill": "#CCCCCC", 29 | "font-size": 12 30 | }, 31 | "current": { 32 | "fill": "yellow", 33 | "font-color": "red", 34 | "font-weight": "bold" 35 | }, 36 | "future": { 37 | "fill": "#FFFF99" 38 | }, 39 | "request": { 40 | "fill": "blue" 41 | }, 42 | "invalid": { 43 | "fill": "#444444" 44 | }, 45 | "approved": { 46 | "fill": "#58C4A3", 47 | "font-size": 12, 48 | "yes-text": "APPROVED", 49 | "no-text": "n/a" 50 | }, 51 | "rejected": { 52 | "fill": "#C45879", 53 | "font-size": 12, 54 | "yes-text": "n/a", 55 | "no-text": "REJECTED" 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /xsl/api.xsl: -------------------------------------------------------------------------------- 1 | 2 | 17 | 20 | 21 | 22 | A4 23 | 1 24 | 1 25 | 1 26 | 27 | book toc,title 28 | part title 29 | 30 | 31 | wrap 32 | 33 | yes 34 | 1 35 | 36 | -------------------------------------------------------------------------------- /website/static/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "Kubernetes Reference", 4 | "short_name": "Kubernetes Reference", 5 | "version": "1.0.0", 6 | "default_locale": "en", 7 | "description": "Kubernetes Reference: Resources, kubectl", 8 | "start_url": "https://k8sref.io/", 9 | "icons": [ 10 | { 11 | "src": "favicon/android-icon-36x36.png", 12 | "sizes": "36x36", 13 | "type": "image/png", 14 | "density": "0.75" 15 | }, 16 | { 17 | "src": "favicon/android-icon-48x48.png", 18 | "sizes": "48x48", 19 | "type": "image/png", 20 | "density": "1.0" 21 | }, 22 | { 23 | "src": "favicon/android-icon-72x72.png", 24 | "sizes": "72x72", 25 | "type": "image/png", 26 | "density": "1.5" 27 | }, 28 | { 29 | "src": "favicon/android-icon-96x96.png", 30 | "sizes": "96x96", 31 | "type": "image/png", 32 | "density": "2.0" 33 | }, 34 | { 35 | "src": "favicon/android-icon-144x144.png", 36 | "sizes": "144x144", 37 | "type": "image/png", 38 | "density": "3.0" 39 | }, 40 | { 41 | "src": "favicon/android-icon-192x192.png", 42 | "sizes": "192x192", 43 | "type": "image/png", 44 | "density": "4.0" 45 | }, 46 | { 47 | "src": "favicon/android-icon-512x512.png", 48 | "sizes": "512x512", 49 | "type": "image/png", 50 | "density": "4.0" 51 | } 52 | ], 53 | "theme_color": "#0071bc", 54 | "background_color": "#fff", 55 | "display": "standalone" 56 | } 57 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/shortcodes/img.html: -------------------------------------------------------------------------------- 1 |
2 | {{ with .Get "link"}}{{ end }} 3 | {{ $base := (findRE "/[a-zA-Z0-9_]+/" .Site.BaseURL | default "/") }} 4 | 5 | {{ if .Get "link"}}{{ end }} 6 | {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}} 7 |
{{ if isset .Params "title" }} 8 | {{ .Get "title" }}:{{ end }} 9 | {{ if or (.Get "caption") (.Get "attr")}} 10 | {{ .Get "caption" }} 11 | {{ with .Get "attrlink"}} {{ end }} 12 | {{ .Get "attr" }} 13 | {{ if .Get "attrlink"}} {{ end }} 14 | {{ end }} 15 |
16 | {{ end }} 17 |
-------------------------------------------------------------------------------- /website/themes/zzodoc/assets/js/helper/getParents.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Get all DOM element up the tree that contain a class, ID, or data attribute 3 | * @param {Node} elem The base element 4 | * @param {String} selector The class, id, data attribute, or tag to look for 5 | * @return {Array} Null if no match 6 | */ 7 | var getParents = function (elem, selector) { 8 | 9 | var parents = []; 10 | var firstChar; 11 | if (selector) { 12 | firstChar = selector.charAt(0); 13 | } 14 | 15 | // Get matches 16 | for (; elem && elem !== document; elem = elem.parentNode) { 17 | if (selector) { 18 | 19 | // If selector is a class 20 | if (firstChar === '.') { 21 | if (elem.classList.contains(selector.substr(1))) { 22 | parents.push(elem); 23 | } 24 | } 25 | 26 | // If selector is an ID 27 | if (firstChar === '#') { 28 | if (elem.id === selector.substr(1)) { 29 | parents.push(elem); 30 | } 31 | } 32 | 33 | // If selector is a data attribute 34 | if (firstChar === '[') { 35 | if (elem.hasAttribute(selector.substr(1, selector.length - 1))) { 36 | parents.push(elem); 37 | } 38 | } 39 | 40 | // If selector is a tag 41 | if (elem.tagName.toLowerCase() === selector) { 42 | parents.push(elem); 43 | } 44 | 45 | } else { 46 | parents.push(elem); 47 | } 48 | 49 | } 50 | 51 | // Return parents if any exist 52 | if (parents.length === 0) { 53 | return null; 54 | } else { 55 | return parents; 56 | } 57 | 58 | }; -------------------------------------------------------------------------------- /website/themes/zzodoc/data/lib.toml: -------------------------------------------------------------------------------- 1 | # js 2 | [js.mermaid] 3 | sri = "sha256-wV/0jM5E/0V+KqyxUio2Ve5OAC/gweTTqdbnRX1fgAE=" 4 | url = "https://cdn.jsdelivr.net/npm/mermaid@8.4.6/dist/mermaid.min.js" 5 | 6 | [js.katex] 7 | sri = "sha256-F/Xda58SPdcUCr+xhSGz9MA2zQBPb0ASEYKohl8UCHc=" 8 | url = "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" 9 | 10 | [js.katex_auto_render] 11 | sri = "sha256-90d2pnfw0r4K8CZAWPko4rpFXQsZvJhTBGYNkipDprI=" 12 | url = "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" 13 | 14 | [js.flowchartjs] 15 | sri = "sha256-xghRsaOFJXNxT9sgANknngHh3FjUQWrJUae7GP+2Atc=" 16 | url = "https://cdn.jsdelivr.net/npm/flowchart.js@1.12.0/release/flowchart.min.js" 17 | 18 | [js.raphael] 19 | sri = "sha256-TabprKdeNXbSesCWLMrcbWSDzUhpAdcNPe5Q53rn9Yg=" 20 | url = "https://cdn.jsdelivr.net/npm/raphael@2.3.0/raphael.min.js" 21 | 22 | [js.mathjax] 23 | url = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js" 24 | 25 | [js.chart] 26 | sri = "sha256-R4pqcOYV8lt7snxMQO/HSbVCFRPMdrhAFMH+vr9giYI=" 27 | url = "https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.min.js" 28 | [js.viz] 29 | sri = "" # no sri 30 | url = "https://cdn.jsdelivr.net/npm/viz.js@2.1.2/viz.min.js" 31 | 32 | [js.viz_render] 33 | sri = "sha256-Ogqs510LFnekr9o7OLdpelaaAmNss9egQRTyzCqV2NQ=" 34 | url = "https://cdn.jsdelivr.net/npm/viz.js@2.1.2/full.render.js" 35 | 36 | 37 | # css 38 | [css.katex] 39 | sri = "sha256-V8SV2MO1FUb63Bwht5Wx9x6PVHNa02gv8BgH/uH3ung=" 40 | url = "https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" -------------------------------------------------------------------------------- /website/themes/zzodoc/static/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "Hugo Zdoc theme", 4 | "short_name": "Hugo Zdoc theme", 5 | "version": "1.0.0", 6 | "default_locale": "en", 7 | "description": "Hugo simple documentation theme", 8 | "start_url": "https://themes.gohugo.io/theme/hugo-theme-zdoc/", 9 | "icons": [ 10 | { 11 | "src": "favicon/android-icon-36x36.png", 12 | "sizes": "36x36", 13 | "type": "image/png", 14 | "density": "0.75" 15 | }, 16 | { 17 | "src": "favicon/android-icon-48x48.png", 18 | "sizes": "48x48", 19 | "type": "image/png", 20 | "density": "1.0" 21 | }, 22 | { 23 | "src": "favicon/android-icon-72x72.png", 24 | "sizes": "72x72", 25 | "type": "image/png", 26 | "density": "1.5" 27 | }, 28 | { 29 | "src": "favicon/android-icon-96x96.png", 30 | "sizes": "96x96", 31 | "type": "image/png", 32 | "density": "2.0" 33 | }, 34 | { 35 | "src": "favicon/android-icon-144x144.png", 36 | "sizes": "144x144", 37 | "type": "image/png", 38 | "density": "3.0" 39 | }, 40 | { 41 | "src": "favicon/android-icon-192x192.png", 42 | "sizes": "192x192", 43 | "type": "image/png", 44 | "density": "4.0" 45 | }, 46 | { 47 | "src": "favicon/android-icon-512x512.png", 48 | "sizes": "512x512", 49 | "type": "image/png", 50 | "density": "4.0" 51 | } 52 | ], 53 | "theme_color": "#FF6188", 54 | "background_color": "#2D2A2E", 55 | "display": "standalone" 56 | } 57 | -------------------------------------------------------------------------------- /cmd/cli/cli.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "strings" 7 | 8 | "github.com/spf13/cobra" 9 | "github.com/spf13/viper" 10 | ) 11 | 12 | const ( 13 | fileOption = "file" 14 | configDirOption = "config-dir" 15 | outputDirOption = "output-dir" 16 | showDefinitionsOption = "show-definitions" 17 | ) 18 | 19 | // RootCmd defines the root cli command 20 | func RootCmd() *cobra.Command { 21 | cmd := &cobra.Command{ 22 | Use: "kubernetes-api-reference", 23 | Short: "K8s API documentation tools", 24 | Long: `Tool to build documentation from OpenAPI specification of the Kubernetes API`, 25 | SilenceErrors: true, 26 | SilenceUsage: true, 27 | PreRun: func(cmd *cobra.Command, args []string) { 28 | viper.BindPFlags(cmd.Flags()) 29 | }, 30 | RunE: func(cmd *cobra.Command, args []string) error { 31 | return nil 32 | }, 33 | } 34 | 35 | cmd.PersistentFlags().StringP(fileOption, "f", "", "OpenAPI spec file") 36 | cmd.MarkFlagRequired(fileOption) 37 | 38 | subcommands := []func() *cobra.Command{ 39 | ResourceslistCmd, ShowTOCCmd, GVKeysMap, Hugo, Docbook, KWebsite, 40 | } 41 | for _, subcommand := range subcommands { 42 | cmd.AddCommand(subcommand()) 43 | } 44 | 45 | cobra.OnInitialize(initConfig) 46 | 47 | viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_")) 48 | return cmd 49 | } 50 | 51 | // Run the cli 52 | func Run() { 53 | if err := RootCmd().Execute(); err != nil { 54 | fmt.Println(err) 55 | os.Exit(1) 56 | } 57 | } 58 | 59 | func initConfig() { 60 | viper.AutomaticEnv() 61 | } 62 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/pages/_home.scss: -------------------------------------------------------------------------------- 1 | .home { 2 | &__landing { 3 | width: 100%; 4 | 5 | @include flexbox(); 6 | @include align-items(center); 7 | @include justify-content(center); 8 | 9 | @media only screen and (max-width: 600px) { 10 | @include flex-direction(column); 11 | } 12 | 13 | &--img { 14 | margin: 0.5rem; 15 | z-index: z('landing'); 16 | } 17 | 18 | &--txt { 19 | margin: 2.5rem 0.5rem; 20 | z-index: z('landing'); 21 | 22 | .title { 23 | font-size: 56px; 24 | font-weight: 900; 25 | font-family: $title-font; 26 | } 27 | 28 | .text { 29 | font-size: 22px; 30 | } 31 | 32 | @media only screen and (max-width: 600px) { 33 | text-align: center; 34 | } 35 | } 36 | 37 | &--link { 38 | text-decoration: none !important; 39 | } 40 | 41 | &--btn { 42 | margin-top: 2.5rem; 43 | margin-right: 0.5rem; 44 | } 45 | 46 | &--btn2 { 47 | margin: 0.5rem; 48 | } 49 | } 50 | 51 | &__social { 52 | width: 100%; 53 | padding: 1rem 0; 54 | 55 | @include flexbox(); 56 | @include justify-content(center); 57 | 58 | &--item { 59 | margin: 0 0.25rem; 60 | } 61 | } 62 | 63 | &__banner { 64 | width: 100%; 65 | padding: 0.75rem; 66 | 67 | @include flexbox(); 68 | @include justify-content(center); 69 | 70 | &--wrapper { 71 | @include themify($themes) { 72 | background-color: themed('banner-background-color'); 73 | } 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/head/meta_json_ld.html: -------------------------------------------------------------------------------- 1 | 48 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/footer/footer.html: -------------------------------------------------------------------------------- 1 | {{ if $.Param "enableFooter" }} 2 |
3 | 39 |
40 | {{ end }} -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/components/_toc.scss: -------------------------------------------------------------------------------- 1 | .toc { 2 | position: -webkit-sticky; 3 | position: sticky; 4 | top: $grid-nav-height; 5 | padding: 0.5rem; 6 | margin: 0.5rem; 7 | margin-top: 0; 8 | padding-top: 1.25rem; 9 | height: calc(100vh - $grid-nav-height); 10 | overflow-y: auto; 11 | font-size: 0.85rem; 12 | z-index: z('toc'); 13 | @include no-select; 14 | 15 | #TableOfContents { 16 | position: relative; 17 | } 18 | 19 | &__label { 20 | font-family: $title-font; 21 | font-size: 1rem; 22 | margin-top: 0.65rem; 23 | margin-bottom: 1rem; 24 | margin-left: 1.25rem; 25 | padding-bottom: 0.5rem; 26 | 27 | @include themify($themes) { 28 | color: themed('toc-label-color'); 29 | } 30 | } 31 | 32 | @include themify($themes) { 33 | a { 34 | color: themed('toc-color'); 35 | position: relative; 36 | 37 | @include on-event { 38 | color: themed('link-hover'); 39 | } 40 | 41 | &.active { 42 | color: themed('active-font-color'); 43 | 44 | &::before { 45 | background-color: themed('active-font-color'); 46 | content: ''; 47 | height: 11px; 48 | left: -8px; 49 | margin: 0.25rem 0; 50 | position: absolute; 51 | width: 2px; 52 | &:last-child { 53 | background-color: transparent; 54 | } 55 | } 56 | } 57 | } 58 | } 59 | 60 | ul { 61 | li { 62 | li { 63 | margin-left: 0.85rem; 64 | } 65 | } 66 | } 67 | } 68 | 69 | .expand__content { 70 | #TableOfContents { 71 | ul { 72 | list-style-type: circle; 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/components/_alert.scss: -------------------------------------------------------------------------------- 1 | .alert { 2 | padding: 0.75rem; 3 | margin-bottom: 1rem; 4 | border: 1px solid transparent; 5 | border-radius: 0.125rem; 6 | 7 | @include themify($themes) { 8 | &-info { 9 | background-color: rgba(215, 238, 249, 0.4); 10 | color: themed('body-color'); 11 | 12 | &[data-dir="rtl"] { 13 | border-right: 5px solid #bbdefb; 14 | } 15 | 16 | &[data-dir="ltr"] { 17 | border-left: 5px solid #bbdefb; 18 | } 19 | } 20 | 21 | &-success { 22 | background-color: rgba(217, 239, 214, 0.4); 23 | color: themed('body-color'); 24 | 25 | &[data-dir="rtl"] { 26 | border-right: 5px solid #c8e6c9; 27 | } 28 | 29 | &[data-dir="ltr"] { 30 | border-left: 5px solid #c8e6c9; 31 | } 32 | } 33 | 34 | &-warning { 35 | background-color: rgba(255, 249, 196, 0.4); 36 | color: themed('body-color'); 37 | 38 | &[data-dir="rtl"] { 39 | border-right: 5px solid #ffeb3b; 40 | } 41 | 42 | &[data-dir="ltr"] { 43 | border-left: 5px solid #ffeb3b; 44 | } 45 | } 46 | 47 | &-danger { 48 | background-color: rgba(245, 221, 221, 0.4); 49 | color: themed('body-color'); 50 | 51 | &[data-dir="rtl"] { 52 | border-right: 5px solid #ffcdd2; 53 | } 54 | 55 | &[data-dir="ltr"] { 56 | border-left: 5px solid #ffcdd2; 57 | } 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /pkg/outputs/docbook/chapter.go: -------------------------------------------------------------------------------- 1 | package docbook 2 | 3 | import ( 4 | "github.com/feloy/kubernetes-api-reference/pkg/formats/dbxml" 5 | "github.com/feloy/kubernetes-api-reference/pkg/outputs" 6 | x "github.com/shabbyrobe/xmlwriter" 7 | ) 8 | 9 | // DocbookChapter represents a Docbook chapter 10 | type DocbookChapter struct { 11 | id string 12 | w *x.Writer 13 | } 14 | 15 | // SetAPIVersion writes the APIVersion for a chapter 16 | func (o DocbookChapter) SetAPIVersion(s string) error { 17 | o.w.StartElem(x.Elem{Name: "para"}) 18 | o.w.StartElem(dbxml.ElemWithText("varname", "apiVersion: "+s)) 19 | o.w.EndElem("varname") 20 | o.w.EndElem("para") 21 | return nil 22 | } 23 | 24 | // SetGoImport writes the Go import for a chapter 25 | func (o DocbookChapter) SetGoImport(s string) error { 26 | o.w.StartElem(x.Elem{Name: "para"}) 27 | o.w.StartElem(dbxml.ElemWithText("varname", "import \""+s+"\"")) 28 | o.w.EndElem("varname") 29 | o.w.EndElem("para") 30 | return nil 31 | } 32 | 33 | // AddSection adds a section to the Docbook chapter 34 | func (o DocbookChapter) AddSection(i int, name string, apiVersion *string) (outputs.Section, error) { 35 | if i > 0 { 36 | o.w.EndToDepth(sectionDepth, x.ElemNode, "sect1") 37 | } 38 | section := dbxml.Section("sect1", name) 39 | err := o.w.StartElem(section) 40 | if err != nil { 41 | return DocbookSection{}, err 42 | } 43 | o.w.WriteAttr(x.Attr{ 44 | Name: "id", 45 | Value: escapeName(o.id + "." + name), 46 | }) 47 | err = o.w.WriteAttr(x.Attr{ 48 | Name: "renderas", 49 | Value: "sect2", 50 | }) 51 | if apiVersion != nil { 52 | o.w.StartElem(dbxml.IndexTerm("resources", name, *apiVersion)) 53 | o.w.EndElem("indexterm") 54 | } 55 | if err != nil { 56 | return DocbookSection{}, err 57 | } 58 | return DocbookSection{w: o.w}, nil 59 | } 60 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/main/component/pagination-single.html: -------------------------------------------------------------------------------- 1 | {{ if or .PrevInSection .NextInSection }} 2 |
3 | 42 | {{ end }} 43 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/components/_button.scss: -------------------------------------------------------------------------------- 1 | .button { 2 | border: none; 3 | outline: none; 4 | padding: 0.75rem; 5 | border-radius: 0.25rem; 6 | text-decoration: none; 7 | cursor: pointer; 8 | 9 | @include transition(all, 0.15s, ease-in); 10 | 11 | &[data-color="default"] { 12 | @include themify($themes) { 13 | color: themed('body-background-color'); 14 | border: 1px solid darken(themed('landing-button-default'), 15%); 15 | background-color: themed('landing-button-default'); 16 | 17 | @include on-event { 18 | color: themed('body-background-color'); 19 | border: 1px solid darken(themed('landing-button-default'), 15%); 20 | background-color: lighten(themed('landing-button-default'), 8%); 21 | } 22 | } 23 | } 24 | 25 | &[data-color="primary"] { 26 | @include themify($themes) { 27 | color: themed('body-background-color'); 28 | border: 1px solid darken(themed('landing-button-primary'), 15%); 29 | background-color: themed('landing-button-primary'); 30 | 31 | @include on-event { 32 | color: themed('body-background-color'); 33 | border: 1px solid darken(themed('landing-button-primary'), 15%); 34 | background-color: lighten(themed('landing-button-primary'), 8%); 35 | } 36 | } 37 | } 38 | } 39 | 40 | .editBtn { 41 | border: none; 42 | outline: none; 43 | padding: 0.75rem; 44 | margin: 0 0.95rem; 45 | text-decoration: none; 46 | cursor: pointer; 47 | font-family: $title-font; 48 | background-color: transparent; 49 | 50 | @include themify($themes) { 51 | color: themed('landing-button-default'); 52 | @include on-event { 53 | color: themed('body-color'); 54 | background-color: themed('dropdown-hover-background-color'); 55 | } 56 | } 57 | 58 | @media only screen and (max-width: 600px) { 59 | display: none; 60 | } 61 | } -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/components/_expand.scss: -------------------------------------------------------------------------------- 1 | .expand { 2 | position: relative; 3 | border-radius: 0.25rem; 4 | 5 | &__content { 6 | overflow: hidden; 7 | max-height: 0; 8 | border-bottom-left-radius: 0.25rem; 9 | border-bottom-right-radius: 0.25rem; 10 | 11 | @include transition(all, 0.2s, ease); 12 | 13 | li { 14 | font-size: 15.2px; 15 | margin: 0 0 0.525rem 2rem !important; 16 | 17 | &:first-child { 18 | margin-top: 0.25rem !important; 19 | } 20 | 21 | li { 22 | font-size: 14.4px; 23 | margin: 0 0 0.25rem 1.25rem !important; 24 | } 25 | } 26 | 27 | &--toc { 28 | font-family: $title-font; 29 | font-size: 15.2px; 30 | li { 31 | list-style-type: '📂 '; 32 | li { 33 | list-style-type: '📄 '; 34 | } 35 | } 36 | } 37 | } 38 | 39 | &__button { 40 | cursor: pointer; 41 | width: 100%; 42 | padding: 0.5rem; 43 | text-align: left; 44 | outline: none; 45 | border: none; 46 | font-size: 1rem; 47 | font-family: $title-font; 48 | 49 | @include flexbox(); 50 | @include align-items(center); 51 | @include themify($themes) { 52 | color: inherit; 53 | border-top: 1px solid themed('border-line-color'); 54 | background-color: themed('expand-background-color'); 55 | @include on-event { 56 | background-color: themed('expand-background-color-hover'); 57 | } 58 | } 59 | } 60 | 61 | &-label { 62 | cursor: pointer; 63 | @include flexbox(); 64 | @include align-items(center); 65 | } 66 | 67 | &-icon { 68 | padding-top: 0.125rem; 69 | padding-right: 0.5rem; 70 | 71 | &__down { 72 | @include rotate(90); 73 | @include transition(all, 0.15s, ease); 74 | } 75 | 76 | &__right { 77 | @include rotate(0); 78 | @include transition(all, 0.15s, ease); 79 | } 80 | } 81 | } -------------------------------------------------------------------------------- /website/content/en/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Kubernetes Reference 3 | description: Kubernetes Reference 4 | date: 2020-03-31T04:15:05+09:00 5 | draft: false 6 | landing: 7 | parts: 8 | - height: 500 9 | image: favicon/kubernetes.png 10 | title: 11 | - Resources 12 | text: 13 | - From the OpenAPI specification v1.19.0 14 | titleColor: 15 | textColor: 16 | spaceBetweenTitleText: 25 17 | buttons: 18 | - link: docs/workloads 19 | text: WORKLOADS 20 | color: primary 21 | - link: docs/services 22 | text: SERVICES 23 | color: primary 24 | - link: docs/config-and-storage 25 | text: CONFIG & STORAGE 26 | color: primary 27 | - link: docs/authentication 28 | text: AUTHN 29 | color: primary 30 | - link: docs/authorization 31 | text: AUTHZ 32 | color: primary 33 | - link: docs/policies 34 | text: POLICIES 35 | color: primary 36 | - link: docs/extend 37 | text: EXTEND 38 | color: primary 39 | - link: docs/cluster 40 | text: CLUSTER 41 | color: primary 42 | - link: https://buy-from-amazon.k8sref.io 43 | text: GET the BOOK 44 | color: normal 45 | # - height: 350 46 | # image: favicon/kubernetes.png 47 | # title: 48 | # - kubectl 49 | # text: 50 | # - Kubernetes command-line interface v1.18.0 51 | # titleColor: 52 | # textColor: 53 | # spaceBetweenTitleText: 25 54 | # buttons: 55 | # - link: kubectl/part1 56 | # text: GETTING STARTED 57 | # color: primary 58 | # - link: kubectl/part2 59 | # text: APP MANAGEMENT 60 | # color: primary 61 | # - link: kubectl/part3 62 | # text: WORKING WITH APPS 63 | # color: primary 64 | # - link: kubectl/part4 65 | # text: CLUSTER MANAGEMENT 66 | # color: primary 67 | # - link: kubectl/part5 68 | # text: SETTINGS & USAGE 69 | # color: primary 70 | 71 | --- 72 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/themes/_light.scss: -------------------------------------------------------------------------------- 1 | $light: ( 2 | link: $light-link-color, 3 | link-hover: $light-link-hover-color, 4 | body-color: #242729, 5 | hr-color: #bdbdbd, 6 | title-color: #424242, 7 | subtitle-color: darken(#424242, 5%), 8 | border-line-color: rgba(12, 13, 14, 0.1), 9 | active-font-color: $light-active-font-color, 10 | body-background-color: #fff, 11 | back-background-color: #f7f8f9, 12 | navbar-background-color: #fafafa, 13 | navbar-hover-background-color: rgba(225,225,225,0.4), 14 | navbar-logo-color: $light-nav-logo-color, 15 | navbar-menu-color: $light-nav-menu-color, 16 | navbar-icon-color: $light-nav-icon-color, 17 | search-border-outline-color: rgba(207, 216, 220, 0.6), 18 | search-border-active-color: #b0bec5, 19 | search-background-color: #fff, 20 | search-placeholder-color: #aaa, 21 | search-content-background-color: #f1f1f1, 22 | search-hover-background-color: #eaeaea, 23 | search-hover-border-color: #addafc, 24 | search-border-color: #e0e0e0, 25 | search-highlight-color: #FF6188, 26 | custom-scrollbar-foreground-color: #cfd8dc, 27 | custom-scrollbar-background-color: #FCFCFA, 28 | dropdown-hover-background-color: rgba(225,225,225,0.4), 29 | dropdown-background-color: #fff, 30 | dropdown-item-active-background-color: #e0e0e0, 31 | menu-arrow-color: #535a61, 32 | pagination-color: #535a61, 33 | toc-color: #919191, 34 | banner-background-color: #eee, 35 | landing-button-primary: $light-active-font-color, 36 | landing-button-default: #535a61, 37 | pagination-link-color: #424242, 38 | pagination-background-color: #eee, 39 | pagination-disabled-color: #bdbdbd, 40 | pagination-number-color: #757575, 41 | breadcrumb-background-color: #fff, 42 | single-hr-background-color: #bdbdbd, 43 | single-blockquote-border-color: #bdbdbd, 44 | single-header-title-background-color: #eee, 45 | single-contents-title-color: #607d8b, 46 | expand-background-color: #f7f8f9, 47 | expand-background-color-hover: darken(#f7f8f9, 3%), 48 | tag-num-background-color: #bdbdbd, 49 | tag-text-background-color: #eee, 50 | ); -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/_default/summary.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
{{ .Title }}
4 |
5 | {{ partial "main/component/article-meta.html" . }} 6 |
7 |
8 | {{ $params := .Params }} 9 |
10 |
11 | {{ with $params.Description }} 12 | {{ . }} 13 | {{ else }} 14 | {{ .Summary }} 15 | {{ end }} 16 |
17 | {{ if $params.image }} 18 |
19 | 20 | {{ $.Param 21 | 22 |
23 | {{ else if $params.featured_video }} 24 | {{ with print ("videos/poster/" | relURL) $params.featured_video_poster }} 25 |
26 | 31 |
32 | {{ end }} 33 | {{ end }} 34 |
35 | 42 |
-------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/layout/_grid.scss: -------------------------------------------------------------------------------- 1 | #zz_container { 2 | display: grid; 3 | grid-template-columns: 1fr; 4 | grid-template-rows: $grid-nav-height auto 1fr auto; 5 | grid-column-gap: 20px; 6 | grid-row-gap: 0px; 7 | 8 | @if $enable-navbar == true { 9 | grid-template-rows: $grid-nav-height auto 1fr auto; 10 | } @else { 11 | grid-template-rows: 0 auto 1fr auto; 12 | } 13 | 14 | width: 100%; 15 | max-width: 100%; 16 | min-height: 100vh; 17 | margin-left: auto; 18 | margin-right: auto; 19 | position: relative; 20 | 21 | @include justify-content(center); 22 | @include themify($themes) { 23 | color: themed('body-color'); 24 | } 25 | } 26 | 27 | .nav { grid-area: 1 / 1 / 2 / 2; } 28 | .top { grid-area: 2 / 1 / 3 / 2; } 29 | .mid { grid-area: 3 / 1 / 4 / 2; } 30 | .bot { grid-area: 4 / 1 / 5 / 2; } 31 | 32 | 33 | 34 | .divider { 35 | display: grid; 36 | height: 100%; 37 | grid-template-columns: minmax(200px, 240px) minmax(350px, 769px) minmax(200px, 240px); 38 | grid-template-rows: auto; 39 | grid-column-gap: 0px; 40 | grid-row-gap: 0px; 41 | 42 | @include justify-content(center); 43 | @media only screen and (max-width: 769px) { 44 | grid-template-columns: minmax(0, $grid-side-width) minmax(0, $grid-body-width) minmax(0, $grid-side-width); 45 | } 46 | } 47 | 48 | .l { grid-area: 1 / 1 / 2 / 2; } // left 49 | .m { grid-area: 1 / 2 / 2 / 3; } // middle 50 | .r { grid-area: 1 / 3 / 2 / 4; } // right 51 | .lm { grid-area: 1 / 1 / 2 / 3; } // left middle 52 | .mr { grid-area: 1 / 2 / 2 / 4; } // middle right 53 | .lmr { grid-area: 1 / 1 / 2 / 4; } // left middle right 54 | 55 | 56 | 57 | .sv { // single view 58 | display: grid; 59 | grid-template-rows: 1fr; 60 | grid-column-gap: 0px; 61 | grid-row-gap: 0px; 62 | 63 | &[data-view="full"] { 64 | grid-template-columns: 769px; 65 | } 66 | 67 | &[data-view="mobile"] { 68 | width: 100%; 69 | grid-template-columns: 1fr; 70 | } 71 | } 72 | 73 | .blog { 74 | grid-area: 1 / 1 / 2 / 2; 75 | } 76 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/themes/_dark.scss: -------------------------------------------------------------------------------- 1 | $dark: ( 2 | link: $dark-link-color, 3 | link-hover: $dark-link-hover-color, 4 | body-color: #FCFCFA, 5 | hr-color: #595B5C, 6 | title-color: #FCFCFA, 7 | subtitle-color: darken(#FCFCFA, 5%), 8 | border-line-color: rgba(243, 242, 241, 0.1), 9 | active-font-color: $dark-active-font-color, 10 | body-background-color: #2D2A2E, 11 | back-background-color: #212121, 12 | navbar-background-color: #403E41, 13 | navbar-hover-background-color: rgba(225,225,225,0.4), 14 | navbar-logo-color: $dark-nav-logo-color, 15 | navbar-menu-color: $dark-nav-menu-color, 16 | navbar-icon-color: $dark-nav-icon-color, 17 | search-border-active-color: #424242, 18 | search-border-outline-color: rgba(166, 166, 166, 0.45), 19 | search-background-color: lighten(#403E41, 5%), 20 | search-placeholder-color: #999, 21 | search-content-background-color: lighten(#403E41, 5%), 22 | search-hover-background-color: #403E41, 23 | search-hover-border-color: #403E41, 24 | search-border-color: #383838, 25 | search-highlight-color: #FF6188, 26 | custom-scrollbar-foreground-color: #888, 27 | custom-scrollbar-background-color: #eee, 28 | dropdown-hover-background-color: #727072, 29 | dropdown-background-color: #595B5C, 30 | dropdown-item-active-background-color: #424242, 31 | menu-arrow-color: #FCFCFA, 32 | pagination-color: #FCFCFA, 33 | toc-color: #aaa, 34 | banner-background-color: darken(#212121, 3%), 35 | landing-button-primary: $dark-active-font-color, 36 | landing-button-default: #ccc, 37 | pagination-link-color: #82aaff, 38 | pagination-disabled-color: #757575, 39 | pagination-number-color: #FCFCFA, 40 | breadcrumb-background-color: #2D2A2E, 41 | single-hr-background-color: #727072, 42 | single-blockquote-border-color: #FCFCFA, 43 | single-contents-title-color: #ccc, 44 | single-header-title-background-color: #212121, 45 | single-contents-subtitle-color: #FCFCFA, 46 | expand-background-color: darken(#2D2A2E, 2%), 47 | expand-background-color-hover: #212121, 48 | tag-num-background-color: #595B5C, 49 | tag-text-background-color: #595B5C, 50 | ); -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/components/_pagination.scss: -------------------------------------------------------------------------------- 1 | .pagination { 2 | border-radius: 0.25rem; 3 | margin: 2rem 1rem; 4 | padding: 0.5rem 0; 5 | 6 | @include flexbox(); 7 | @include align-items(center); 8 | @include justify-content(center); 9 | 10 | li { 11 | border-radius: 0.25rem; 12 | &.disabled { 13 | a { 14 | @include on-event { 15 | @include themify($themes) { 16 | color: themed('pagination-number-color'); 17 | text-decoration: none; 18 | } 19 | } 20 | } 21 | } 22 | 23 | &.active { 24 | font-weight: bold; 25 | a { 26 | @include themify($themes) { 27 | color: themed('link-hover'); 28 | border-bottom: 5px solid themed('pagination-number-color'); 29 | } 30 | } 31 | } 32 | } 33 | 34 | a { 35 | font-size: 1.25rem; 36 | padding: 0.5rem 0.75rem; 37 | @include themify($themes) { 38 | color: themed('pagination-number-color'); 39 | @include on-event { 40 | color: themed('link-hover'); 41 | } 42 | } 43 | } 44 | } 45 | 46 | .pagination-single { 47 | margin: 1rem 0; 48 | padding-top: 0.75rem; 49 | 50 | @include flexbox(); 51 | @include align-items(center); 52 | @include justify-content(center); 53 | @include flex-wrap(wrap); 54 | 55 | &__left, 56 | &__right { 57 | padding: 0.25rem; 58 | border-radius: 0.125rem; 59 | 60 | @include truncate($grid-body-width); 61 | @include flexbox(); 62 | @include align-items(center); 63 | @include justify-content(center); 64 | @include themify($themes) { 65 | color: themed('pagination-color'); 66 | } 67 | 68 | &-title { 69 | font-size: 16.8px; 70 | @include truncate($grid-body-width); 71 | } 72 | } 73 | 74 | &__left { 75 | @include on-event { 76 | 77 | } 78 | } 79 | 80 | &__right { 81 | @include on-event { 82 | 83 | } 84 | } 85 | 86 | &__icon { 87 | border-radius: 100%; 88 | margin: 0 0.5rem; 89 | color: inherit; 90 | 91 | svg { 92 | display: block; 93 | margin: auto; 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/_default/taxonomy.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |
3 |
4 |
5 |
6 | {{ partial "header/taxo-header.html" . }} 7 |
8 |
9 |
10 | 11 |
12 |
13 |
14 | {{ range $index, $element := .Site.Taxonomies.tags }} 15 | {{ if $index }} 16 | 17 | 18 | {{ $element.Page.Title }} 19 | 20 | 21 | {{ printf "%#v" (len $element) }} 22 | 23 | 24 | {{ end }} 25 | {{ end }} 26 |
27 |
28 |
29 |
30 | 31 |
32 |
33 |
34 |
35 | {{ range .RegularPages }} 36 | {{ .Render "summary" }} 37 | {{ end }} 38 | {{ partial "main/component/pagination.html" . }} 39 |
40 |
41 | 42 |
43 |
44 | 45 | 72 | {{ end }} -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/main.scss: -------------------------------------------------------------------------------- 1 | $enable-navbar: {{ .Param "enableNavbar" }}; 2 | 3 | $title-font: {{ .Site.Data.font.title_font }}; 4 | $content-font: {{ .Site.Data.font.content_font }}; 5 | 6 | $dark-active-font-color: {{ .Site.Data.color.dark_active_font_color }}; 7 | $dark-link-color: {{ .Site.Data.color.dark_link_color }}; 8 | $dark-link-hover-color: {{ .Site.Data.color.dark_link_hover_color }}; 9 | $dark-nav-logo-color: {{ .Site.Data.color.dark_nav_logo_color }}; 10 | $dark-nav-menu-color: {{ .Site.Data.color.dark_nav_menu_color }}; 11 | $dark-nav-icon-color: {{ .Site.Data.color.dark_nav_icon_color }}; 12 | 13 | $light-active-font-color: {{ .Site.Data.color.light_active_font_color }}; 14 | $light-link-color: {{ .Site.Data.color.light_link_color }}; 15 | $light-link-hover-color: {{ .Site.Data.color.light_link_hover_color }}; 16 | $light-nav-logo-color: {{ .Site.Data.color.light_nav_logo_color }}; 17 | $light-nav-menu-color: {{ .Site.Data.color.light_nav_menu_color }}; 18 | $light-nav-icon-color: {{ .Site.Data.color.light_nav_icon_color }}; 19 | 20 | @import 'abstracts/variables'; 21 | @import 'abstracts/mixins'; 22 | @import 'abstracts/functions'; 23 | @import 'abstracts/flexbox'; 24 | 25 | @import 'syntax/syntax'; 26 | 27 | @import 'base/reset'; 28 | @import 'base/fonts'; 29 | @import 'base/helpers'; 30 | @import 'base/typography'; 31 | @import 'base/animation'; 32 | 33 | @import 'components/menu'; 34 | @import 'components/toc'; 35 | @import 'components/search'; 36 | @import 'components/dropdown'; 37 | @import 'components/drawer'; 38 | @import 'components/modal'; 39 | @import 'components/language'; 40 | @import 'components/breadcrumb'; 41 | @import 'components/pagination'; 42 | @import 'components/button'; 43 | @import 'components/summary'; 44 | @import 'components/expand'; 45 | @import 'components/bgcolor'; 46 | @import 'components/tag'; 47 | @import 'components/section'; 48 | @import 'components/lib'; 49 | @import 'components/switch'; 50 | @import 'components/notice'; 51 | @import 'components/alert'; 52 | 53 | @import 'layout/grid'; 54 | @import 'layout/footer'; 55 | @import 'layout/header'; 56 | @import 'layout/main'; 57 | @import 'layout/navbar'; 58 | 59 | @import 'pages/home'; 60 | @import 'pages/single'; 61 | @import 'pages/list'; 62 | @import 'pages/blog'; -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/blog/section.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |
3 |
4 |
5 |
6 | {{ partial "header/blog-header.html" . }} 7 |
8 |
9 |
10 | 11 |
12 |
13 |
14 | {{ range $index, $element := .Site.Taxonomies.tags }} 15 | {{ if $index }} 16 | 17 | 18 | {{ $element.Page.Title }} 19 | 20 | 21 | {{ printf "%#v" (len $element) }} 22 | 23 | 24 | {{ end }} 25 | {{ end }} 26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | {{ $paginator := .Paginate (where .RegularPages "Type" .Type) }} 35 | {{ range $paginator.Pages }} 36 | {{ .Render "summary" }} 37 | {{ end }} 38 | {{ partial "main/component/pagination.html" . }} 39 |
40 |
41 |
42 |
43 | 44 | 71 | {{ end }} -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/main/list.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 9 | 10 |
11 | {{ partial "main/component/toggle-sidebar.html" .context }} 12 | {{ partial "main/sections/list-main.html" .context }} 13 | {{ if .section_to_display }} 14 | {{ partial "main/sections/list-section.html" (dict "section_to_display" .section_to_display) }} 15 | {{ end }} 16 | {{ partial "main/component/pagination-single.html" .context }} 17 |
18 | 19 |
20 |
21 | 22 |
23 |
24 | 25 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/blog/single.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |
3 |
4 | 5 | 7 | 8 |
9 | {{ if $.Param "enableBlogBreadcrumb" }} 10 | {{ partial "main/component/breadcrumb.html" . }} 11 | {{ end }} 12 | {{ partial "main/component/toggle-sidebar.html" . }} 13 | {{ partial "main/sections/list-main.html" . }} 14 | {{ partial "main/component/pagination-single.html" . }} 15 |
16 | 17 |
18 | {{ if $.Param "enableToc" }} 19 | {{ partial "main/component/toc.html" . }} 20 | {{ end }} 21 |
22 | 23 |
24 |
25 | 26 | {{ partial "script/single-script.html" . }} 27 | 68 | {{ end }} -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/_default/rss.xml: -------------------------------------------------------------------------------- 1 | {{ printf "" | safeHTML }} 2 | 3 | 4 | {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} 5 | {{ .Permalink }} 6 | Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} 7 | Hugo -- gohugo.io{{ with .Site.Language.Lang }} 8 | {{.}}{{end}}{{ with $.Site.Params.email }} 9 | {{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}{{end}}{{ with .Site.Params.email }} 10 | {{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} 11 | {{.}}{{end}}{{ if not .Date.IsZero }} 12 | {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} 13 | {{ with .OutputFormats.Get "RSS" }} 14 | {{ printf "" .Permalink .MediaType | safeHTML }} 15 | {{ end }} 16 | 17 | {{ if .IsHome }} 18 | {{ range .Site.RegularPages }} 19 | 20 | {{ .Title }} 21 | {{ .Permalink }} 22 | {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} 23 | {{ with .Site.Params.email }}{{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}{{end}} 24 | {{ .Permalink }} 25 | {{ .Summary | html }} 26 | 27 | {{ end }} 28 | {{ else }} 29 | {{ range .Pages }} 30 | 31 | {{ .Title }} 32 | {{ .Permalink }} 33 | {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} 34 | {{ with .Site.Params.email }}{{.}}{{ with $.Site.Params.myname }} ({{.}}){{end}}{{end}} 35 | {{ .Permalink }} 36 | {{ .Summary | html }} 37 | 38 | {{ end }} 39 | {{ end }} 40 | 41 | -------------------------------------------------------------------------------- /website/themes/zzodoc/layouts/partials/main/single.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 9 | 10 |
11 | {{ partial "main/component/toggle-sidebar.html" . }} 12 | {{ partial "main/sections/list-main.html" . }} 13 | {{ partial "main/component/pagination-single.html" . }} 14 | {{ partial "comments/comments.html" . }} 15 |
16 | 17 |
18 | {{ if $.Param "enableToc" }} 19 | {{ partial "main/component/toc.html" . }} 20 | {{ end }} 21 |
22 | 23 |
24 |
25 | 26 | {{ partial "script/single-script.html" . }} 27 | -------------------------------------------------------------------------------- /pkg/kubernetes/resource.go: -------------------------------------------------------------------------------- 1 | package kubernetes 2 | 3 | import ( 4 | "fmt" 5 | "sort" 6 | 7 | "github.com/go-openapi/spec" 8 | ) 9 | 10 | // Resource represent a Kubernetes API resource 11 | type Resource struct { 12 | Key Key 13 | GVKExtension 14 | Definition spec.Schema 15 | 16 | // Replaced indicates if this version is replaced by another one 17 | ReplacedBy *Key 18 | // Documented indicates if this resource was included in the TOC 19 | Documented bool 20 | } 21 | 22 | // LessThan returns true if 'o' is a newer version than 'p' 23 | func (o *Resource) LessThan(p *Resource) bool { 24 | return o.Group.Replaces(p.Group) || (o.Group == p.Group && p.Version.LessThan(&o.Version)) 25 | } 26 | 27 | // Replaces returns true if 'o' replaces 'p' 28 | func (o *Resource) Replaces(p *Resource) bool { 29 | return o.Group.Replaces(p.Group) || o.Version.Replaces(&p.Version) 30 | } 31 | 32 | // Equals returns true if a resource is referenced by group/version/kind 33 | func (o *Resource) Equals(group APIGroup, version APIVersion, kind APIKind) bool { 34 | return o.Group == group && o.Version.Equals(&version) && o.Kind == kind 35 | } 36 | 37 | // GetGV returns the group/version of a resource (used for apiVersion:) 38 | func (o *Resource) GetGV() string { 39 | if o.Group == "" { 40 | return o.Version.String() 41 | } 42 | return fmt.Sprintf("%s/%s", o.Group, o.Version.String()) 43 | } 44 | 45 | // ResourceList is the list of resources for a given Kind 46 | type ResourceList []*Resource 47 | 48 | func (a ResourceList) Len() int { return len(a) } 49 | func (a ResourceList) Swap(i, j int) { a[i], a[j] = a[j], a[i] } 50 | func (a ResourceList) Less(i, j int) bool { return a[i].LessThan(a[j]) } 51 | 52 | // ResourceMap contains a map of resources, classified by Kind 53 | type ResourceMap map[APIKind]ResourceList 54 | 55 | // Add a resource to the resource list 56 | func (o *ResourceMap) Add(resource *Resource) { 57 | list, ok := (*o)[resource.Kind] 58 | if ok { 59 | for _, otherResource := range list { 60 | if resource.Replaces(otherResource) { 61 | otherResource.ReplacedBy = &resource.Key 62 | } else if otherResource.Replaces(resource) { 63 | resource.ReplacedBy = &otherResource.Key 64 | } 65 | } 66 | list = append(list, resource) 67 | } else { 68 | list = []*Resource{resource} 69 | } 70 | sort.Sort(list) 71 | (*o)[resource.Kind] = list 72 | } 73 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Kubernetes Resources Reference 2 | 3 | Tool to create documentation of the Kubernetes API. 4 | 5 | Get a printed book at: 6 | 7 | - US: https://www.amazon.com/dp/B08GV3ZLNS 8 | - UK: https://www.amazon.co.uk/dp/B08GV3ZLNS 9 | - DE: https://www.amazon.de/dp/B08GV3ZLNS 10 | - FR: https://www.amazon.fr/dp/B08GV3ZLNS 11 | - ES: https://www.amazon.es/dp/B08GV3ZLNS 12 | - IT: https://www.amazon.it/dp/B08GV3ZLNS 13 | - JP: https://www.amazon.co.jp/dp/B08GV3ZLNS 14 | - CA: https://www.amazon.ca/dp/B08GV3ZLNS 15 | 16 | ## Usage 17 | 18 | ### Web output 19 | 20 | ```sh 21 | make website 22 | make serve 23 | ``` 24 | 25 | ### PDF output 26 | 27 | ```sh 28 | make pdf FORMAT=A4 29 | make pdf FORMAT=USletter 30 | ``` 31 | 32 | ## OpenAPI specification 33 | 34 | The source of truth for the Kubernetes API is an OpenAPI specification. A standard OpenAPI specification describes: 35 | 36 | - a list of *Definitions*, 37 | - a list of *Paths*, each describing a list of *Operations*. 38 | 39 | ## Kubernetes extensions 40 | 41 | https://github.com/kubernetes/kubernetes/tree/master/api/openapi-spec 42 | 43 | Kubernetes API extends OpenAPI using these extensions: 44 | 45 | - `x-kubernetes-group-version-kind`: 46 | - Definitions associated with a Kubernetes *Resource* use this extension to declare the GVK to which the resource belongs. 47 | - Operations use this extension to declare on which Kubernetes resource they operate. 48 | - `x-kubernetes-action`: OpenAPI Operations (get, post, etc) are mapped to Kubernetes API *actions* (get, list, watch, etc) with this extension. 49 | - `x-kubernetes-patch-strategy`: a comma-separated list of strategic merge patch strategies supported by a field of a Kubernetes resource. 50 | - `x-kubernetes-patch-merge-key`: when a field supports the `merge` strategy, this extension indicates the key used to identify the fields to merge. 51 | - `x-kubernetes-list-type`: atomic, map, set. Applicable to lists. atomic and set apply to lists with scalar elements only. map applies to lists of nested types only. If configured as atomic, the entire list is replaced during merge; a single manager manages the list as a whole at any one time. If granular, different managers can manage entries separately. 52 | - `x-kubernetes-list-map-keys`: Only applicable when x-kubernetes-list-type=map. A slice of strings whose values in combination must uniquely identify list entries. 53 | - `x-kubernetes-unions` 54 | -------------------------------------------------------------------------------- /pkg/kubernetes/parmeters.go: -------------------------------------------------------------------------------- 1 | package kubernetes 2 | 3 | import ( 4 | "strings" 5 | 6 | "github.com/go-openapi/spec" 7 | ) 8 | 9 | // ParameterIn represenets the position of a parameter of an operation 10 | type ParameterIn string 11 | 12 | var paramInOrder = map[ParameterIn]int8{ 13 | "path": 0, 14 | "body": 1, 15 | "query": 2, 16 | } 17 | 18 | // ParametersAnnex indicates the common parameters 19 | // that are displayed in an annex 20 | var ParametersAnnex = map[string]struct{}{} 21 | 22 | // LessThan returns true if o appears before p in the natural order 23 | func (o ParameterIn) LessThan(p ParameterIn) bool { 24 | return paramInOrder[o] < paramInOrder[p] 25 | } 26 | 27 | // ParametersList is a list of parameters 28 | type ParametersList []spec.Parameter 29 | 30 | func (a ParametersList) Len() int { return len(a) } 31 | func (a ParametersList) Swap(i, j int) { a[i], a[j] = a[j], a[i] } 32 | func (a ParametersList) Less(i, j int) bool { 33 | if a[i].In == a[j].In { 34 | return a[i].Name < a[j].Name 35 | } 36 | return ParameterIn(a[i].In).LessThan(ParameterIn(a[j].In)) 37 | } 38 | 39 | // Add a parameter to the list 40 | func (a *ParametersList) Add(parameter spec.Parameter) { 41 | desc := parameter.Description 42 | if strings.Contains(strings.ToLower(desc), "deprecated") { 43 | return 44 | } 45 | *a = append(*a, parameter) 46 | } 47 | 48 | // ParameterInAnnex returns true if param is displayed in annex 49 | func ParameterInAnnex(param spec.Parameter) bool { 50 | _, found := ParametersAnnex[param.Name] 51 | return found 52 | } 53 | 54 | type descriptionInfo struct { 55 | Description string 56 | count int 57 | } 58 | 59 | type ResourcesMap map[string][]descriptionInfo 60 | 61 | var ResourcesDescriptions = ResourcesMap{} 62 | 63 | func (o *ResourcesMap) add(param spec.Parameter) { 64 | if _, ok := (*o)[param.Name]; !ok { 65 | (*o)[param.Name] = []descriptionInfo{ 66 | { 67 | Description: param.Description, 68 | count: 1, 69 | }, 70 | } 71 | } else { 72 | list := (*o)[param.Name] 73 | for k, descInfo := range list { 74 | if descInfo.Description == param.Description { 75 | (*o)[param.Name][k].count++ 76 | return 77 | } 78 | } 79 | (*o)[param.Name] = append((*o)[param.Name], descriptionInfo{ 80 | Description: param.Description, 81 | count: 1, 82 | }) 83 | } 84 | } 85 | 86 | func (o ResourcesMap) addActionParameters(params *ParametersList) { 87 | for _, param := range *params { 88 | o.add(param) 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Philippe Martin 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | default: 16 | @echo "commands: clean, docbook, pdf, pdf-6x9in, epub, clean-website, website, serve" 17 | 18 | clean: 19 | rm -rf build 20 | 21 | docbook: clean build/k8s-api.xml 22 | 23 | build/k8s-api.xml: $(wildcard *.go **/*.go) $(wildcard api/v1.19/* config/v1.19/*) 24 | mkdir -p build 25 | go run cmd/main.go docbook --config-dir config/v1.19/ --file api/v1.19/swagger.json > build/k8s-api.xml 26 | 27 | 28 | FORMAT ?= USletter 29 | pdf: build/k8s-api.xml 30 | (cd build && \ 31 | mkdir -p pdf-$(FORMAT) && \ 32 | cd pdf-$(FORMAT) && \ 33 | xsltproc --stringparam fop1.extensions 1 --stringparam paper.type $(FORMAT) -o k8s-api-$(FORMAT).fo ../../xsl/api.xsl ../k8s-api.xml && \ 34 | fop -pdf k8s-api-$(FORMAT).pdf -fo k8s-api-$(FORMAT).fo && \ 35 | rm k8s-api-$(FORMAT).fo) 36 | 37 | pdf-6x9in: build/k8s-api.xml 38 | (cd build && \ 39 | mkdir -p pdf && \ 40 | cd pdf && \ 41 | xsltproc --stringparam fop1.extensions 1 -o k8s-api.fo ../../xsl/api-6x9in.xsl ../k8s-api.xml && \ 42 | fop -pdf k8s-api.pdf -fo k8s-api.fo && \ 43 | rm k8s-api.fo) 44 | 45 | epub: build/k8s-api.xml 46 | (cd build && \ 47 | rm -rf epub && mkdir -p epub && \ 48 | cd epub && \ 49 | xsltproc -o k8s.epub /usr/share/xml/docbook/stylesheet/docbook-xsl/epub3/chunk.xsl ../k8s-api.xml && \ 50 | zip -r k8s.epub META-INF mimetype OEBPS && \ 51 | rm -rf META-INF mimetype OEBPS) 52 | 53 | clean-website: 54 | rm -rf website/content/en/docs/* website/public 55 | 56 | website: clean-website 57 | mkdir -p website/content/en/docs 58 | go run cmd/main.go hugo --config-dir config/v1.19/ --file api/v1.19/swagger.json --output-dir website/content/en/docs 59 | (cd website && hugo) 60 | 61 | clean-kwebsite: 62 | rm -rf kwebsite/content/en/docs/* kwebsite/public 63 | 64 | kwebsite: clean-kwebsite 65 | mkdir -p kwebsite/content/en/docs 66 | go run cmd/main.go kwebsite --config-dir config/v1.19/ --file api/v1.19/swagger.json --output-dir kwebsite/content/en/docs 67 | 68 | serve: 69 | (cd website/public && python3 -m http.server) 70 | -------------------------------------------------------------------------------- /website/themes/zzodoc/assets/sass/components/_summary.scss: -------------------------------------------------------------------------------- 1 | .summary-card { 2 | padding: 1rem; 3 | padding-bottom: 0; 4 | margin: 1.5rem 0; 5 | position: relative; 6 | 7 | @include themify($themes) { 8 | background-color: themed('body-background-color'); 9 | border-bottom: 1px solid themed('hr-color'); 10 | } 11 | 12 | .title { 13 | text-align: center; 14 | a { 15 | font-family: $title-font; 16 | font-weight: 700; 17 | word-break: break-word; 18 | 19 | @include themify($themes) { 20 | color: themed('link'); 21 | @include on-event { 22 | color: themed('link-hover'); 23 | } 24 | } 25 | } 26 | } 27 | 28 | .subtitle { 29 | padding: 1rem 0; 30 | 31 | @include flexbox(); 32 | @include align-items(center); 33 | @include justify-content(center); 34 | @include themify($themes) { 35 | color: themed('meta-color'); 36 | } 37 | } 38 | 39 | &__links { 40 | font-size: 0.8rem; 41 | 42 | @include flexbox(); 43 | @include flex-wrap(wrap); 44 | @include themify($themes) { 45 | background-color: themed('body-background-color'); 46 | } 47 | } 48 | 49 | &__tag { 50 | margin-right: 0.5rem; 51 | margin-bottom: 0.35rem; 52 | padding: 0.125rem 0.25rem; 53 | border-top-left-radius: 0.15rem; 54 | border-top-right-radius: 0.15rem; 55 | cursor: pointer; 56 | 57 | @include themify($themes) { 58 | border: 1px solid themed('hr-color'); 59 | border-bottom: none; 60 | } 61 | } 62 | 63 | &__content { 64 | margin-bottom: 1rem; 65 | 66 | @include flexbox(); 67 | @include flex-direction(column); 68 | @include justify-content(center); 69 | } 70 | 71 | &__text { 72 | margin-top: 1rem; 73 | line-height: 1.7rem; 74 | } 75 | 76 | &__image { 77 | width: 100%; 78 | height: 100%; 79 | 80 | &-wrapper { 81 | height: 100%; 82 | width: auto; 83 | margin: 0 auto; 84 | padding: 1rem 0; 85 | padding-bottom: 0; 86 | } 87 | } 88 | 89 | &__video { 90 | width: 100%; 91 | max-height: 500px; 92 | object-fit: contain; 93 | 94 | &-wrapper { 95 | padding: 1rem; 96 | padding-bottom: 0; 97 | } 98 | } 99 | 100 | hr { 101 | margin-top: 1.5rem; 102 | @include themify($themes) { 103 | border-top: 1px solid themed('hr-color'); 104 | } 105 | } 106 | &:not(:last-child) { 107 | hr { 108 | margin-bottom: 4rem; 109 | } 110 | } 111 | &:last-child { 112 | hr { 113 | margin-bottom: 2rem; 114 | } 115 | } 116 | } --------------------------------------------------------------------------------