Skip to content

Commit 331757b

Browse files
committed
docs: generate docs
1 parent a4cc763 commit 331757b

File tree

2 files changed

+163
-13
lines changed

2 files changed

+163
-13
lines changed

cable/unix/git-reflog.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ requirements = ["git"]
55

66
[source]
77
command = "git reflog --decorate --color=always"
8-
output = "{strip_ansi|split: :0}"
8+
output = "{0|strip_ansi}"
99
ansi = true
1010

1111
[preview]
12-
command = "git show -p --stat --pretty=fuller --color=always '{strip_ansi|0}'"
12+
command = "git show -p --stat --pretty=fuller --color=always '{0|strip_ansi}'"

docs/01-Users/10-community-channels-unix.md

Lines changed: 161 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,12 @@ description = "A channel to select from git log entries"
337337
requirements = [ "git",]
338338

339339
[source]
340-
command = "git log --oneline --date=short --pretty=\"format:%h %s %an %cd\" \"$@\""
341-
output = "{split: :0}"
340+
command = "git log --graph --pretty=format:'%C(yellow)%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --color=always"
341+
output = "{strip_ansi|split: :1}"
342+
ansi = true
342343

343344
[preview]
344-
command = "git show -p --stat --pretty=fuller --color=always '{0}'"
345+
command = "git show -p --stat --pretty=fuller --color=always '{strip_ansi|split: :1}' | head -n 1000"
345346

346347
```
347348

@@ -364,11 +365,11 @@ requirements = [ "git",]
364365

365366
[source]
366367
command = "git reflog --decorate --color=always"
367-
output = "{strip_ansi|split: :0}"
368+
output = "{0|strip_ansi}"
368369
ansi = true
369370

370371
[preview]
371-
command = "git show -p --stat --pretty=fuller --color=always '{strip_ansi|0}'"
372+
command = "git show -p --stat --pretty=fuller --color=always '{0|strip_ansi}'"
372373

373374
```
374375

@@ -402,6 +403,155 @@ command = "cd '{}'; git log -n 200 --pretty=medium --all --graph --color"
402403
```
403404

404405

406+
---
407+
408+
### *k8s-deployments*
409+
410+
List and preview Deployments in a Kubernetes Cluster.
411+
412+
The first source lists only from the current namespace, while the second lists from all.
413+
414+
Keybindings
415+
416+
Press `ctrl-d` to delete the selected Deployment.
417+
418+
419+
![tv running the k8s-deployments channel](../../assets/channels/k8s-deployments.png)
420+
**Requirements:** `kubectl`
421+
422+
**Code:** *k8s-deployments.toml*
423+
424+
```toml
425+
[metadata]
426+
name = "k8s-deployments"
427+
description = "List and preview Deployments in a Kubernetes Cluster.\n\nThe first source lists only from the current namespace, while the second lists from all.\n\nKeybindings\n\nPress `ctrl-d` to delete the selected Deployment.\n"
428+
requirements = [ "kubectl",]
429+
430+
[source]
431+
command = [ " kubectl get deployments -o go-template --template '{{range .items}}{{.metadata.namespace}} {{.metadata.name}}{{\"\\n\"}}{{end}}'\n ", " kubectl get deployments -o go-template --template '{{range .items}}{{.metadata.namespace}} {{.metadata.name}}{{\"\\n\"}}{{end}}' --all-namespaces\n ",]
432+
output = "{1}"
433+
434+
[preview]
435+
command = "kubectl describe -n {0} deployments/{1}"
436+
437+
[keybindings]
438+
ctrl-d = "actions:delete"
439+
440+
[ui.preview_panel]
441+
size = 60
442+
443+
[actions.delete]
444+
description = "Delete the selected Deployment"
445+
command = "kubectl delete -n {0} deployments/{1}"
446+
mode = "execute"
447+
448+
```
449+
450+
451+
---
452+
453+
### *k8s-pods*
454+
455+
List and preview Pods in a Kubernetes Cluster.
456+
457+
The first source lists only from the current namespace, while the second lists from all.
458+
459+
Keybindings
460+
461+
Press `ctrl-e` to execute shell inside the selected Pod.
462+
Press `ctrl-d` to delete the selected Pod.
463+
Press `ctrl-l` to print and follow the logs of the selected Pod.
464+
465+
466+
![tv running the k8s-pods channel](../../assets/channels/k8s-pods.png)
467+
**Requirements:** `kubectl`
468+
469+
**Code:** *k8s-pods.toml*
470+
471+
```toml
472+
[metadata]
473+
name = "k8s-pods"
474+
description = "List and preview Pods in a Kubernetes Cluster.\n\nThe first source lists only from the current namespace, while the second lists from all.\n\nKeybindings\n\nPress `ctrl-e` to execute shell inside the selected Pod.\nPress `ctrl-d` to delete the selected Pod.\nPress `ctrl-l` to print and follow the logs of the selected Pod.\n"
475+
requirements = [ "kubectl",]
476+
477+
[source]
478+
command = [ " kubectl get pods -o go-template --template '{{range .items}}{{.metadata.namespace}} {{.metadata.name}}{{\"\\n\"}}{{end}}'\n ", " kubectl get pods -o go-template --template '{{range .items}}{{.metadata.namespace}} {{.metadata.name}}{{\"\\n\"}}{{end}}' --all-namespaces\n ",]
479+
output = "{1}"
480+
481+
[preview]
482+
command = "kubectl describe -n {0} pods/{1}"
483+
484+
[keybindings]
485+
ctrl-d = "actions:delete"
486+
ctrl-e = "actions:exec"
487+
ctrl-l = "actions:logs"
488+
489+
[ui.preview_panel]
490+
size = 60
491+
492+
[actions.exec]
493+
description = "Execute shell inside the selected Pod"
494+
command = "kubectl exec -i -t -n {0} pods/{1} -- /bin/sh"
495+
mode = "execute"
496+
497+
[actions.delete]
498+
description = "Delete the selected Pod"
499+
command = "kubectl delete -n {0} pods/{1}"
500+
mode = "execute"
501+
502+
[actions.logs]
503+
description = "Follow logs of the selected Pod"
504+
command = "kubectl logs -f -n {0} pods/{1}"
505+
mode = "execute"
506+
507+
```
508+
509+
510+
---
511+
512+
### *k8s-services*
513+
514+
List and preview Services in a Kubernetes Cluster.
515+
516+
The first source lists only from the current namespace, while the second lists from all.
517+
518+
keybindings
519+
520+
Press `ctrl-d` to delete the selected Service.
521+
522+
523+
![tv running the k8s-services channel](../../assets/channels/k8s-services.png)
524+
**Requirements:** `kubectl`
525+
526+
**Code:** *k8s-services.toml*
527+
528+
```toml
529+
[metadata]
530+
name = "k8s-services"
531+
description = "List and preview Services in a Kubernetes Cluster.\n\nThe first source lists only from the current namespace, while the second lists from all.\n\nkeybindings\n\nPress `ctrl-d` to delete the selected Service.\n"
532+
requirements = [ "kubectl",]
533+
534+
[source]
535+
command = [ " kubectl get services -o go-template --template '{{range .items}}{{.metadata.namespace}} {{.metadata.name}}{{\"\\n\"}}{{end}}'\n ", " kubectl get services -o go-template --template '{{range .items}}{{.metadata.namespace}} {{.metadata.name}}{{\"\\n\"}}{{end}}' --all-namespaces\n ",]
536+
output = "{1}"
537+
538+
[preview]
539+
command = "kubectl describe -n {0} services/{1}"
540+
541+
[keybindings]
542+
ctrl-d = "actions:delete"
543+
544+
[ui.preview_panel]
545+
size = 60
546+
547+
[actions.delete]
548+
description = "Delete the selected Service"
549+
command = "kubectl delete -n {0} services/{1}"
550+
mode = "execute"
551+
552+
```
553+
554+
405555
---
406556

407557
### *nu-history*
@@ -440,19 +590,19 @@ description = "A channel to find and select text from files"
440590
requirements = [ "rg", "bat",]
441591

442592
[source]
443-
command = "rg . --no-heading --line-number"
444-
display = "[{split:\\::..2}]\t{split:\\::2..}"
445-
output = "{split:\\::..2}"
593+
command = "rg . --no-heading --line-number --colors 'match:fg:white' --colors 'path:fg:blue' --color=always"
594+
ansi = true
595+
output = "{strip_ansi|split:\\::..2}"
446596

447597
[preview]
448-
command = "bat -n --color=always '{split:\\::0}'"
449-
offset = "{split:\\::1}"
598+
command = "bat -n --color=always '{strip_ansi|split:\\::0}'"
599+
offset = "{strip_ansi|split:\\::1}"
450600

451601
[preview.env]
452602
BAT_THEME = "ansi"
453603

454604
[ui.preview_panel]
455-
header = "{split:\\::..2}"
605+
header = "{strip_ansi|split:\\::..2}"
456606

457607
```
458608

0 commit comments

Comments
 (0)