Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions assets/js/kubectl-ref-index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
document.addEventListener('DOMContentLoaded', function() {
const search = document.getElementById('kubectl-cmd-search');
const expandBtn = document.getElementById('kubectl-expand-all');
const collapseBtn = document.getElementById('kubectl-collapse-all');
const container = document.getElementById('kubectl-cmd-list');

if (!container) return;

const entries = container.querySelectorAll('details.kubectl-cmd-entry');

const entryTexts = Array.from(entries).map(function(el) {
const summary = el.querySelector('summary');
const subs = el.querySelectorAll('.kubectl-subcmd-list li');
let text = summary ? summary.textContent.toLowerCase() : '';
for (const sub of subs) {
text += ' ' + sub.textContent.toLowerCase();
}
return text;
});

if (search) {
search.addEventListener('input', function() {
const term = search.value.toLowerCase().trim();

entries.forEach(function(el, i) {
if (!term || entryTexts[i].includes(term)) {
el.classList.remove('hidden');
if (term) el.open = true;
} else {
el.classList.add('hidden');
}
});
});
}

if (expandBtn) {
expandBtn.addEventListener('click', function() {
for (const el of entries) el.open = true;
});
}

if (collapseBtn) {
collapseBtn.addEventListener('click', function() {
for (const el of entries) el.open = false;
});
}
});
4 changes: 2 additions & 2 deletions assets/scss/_custom.scss
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are styles for documentation, so the best place for them is in the documentation SCSS.

Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,11 @@ footer .row > .order-3 { flex: 0 0 16.6667%; max-width: 16.6667%; }
color: $dark-text-color-1;

.kubeweekly-inner form p {
color: $white;
color: $white;
}

a.kubeweekly-signup, a.kubeweekly-signup:hover {
color: $white;
color: $white;
}
}

Expand Down
21 changes: 20 additions & 1 deletion assets/scss/_documentation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,25 @@ details:not([open]) > summary:after {
display: inline-block;
}

// kubectl reference index page
#kubectl-cmd-search {
width: 50%;
}

.kubectl-reference-index {
details.kubectl-cmd-entry > summary {
cursor: pointer;
}

details.kubectl-cmd-entry:not([open]) > summary:after {
content: none;
}

.kubectl-cmd-entry.hidden {
display: none;
}
}

// glossary

body.glossary {
Expand Down Expand Up @@ -565,4 +584,4 @@ main {
.math .katex .base {
overflow-x: scroll;
width: 100%;
}
}
5 changes: 3 additions & 2 deletions content/en/docs/reference/kubectl/generated/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "kubectl reference"
title: kubectl reference
layout: kubectl-all-subcommands
content_type: tool-reference
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, this has a weight (maybe it's an input to the generator)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. before it was a manually created file and not auto generated. Will have to revert this and try the hugo build approach

weight: 10
---

2 changes: 2 additions & 0 deletions content/en/docs/reference/kubectl/generated/kubectl.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
kubectl controls the Kubernetes cluster manager
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl alpha
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Commands for features in alpha
no_list: true
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl alpha kuberc
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Manage kuberc configuration files
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl alpha kuberc set
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Set values in the kuberc configuration
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl alpha kuberc view
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Display the current kuberc configuration
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl annotate
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Update the annotations on a resource
no_list: true
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl api-resources
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Print the supported API resources on the server
no_list: true
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl api-versions
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Print the supported API versions on the server, in the form of "group/version"
no_list: true
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl apply
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Apply a configuration to a resource by file name or stdin
no_list: true
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl apply edit-last-applied
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Edit latest last-applied-configuration annotations of a resource/object
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl apply set-last-applied
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Set the last-applied-configuration annotation on a live object to match the contents of a file
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl apply view-last-applied
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
View the latest last-applied-configuration annotations of a resource/object
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl attach
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Attach to a running container
no_list: true
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl auth
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Inspect authorization
no_list: true
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl auth can-i
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Check whether an action is allowed
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl auth reconcile
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Reconciles rules for RBAC role, role binding, cluster role, and cluster role binding objects
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl auth whoami
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Experimental: Check self subject attributes
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl autoscale
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Auto-scale a deployment, replica set, stateful set, or replication controller
no_list: true
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl certificate
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Modify certificate resources
no_list: true
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl certificate approve
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Approve a certificate signing request
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl certificate deny
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Deny a certificate signing request
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl cluster-info
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Display cluster information
no_list: true
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl cluster-info dump
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Dump relevant information for debugging and diagnosis
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl completion
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Output shell completion code for the specified shell (bash, zsh, fish, or powershell)
no_list: true
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl config
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Modify kubeconfig files
no_list: true
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl config current-context
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Display the current-context
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl config delete-cluster
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Delete the specified cluster from the kubeconfig
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl config delete-context
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Delete the specified context from the kubeconfig
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl config delete-user
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Delete the specified user from the kubeconfig
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl config get-clusters
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Display clusters defined in the kubeconfig
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl config get-contexts
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Describe one or many contexts
---


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: kubectl config get-users
content_type: tool-reference
weight: 30
auto_generated: true
description: >-
Display users defined in the kubeconfig
---


Expand Down
Loading