diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 0506ccbd5..44185f6d6 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -1,12 +1,42 @@ name: Doc on: + pull_request: push: - branches: - - 'master' jobs: + build: + runs-on: ubuntu-latest + steps: + - name: shallow clone + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.22.0' + + - name: build + run: | + cd example + go build + + - uses: actions/upload-artifact@v4 + with: + name: example + path: example/example + retention-days: 1 + + + word: {needs: build, uses: ./.github/workflows/vhs-template.yml, with: {topic: word}} + nospace: {needs: build, uses: ./.github/workflows/vhs-template.yml, with: {topic: nospace}} + doubleQuote: {needs: build, uses: ./.github/workflows/vhs-template.yml, with: {topic: doubleQuote}} + doc: + needs: + - word + - nospace + - doubleQuote runs-on: ubuntu-latest container: ghcr.io/carapace-sh/carapace steps: @@ -17,6 +47,13 @@ jobs: key: linkcheck path: docs/book/linkcheck + - uses: actions/download-artifact@v4 + with: + path: docs/src/development/vhs/ + + - name: Display structure of downloaded files + run: ls -R docs/src/development/vhs/ + - name: "build docs" run: | mdbook build docs diff --git a/.github/workflows/vhs-template.yml b/.github/workflows/vhs-template.yml new file mode 100644 index 000000000..174d88c88 --- /dev/null +++ b/.github/workflows/vhs-template.yml @@ -0,0 +1,47 @@ +name: vhs template + +on: + workflow_call: + inputs: + topic: + required: true + type: string + +jobs: + vhs: + runs-on: ubuntu-latest + continue-on-error: true + container: ghcr.io/carapace-sh/vhs + env: + RC_BASH: "ln -sf /carapace/example/example /usr/local/bin/example" + RC_NUSHELL_ENV: "mkdir ~/.cache/\nexample _carapace nushell | save --force ~/.cache/example.nu" + RC_NUSHELL: "source ~/.cache/example.nu\n$$env.config.completions.external.completer = $$example_completer" + steps: + - name: shallow clone + uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + name: example + path: /usr/local/bin/ + + - run: chmod +x /usr/local/bin/example + + - name: vhs + run: | + cd docs/src/development/vhs/${{ inputs.topic }} + ls *.tape | xargs -n1 vhs + + - uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.topic }} + path: | + docs/src/development/vhs/${{ inputs.topic }}/ + !docs/src/development/vhs/${{ inputs.topic }}/*.tape + retention-days: 1 + + - name: check + run: | + git diff + [ -z "$(git status --porcelain)" ] # clean workspace unless .ascii files changed + diff --git a/.github/workflows/vhs.env b/.github/workflows/vhs.env new file mode 100644 index 000000000..da1f11a02 --- /dev/null +++ b/.github/workflows/vhs.env @@ -0,0 +1,4 @@ +RC_BASH="ln -sf /carapace/example/example /usr/local/bin/example" +RC_NUSHELL_ENV="mkdir ~/.cache/\nexample _carapace nushell | save --force ~/.cache/example.nu" +RC_NUSHELL="source ~/.cache/example.nu\n$$env.config.completions.external.completer = $$example_completer" + diff --git a/.gitignore b/.gitignore index cb4656c0b..b5c522585 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ caraparse/caraparse .cover dist docs/book +docs/src/development/vhs/*/out/*.gif example/cmd/_test_files/*.txt example/example example-nonposix/example-nonposix diff --git a/compose.yaml b/compose.yaml index 2dd1db498..b9ca4aea6 100644 --- a/compose.yaml +++ b/compose.yaml @@ -99,3 +99,12 @@ services: RC_ZSH: | export PATH="/carapace/example/:$$PATH" source <(example _carapace) + + vhs: + image: ghcr.io/carapace-sh/vhs + volumes: + - '.:/carapace/' + working_dir: /carapace/docs/src/development/vhs + command: bash --login -c "ls -d */ | xargs -I'{}' bash -c \"cd {};ls *.tape | xargs -n1 vhs\"" + env_file: + - .github/workflows/vhs.env diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 569fa62eb..e98114ac5 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -117,3 +117,7 @@ - [Zsh](./development/shells/zsh.md) - [Testing](./development/testing.md) - [Asciinema](./development/asciinema.md) + - [VHS](./development/vhs.md) + - [Word](./development/vhs/word.md) + - [Nospace](./development/vhs/nospace.md) + - [Double Quote](./development/vhs/doubleQuote.md) diff --git a/docs/src/carapace/gen.md b/docs/src/carapace/gen.md index 61f879550..4073995ff 100644 --- a/docs/src/carapace/gen.md +++ b/docs/src/carapace/gen.md @@ -63,4 +63,4 @@ exec($(command _carapace)) source <(command _carapace) ``` -> Directly sourcing multiple completions in your shell init script increases startup time [considerably](https://medium.com/@jzelinskie/please-dont-ship-binaries-with-shell-completion-as-commands-a8b1bcb8a0d0). See [lazycomplete](https://github.com/rsteube/lazycomplete) for a solution to this problem. +> Directly sourcing multiple completions in your shell init script increases startup time [considerably](https://jzelinskie.com/posts/dont-recommend-sourcing-shell-completion/). See [lazycomplete](https://github.com/rsteube/lazycomplete) for a solution to this problem. diff --git a/docs/src/development/vhs.md b/docs/src/development/vhs.md new file mode 100644 index 000000000..a0199c216 --- /dev/null +++ b/docs/src/development/vhs.md @@ -0,0 +1 @@ +# VHS diff --git a/docs/src/development/vhs/bash.tape b/docs/src/development/vhs/bash.tape new file mode 100644 index 000000000..18c4c135d --- /dev/null +++ b/docs/src/development/vhs/bash.tape @@ -0,0 +1,15 @@ +Require example + +Set Theme "Snazzy" +Set FontFamily "JetBrains Mono" +Set FontSize 30 +Set Width 1400 +Set Height 300 +Set Padding 0 + +Set Shell "bash" + +Hide +Type@10ms "source <(example _carapace bash)" Enter +Type@10ms "clear" Enter +Show diff --git a/docs/src/development/vhs/doubleQuote.md b/docs/src/development/vhs/doubleQuote.md new file mode 100644 index 000000000..e361f2b95 --- /dev/null +++ b/docs/src/development/vhs/doubleQuote.md @@ -0,0 +1,18 @@ +# Double Quote + +- bash +![](./doubleQuote/out/doubleQuote.bash.gif) +- elvish +![](./doubleQuote/out/doubleQuote.elvish.gif) +- fish +![](./doubleQuote/out/doubleQuote.fish.gif) +- nushell +![](./doubleQuote/out/doubleQuote.nushell.gif) +- oil +![](./doubleQuote/out/doubleQuote.oil.gif) +- powershell +![](./doubleQuote/out/doubleQuote.powershell.gif) +- xonsh +![](./doubleQuote/out/doubleQuote.xonsh.gif) +- zsh +![](./doubleQuote/out/doubleQuote.zsh.gif) diff --git a/docs/src/development/vhs/doubleQuote/doubleQuote.bash.tape b/docs/src/development/vhs/doubleQuote/doubleQuote.bash.tape new file mode 100644 index 000000000..f0951db2b --- /dev/null +++ b/docs/src/development/vhs/doubleQuote/doubleQuote.bash.tape @@ -0,0 +1,8 @@ +Source ../bash.tape + +Output out/doubleQuote.bash.gif +Output out/doubleQuote.bash.ascii + +Type `example "ac"` Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/doubleQuote/doubleQuote.elvish.tape b/docs/src/development/vhs/doubleQuote/doubleQuote.elvish.tape new file mode 100644 index 000000000..5e5bdfee8 --- /dev/null +++ b/docs/src/development/vhs/doubleQuote/doubleQuote.elvish.tape @@ -0,0 +1,8 @@ +Source ../elvish.tape + +Output out/doubleQuote.elvish.gif +Output out/doubleQuote.elvish.ascii + +Type `example "ac"` Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/doubleQuote/doubleQuote.fish.tape b/docs/src/development/vhs/doubleQuote/doubleQuote.fish.tape new file mode 100644 index 000000000..c0a06b28c --- /dev/null +++ b/docs/src/development/vhs/doubleQuote/doubleQuote.fish.tape @@ -0,0 +1,8 @@ +Source ../fish.tape + +Output out/doubleQuote.fish.gif +Output out/doubleQuote.fish.ascii + +Type `example "ac"` Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/doubleQuote/doubleQuote.nushell.tape b/docs/src/development/vhs/doubleQuote/doubleQuote.nushell.tape new file mode 100644 index 000000000..8cd62802b --- /dev/null +++ b/docs/src/development/vhs/doubleQuote/doubleQuote.nushell.tape @@ -0,0 +1,8 @@ +Source ../nushell.tape + +Output out/doubleQuote.nushell.gif +Output out/doubleQuote.nushell.ascii + +Type `example "ac"` Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/doubleQuote/doubleQuote.oil.tape b/docs/src/development/vhs/doubleQuote/doubleQuote.oil.tape new file mode 100644 index 000000000..4c60fd1fb --- /dev/null +++ b/docs/src/development/vhs/doubleQuote/doubleQuote.oil.tape @@ -0,0 +1,8 @@ +Source ../oil.tape + +Output out/doubleQuote.oil.gif +Output out/doubleQuote.oil.ascii + +Type `example "ac"` Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/doubleQuote/doubleQuote.powershell.tape b/docs/src/development/vhs/doubleQuote/doubleQuote.powershell.tape new file mode 100644 index 000000000..e5eea0a9e --- /dev/null +++ b/docs/src/development/vhs/doubleQuote/doubleQuote.powershell.tape @@ -0,0 +1,8 @@ +Source ../powershell.tape + +Output out/doubleQuote.powershell.gif +Output out/doubleQuote.powershell.ascii + +Type `example "ac"` Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/doubleQuote/doubleQuote.xonsh.tape b/docs/src/development/vhs/doubleQuote/doubleQuote.xonsh.tape new file mode 100644 index 000000000..c8eea77c7 --- /dev/null +++ b/docs/src/development/vhs/doubleQuote/doubleQuote.xonsh.tape @@ -0,0 +1,8 @@ +Source ../xonsh.tape + +Output out/doubleQuote.xonsh.gif +Output out/doubleQuote.xonsh.ascii + +Type `example "ac"` Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/doubleQuote/doubleQuote.zsh.tape b/docs/src/development/vhs/doubleQuote/doubleQuote.zsh.tape new file mode 100644 index 000000000..63066b473 --- /dev/null +++ b/docs/src/development/vhs/doubleQuote/doubleQuote.zsh.tape @@ -0,0 +1,8 @@ +Source ../zsh.tape + +Output out/doubleQuote.zsh.gif +Output out/doubleQuote.zsh.ascii + +Type `example "ac"` Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/doubleQuote/out/doubleQuote.bash.ascii b/docs/src/development/vhs/doubleQuote/out/doubleQuote.bash.ascii new file mode 100644 index 000000000..8fb13a25d --- /dev/null +++ b/docs/src/development/vhs/doubleQuote/out/doubleQuote.bash.ascii @@ -0,0 +1,40 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example action + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example action + + + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/doubleQuote/out/doubleQuote.elvish.ascii b/docs/src/development/vhs/doubleQuote/out/doubleQuote.elvish.ascii new file mode 100644 index 000000000..28da3c6ab --- /dev/null +++ b/docs/src/development/vhs/doubleQuote/out/doubleQuote.elvish.ascii @@ -0,0 +1,40 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "action" + COMPLETING argument +action (action example) + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "action" + COMPLETING argument +action (action example) + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/doubleQuote/out/doubleQuote.fish.ascii b/docs/src/development/vhs/doubleQuote/out/doubleQuote.fish.ascii new file mode 100644 index 000000000..5f0d448ac --- /dev/null +++ b/docs/src/development/vhs/doubleQuote/out/doubleQuote.fish.ascii @@ -0,0 +1,40 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "action" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "action" + + + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/doubleQuote/out/doubleQuote.nushell.ascii b/docs/src/development/vhs/doubleQuote/out/doubleQuote.nushell.ascii new file mode 100644 index 000000000..544ff0e2f --- /dev/null +++ b/docs/src/development/vhs/doubleQuote/out/doubleQuote.nushell.ascii @@ -0,0 +1,40 @@ +> > + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> > example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> > example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> | example "ac" +NO RECORDS FOUND + + + + + +──────────────────────────────────────────────────────────────────────────────── +> | example "ac" +NO RECORDS FOUND + + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/doubleQuote/out/doubleQuote.oil.ascii b/docs/src/development/vhs/doubleQuote/out/doubleQuote.oil.ascii new file mode 100644 index 000000000..8fb13a25d --- /dev/null +++ b/docs/src/development/vhs/doubleQuote/out/doubleQuote.oil.ascii @@ -0,0 +1,40 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example action + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example action + + + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/doubleQuote/out/doubleQuote.powershell.ascii b/docs/src/development/vhs/doubleQuote/out/doubleQuote.powershell.ascii new file mode 100644 index 000000000..136062929 --- /dev/null +++ b/docs/src/development/vhs/doubleQuote/out/doubleQuote.powershell.ascii @@ -0,0 +1,40 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/doubleQuote/out/doubleQuote.xonsh.ascii b/docs/src/development/vhs/doubleQuote/out/doubleQuote.xonsh.ascii new file mode 100644 index 000000000..e2ae7a901 --- /dev/null +++ b/docs/src/development/vhs/doubleQuote/out/doubleQuote.xonsh.ascii @@ -0,0 +1,40 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example action + action + action example + + + + +──────────────────────────────────────────────────────────────────────────────── +> example action + action + action example + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/doubleQuote/out/doubleQuote.zsh.ascii b/docs/src/development/vhs/doubleQuote/out/doubleQuote.zsh.ascii new file mode 100644 index 000000000..806b13fc7 --- /dev/null +++ b/docs/src/development/vhs/doubleQuote/out/doubleQuote.zsh.ascii @@ -0,0 +1,40 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "ac" + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "action " + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example "action " + + + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/elvish.tape b/docs/src/development/vhs/elvish.tape new file mode 100644 index 000000000..139bbccd9 --- /dev/null +++ b/docs/src/development/vhs/elvish.tape @@ -0,0 +1,15 @@ +Require example + +Set Theme "Snazzy" +Set FontFamily "JetBrains Mono" +Set FontSize 30 +Set Width 1400 +Set Height 300 +Set Padding 0 + +Set Shell "elvish" + +Hide +Type@10ms "eval (example _carapace elvish|slurp)" Enter +Type@10ms "clear" Enter +Show diff --git a/docs/src/development/vhs/fish.tape b/docs/src/development/vhs/fish.tape new file mode 100644 index 000000000..e8465a99a --- /dev/null +++ b/docs/src/development/vhs/fish.tape @@ -0,0 +1,15 @@ +Require example + +Set Theme "Snazzy" +Set FontFamily "JetBrains Mono" +Set FontSize 30 +Set Width 1400 +Set Height 300 +Set Padding 0 + +Set Shell "fish" + +Hide +Type@10ms "example _carapace fish | source" Enter +Type@10ms "clear" Enter +Show diff --git a/docs/src/development/vhs/nospace.md b/docs/src/development/vhs/nospace.md new file mode 100644 index 000000000..3c10e5b39 --- /dev/null +++ b/docs/src/development/vhs/nospace.md @@ -0,0 +1,18 @@ +# Nospace + +- bash +![](./nospace/out/nospace.bash.gif) +- elvish +![](./nospace/out/nospace.elvish.gif) +- fish +![](./nospace/out/nospace.fish.gif) +- nushell +![](./nospace/out/nospace.nushell.gif) +- oil +![](./nospace/out/nospace.oil.gif) +- powershell +![](./nospace/out/nospace.powershell.gif) +- xonsh +![](./nospace/out/nospace.xonsh.gif) +- zsh +![](./nospace/out/nospace.zsh.gif) diff --git a/docs/src/development/vhs/nospace/nospace.bash.tape b/docs/src/development/vhs/nospace/nospace.bash.tape new file mode 100644 index 000000000..b1acd442f --- /dev/null +++ b/docs/src/development/vhs/nospace/nospace.bash.tape @@ -0,0 +1,8 @@ +Source ../bash.tape + +Output out/nospace.bash.gif +Output out/nospace.bash.ascii + +Type "example modifier --nospace o" Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/nospace/nospace.elvish.tape b/docs/src/development/vhs/nospace/nospace.elvish.tape new file mode 100644 index 000000000..ac27b017e --- /dev/null +++ b/docs/src/development/vhs/nospace/nospace.elvish.tape @@ -0,0 +1,8 @@ +Source ../elvish.tape + +Output out/nospace.elvish.gif +Output out/nospace.elvish.ascii + +Type "example modifier --nospace o" Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/nospace/nospace.fish.tape b/docs/src/development/vhs/nospace/nospace.fish.tape new file mode 100644 index 000000000..e3754f35b --- /dev/null +++ b/docs/src/development/vhs/nospace/nospace.fish.tape @@ -0,0 +1,8 @@ +Source ../fish.tape + +Output out/nospace.fish.gif +Output out/nospace.fish.ascii + +Type "example modifier --nospace o" Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/nospace/nospace.nushell.tape b/docs/src/development/vhs/nospace/nospace.nushell.tape new file mode 100644 index 000000000..1a513aa54 --- /dev/null +++ b/docs/src/development/vhs/nospace/nospace.nushell.tape @@ -0,0 +1,8 @@ +Source ../nushell.tape + +Output out/nospace.nushell.gif +Output out/nospace.nushell.ascii + +Type "example modifier --nospace o" Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/nospace/nospace.oil.tape b/docs/src/development/vhs/nospace/nospace.oil.tape new file mode 100644 index 000000000..ed88cf7a0 --- /dev/null +++ b/docs/src/development/vhs/nospace/nospace.oil.tape @@ -0,0 +1,8 @@ +Source ../oil.tape + +Output out/nospace.oil.gif +Output out/nospace.oil.ascii + +Type "example modifier --nospace o" Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/nospace/nospace.powershell.tape b/docs/src/development/vhs/nospace/nospace.powershell.tape new file mode 100644 index 000000000..80418c893 --- /dev/null +++ b/docs/src/development/vhs/nospace/nospace.powershell.tape @@ -0,0 +1,8 @@ +Source ../powershell.tape + +Output out/nospace.powershell.gif +Output out/nospace.powershell.ascii + +Type "example modifier --nospace o" Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/nospace/nospace.xonsh.tape b/docs/src/development/vhs/nospace/nospace.xonsh.tape new file mode 100644 index 000000000..1913c9c44 --- /dev/null +++ b/docs/src/development/vhs/nospace/nospace.xonsh.tape @@ -0,0 +1,8 @@ +Source ../xonsh.tape + +Output out/nospace.xonsh.gif +Output out/nospace.xonsh.ascii + +Type "example modifier --nospace o" Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/nospace/nospace.zsh.tape b/docs/src/development/vhs/nospace/nospace.zsh.tape new file mode 100644 index 000000000..da9cc56ff --- /dev/null +++ b/docs/src/development/vhs/nospace/nospace.zsh.tape @@ -0,0 +1,8 @@ +Source ../zsh.tape + +Output out/nospace.zsh.gif +Output out/nospace.zsh.ascii + +Type "example modifier --nospace o" Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/nospace/out/nospace.bash.ascii b/docs/src/development/vhs/nospace/out/nospace.bash.ascii new file mode 100644 index 000000000..26149c445 --- /dev/null +++ b/docs/src/development/vhs/nospace/out/nospace.bash.ascii @@ -0,0 +1,40 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace o + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace o + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace one, + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace one, + + + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/nospace/out/nospace.elvish.ascii b/docs/src/development/vhs/nospace/out/nospace.elvish.ascii new file mode 100644 index 000000000..133a4c740 --- /dev/null +++ b/docs/src/development/vhs/nospace/out/nospace.elvish.ascii @@ -0,0 +1,40 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace o + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace o + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace 'one,' + COMPLETING argument +one, + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace 'one,' + COMPLETING argument +one, + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/nospace/out/nospace.fish.ascii b/docs/src/development/vhs/nospace/out/nospace.fish.ascii new file mode 100644 index 000000000..26149c445 --- /dev/null +++ b/docs/src/development/vhs/nospace/out/nospace.fish.ascii @@ -0,0 +1,40 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace o + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace o + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace one, + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace one, + + + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/nospace/out/nospace.nushell.ascii b/docs/src/development/vhs/nospace/out/nospace.nushell.ascii new file mode 100644 index 000000000..d97185b7f --- /dev/null +++ b/docs/src/development/vhs/nospace/out/nospace.nushell.ascii @@ -0,0 +1,40 @@ +> > + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> > example modifier --nospace o + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> > example modifier --nospace o + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> > example modifier --nospace out/ + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> > example modifier --nospace out/ + + + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/nospace/out/nospace.oil.ascii b/docs/src/development/vhs/nospace/out/nospace.oil.ascii new file mode 100644 index 000000000..26149c445 --- /dev/null +++ b/docs/src/development/vhs/nospace/out/nospace.oil.ascii @@ -0,0 +1,40 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace o + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace o + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace one, + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace one, + + + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/nospace/out/nospace.powershell.ascii b/docs/src/development/vhs/nospace/out/nospace.powershell.ascii new file mode 100644 index 000000000..81ebcb72a --- /dev/null +++ b/docs/src/development/vhs/nospace/out/nospace.powershell.ascii @@ -0,0 +1,40 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace o + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace o + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace 'one,' + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace 'one,' + + + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/nospace/out/nospace.xonsh.ascii b/docs/src/development/vhs/nospace/out/nospace.xonsh.ascii new file mode 100644 index 000000000..26149c445 --- /dev/null +++ b/docs/src/development/vhs/nospace/out/nospace.xonsh.ascii @@ -0,0 +1,40 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace o + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace o + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace one, + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace one, + + + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/nospace/out/nospace.zsh.ascii b/docs/src/development/vhs/nospace/out/nospace.zsh.ascii new file mode 100644 index 000000000..26149c445 --- /dev/null +++ b/docs/src/development/vhs/nospace/out/nospace.zsh.ascii @@ -0,0 +1,40 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace o + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace o + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace one, + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example modifier --nospace one, + + + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/nushell.tape b/docs/src/development/vhs/nushell.tape new file mode 100644 index 000000000..4441426c8 --- /dev/null +++ b/docs/src/development/vhs/nushell.tape @@ -0,0 +1,14 @@ +Require example + +Set Theme "Snazzy" +Set FontFamily "JetBrains Mono" +Set FontSize 30 +Set Width 1400 +Set Height 300 +Set Padding 0 + +Set Shell "nu" + +Hide +Type@10ms "clear" Enter +Show diff --git a/docs/src/development/vhs/oil.tape b/docs/src/development/vhs/oil.tape new file mode 100644 index 000000000..0778b35fc --- /dev/null +++ b/docs/src/development/vhs/oil.tape @@ -0,0 +1,16 @@ +Require example + +Set Theme "Snazzy" +Set FontFamily "JetBrains Mono" +Set FontSize 30 +Set Width 1400 +Set Height 300 +Set Padding 0 + +Set Shell "osh" + +Hide +Type@10ms "source <(example _carapace oil)" Enter +Type@10ms "clear" Enter +Show + diff --git a/docs/src/development/vhs/powershell.tape b/docs/src/development/vhs/powershell.tape new file mode 100644 index 000000000..4d415d60a --- /dev/null +++ b/docs/src/development/vhs/powershell.tape @@ -0,0 +1,17 @@ +Require example + +Set Theme "Snazzy" +Set FontFamily "JetBrains Mono" +Set FontSize 30 +Set Width 1400 +Set Height 300 +Set Padding 0 + +Set Shell "pwsh" + +Hide +Type@10ms 'Set-PSReadLineOption -Colors @{ "Selection" = "`e[7m" }' Enter +Type@10ms "Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete" Enter +Type@10ms "example _carapace powershell | Out-String | Invoke-Expression" Enter +Type@10ms "clear" Enter +Show diff --git a/docs/src/development/vhs/word.md b/docs/src/development/vhs/word.md new file mode 100644 index 000000000..241a8ffa7 --- /dev/null +++ b/docs/src/development/vhs/word.md @@ -0,0 +1,18 @@ +# Word + +- bash +![](./word/out/word.bash.gif) +- elvish +![](./word/out/word.elvish.gif) +- fish +![](./word/out/word.fish.gif) +- nushell +![](./word/out/word.nushell.gif) +- oil +![](./word/out/word.oil.gif) +- powershell +![](./word/out/word.powershell.gif) +- xonsh +![](./word/out/word.xonsh.gif) +- zsh +![](./word/out/word.zsh.gif) diff --git a/docs/src/development/vhs/word/out/word.bash.ascii b/docs/src/development/vhs/word/out/word.bash.ascii new file mode 100644 index 000000000..71a2cb37a --- /dev/null +++ b/docs/src/development/vhs/word/out/word.bash.ascii @@ -0,0 +1,72 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example +action (action example) +alias (action example) +chain (shorthand chain) +compat +completion (Generate the autocompletion script for the specified shell) +flag (flag example) +──────────────────────────────────────────────────────────────────────────────── +> example +action (action example) +alias (action example) +chain (shorthand chain) +compat +completion (Generate the autocompletion script for the specified shell) +flag (flag example) +──────────────────────────────────────────────────────────────────────────────── +> example +action (action example) +alias (action example) +chain (shorthand chain) +compat +completion (Generate the autocompletion script for the specified shell) +flag (flag example) +──────────────────────────────────────────────────────────────────────────────── +> example +action (action example) +alias (action example) +chain (shorthand chain) +compat +completion (Generate the autocompletion script for the specified shell) +flag (flag example) +──────────────────────────────────────────────────────────────────────────────── +> example +action (action example) +alias (action example) +chain (shorthand chain) +compat +completion (Generate the autocompletion script for the specified shell) +flag (flag example) +──────────────────────────────────────────────────────────────────────────────── +> example +action (action example) +alias (action example) +chain (shorthand chain) +compat +completion (Generate the autocompletion script for the specified shell) +flag (flag example) +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/word/out/word.elvish.ascii b/docs/src/development/vhs/word/out/word.elvish.ascii new file mode 100644 index 000000000..a2b7e4158 --- /dev/null +++ b/docs/src/development/vhs/word/out/word.elvish.ascii @@ -0,0 +1,48 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example action + COMPLETING argument +action (action example) completion (Generate the autocompletion script for +alias (action example) flag (flag example) +chain (shorthand chain) group (group example) +compat help (Help about any command) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +──────────────────────────────────────────────────────────────────────────────── +> example action + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example action + + + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/word/out/word.fish.ascii b/docs/src/development/vhs/word/out/word.fish.ascii new file mode 100644 index 000000000..7eb6ff791 --- /dev/null +++ b/docs/src/development/vhs/word/out/word.fish.ascii @@ -0,0 +1,40 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example _carapace fish | source + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example _carapace fish | source + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example action +action (action example) +alias (action example) +chain (shorthand chain) +compat +completion (Generate the autocompletion script for the specified shell) +rows 1 to 5 of 14 +──────────────────────────────────────────────────────────────────────────────── +> example action +action (action example) +alias (action example) +chain (shorthand chain) +compat +completion (Generate the autocompletion script for the specified shell) +rows 1 to 5 of 14 +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/word/out/word.nushell.ascii b/docs/src/development/vhs/word/out/word.nushell.ascii new file mode 100644 index 000000000..1606574ad --- /dev/null +++ b/docs/src/development/vhs/word/out/word.nushell.ascii @@ -0,0 +1,48 @@ +> > + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> > example + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> > example + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> | example +out/ word.bash.tape word.elvish.tape +word.fish.tape word.nushell.tape word.oil.tape +word.powershell.tape word.xonsh.tape word.zsh.tape + + + +──────────────────────────────────────────────────────────────────────────────── +> > example out/ + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> > example out/ + + + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/word/out/word.oil.ascii b/docs/src/development/vhs/word/out/word.oil.ascii new file mode 100644 index 000000000..ee5abf71a --- /dev/null +++ b/docs/src/development/vhs/word/out/word.oil.ascii @@ -0,0 +1,64 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example + action (action example) + alias (action example) + chain (shorthand chain) + compat + completion (Generate the autocompletion script for the specified shell) + flag (flag example) +──────────────────────────────────────────────────────────────────────────────── +> example + action (action example) + alias (action example) + chain (shorthand chain) + compat + completion (Generate the autocompletion script for the specified shell) + flag (flaacexample) +──────────────────────────────────────────────────────────────────────────────── +> example + action (action example) + alias (action example) + chain (shorthand chain) + compat + completion (Generate the autocompletion script for the specified shell) + flag (flaacexample) +──────────────────────────────────────────────────────────────────────────────── +> example + action (action example) + alias (action example) + chain (shorthand chain) + compat + completion (Generate the autocompletion script for the specified shell) + flag (flaaction le) +──────────────────────────────────────────────────────────────────────────────── +> example + action (action example) + alias (action example) + chain (shorthand chain) + compat + completion (Generate the autocompletion script for the specified shell) + flag (flaaction le) +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/word/out/word.powershell.ascii b/docs/src/development/vhs/word/out/word.powershell.ascii new file mode 100644 index 000000000..8acc7d582 --- /dev/null +++ b/docs/src/development/vhs/word/out/word.powershell.ascii @@ -0,0 +1,64 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example _carapace powershell | Out-String | Invoke-Expression + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example _carapace powershell | Out-String | Invoke-Expression + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example _carapace powershell | Out-String | Invoke-Expression +action (action example) +alias (action example) +chain (shorthand chain) +compat +completion (Generate the autocompletion script for the specified shell) +flag (flag example) +──────────────────────────────────────────────────────────────────────────────── +> example _carapace powershell | Out-String | Invoke-Expression +action (action example) +alias (action example) +chain (shorthand chain) +compat +completion (Generate the autocompletion script for the specified shell) +flag (flag example) +──────────────────────────────────────────────────────────────────────────────── +> example _carapace powershell | Out-String | Invoke-Expression +action (action example) +alias (action example) +chain (shorthand chain) +compat +completion (Generate the autocompletion script for the specified shell) +flag (flag example) +──────────────────────────────────────────────────────────────────────────────── +> example _carapace powershell | Out-String | Invoke-Expression +action (action example) +alias (action example) +chain (shorthand chain) +compat +completion (Generate the autocompletion script for the specified shell) +flag (flag example) +──────────────────────────────────────────────────────────────────────────────── +> example _carapace powershell | Out-String | Invoke-Expression +action (action example) +alias (action example) +chain (shorthand chain) +compat +completion (Generate the autocompletion script for the specified shell) +flag (flag example) +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/word/out/word.xonsh.ascii b/docs/src/development/vhs/word/out/word.xonsh.ascii new file mode 100644 index 000000000..00982b242 --- /dev/null +++ b/docs/src/development/vhs/word/out/word.xonsh.ascii @@ -0,0 +1,48 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example action + action compat group modifier special + alias completion help multiparts subcommand + chain flag interspersed plugin + action example + + +──────────────────────────────────────────────────────────────────────────────── +> example action + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example action + + + + + + +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/word/out/word.zsh.ascii b/docs/src/development/vhs/word/out/word.zsh.ascii new file mode 100644 index 000000000..9ac64fa2e --- /dev/null +++ b/docs/src/development/vhs/word/out/word.zsh.ascii @@ -0,0 +1,48 @@ +> + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example + + + + + + +──────────────────────────────────────────────────────────────────────────────── +> example +Completing main commands +action alias -- action example +flag -- flag example +Completing modifier commands +modifier -- modifier example +Completing other commands +──────────────────────────────────────────────────────────────────────────────── +> example +Completing main commands +action alias -- action example +flag -- flag example +Completing modifier commands +modifier -- modifier example +Completing other commands +──────────────────────────────────────────────────────────────────────────────── +> example +Completing main commands +action alias -- action example +flag -- flag example +Completing modifier commands +modifier -- modifier example +Completing other commands +──────────────────────────────────────────────────────────────────────────────── diff --git a/docs/src/development/vhs/word/word.bash.tape b/docs/src/development/vhs/word/word.bash.tape new file mode 100644 index 000000000..7b350d076 --- /dev/null +++ b/docs/src/development/vhs/word/word.bash.tape @@ -0,0 +1,10 @@ +Source ../bash.tape + +Output out/word.bash.gif +Output out/word.bash.ascii + +Type "example " Sleep 1 Tab@1 2 +Type "q" # exit `more` +Type "ac" Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/word/word.elvish.tape b/docs/src/development/vhs/word/word.elvish.tape new file mode 100644 index 000000000..fd472f182 --- /dev/null +++ b/docs/src/development/vhs/word/word.elvish.tape @@ -0,0 +1,9 @@ +Source ../elvish.tape + +Output out/word.elvish.gif +Output out/word.elvish.ascii + +Type "example " +Sleep 1 Tab@1 Enter + +Sleep 2 diff --git a/docs/src/development/vhs/word/word.fish.tape b/docs/src/development/vhs/word/word.fish.tape new file mode 100644 index 000000000..581964866 --- /dev/null +++ b/docs/src/development/vhs/word/word.fish.tape @@ -0,0 +1,8 @@ +Source ../fish.tape + +Output out/word.fish.gif +Output out/word.fish.ascii + +Type "example " Sleep 1 Tab@1 3 + +Sleep 2 diff --git a/docs/src/development/vhs/word/word.nushell.tape b/docs/src/development/vhs/word/word.nushell.tape new file mode 100644 index 000000000..353ca829a --- /dev/null +++ b/docs/src/development/vhs/word/word.nushell.tape @@ -0,0 +1,9 @@ +Source ../nushell.tape + +Output out/word.nushell.gif +Output out/word.nushell.ascii + +Type "example " +Sleep 1 Tab@1 Enter + +Sleep 2 diff --git a/docs/src/development/vhs/word/word.oil.tape b/docs/src/development/vhs/word/word.oil.tape new file mode 100644 index 000000000..168995053 --- /dev/null +++ b/docs/src/development/vhs/word/word.oil.tape @@ -0,0 +1,9 @@ +Source ../oil.tape + +Output out/word.oil.gif +Output out/word.oil.ascii + +Type "example " Sleep 1 Tab@1 2 +Type "ac" Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/word/word.powershell.tape b/docs/src/development/vhs/word/word.powershell.tape new file mode 100644 index 000000000..e1c4a79f1 --- /dev/null +++ b/docs/src/development/vhs/word/word.powershell.tape @@ -0,0 +1,9 @@ +Source ../powershell.tape + +Output out/word.powershell.gif +Output out/word.powershell.ascii + +Type "example " Sleep 1 Tab@1 +Type "ac" Sleep 1 Tab@1 + +Sleep 2 diff --git a/docs/src/development/vhs/word/word.xonsh.tape b/docs/src/development/vhs/word/word.xonsh.tape new file mode 100644 index 000000000..ee9c810d2 --- /dev/null +++ b/docs/src/development/vhs/word/word.xonsh.tape @@ -0,0 +1,9 @@ +Source ../xonsh.tape + +Output out/word.xonsh.gif +Output out/word.xonsh.ascii + +Type "example " +Sleep 1 Tab@1 2 Enter + +Sleep 2 diff --git a/docs/src/development/vhs/word/word.zsh.tape b/docs/src/development/vhs/word/word.zsh.tape new file mode 100644 index 000000000..133586be8 --- /dev/null +++ b/docs/src/development/vhs/word/word.zsh.tape @@ -0,0 +1,9 @@ +Source ../zsh.tape + +Output out/word.zsh.gif +Output out/word.zsh.ascii + +Type "example " +Sleep 1 Tab@1 2 Enter + +Sleep 2 diff --git a/docs/src/development/vhs/xonsh.tape b/docs/src/development/vhs/xonsh.tape new file mode 100644 index 000000000..0511fbc29 --- /dev/null +++ b/docs/src/development/vhs/xonsh.tape @@ -0,0 +1,15 @@ +Require example + +Set Theme "Snazzy" +Set FontFamily "JetBrains Mono" +Set FontSize 30 +Set Width 1400 +Set Height 300 +Set Padding 0 + +Set Shell "xonsh" + +Hide +Type@10ms "exec($(example _carapace xonsh))" Enter +Type@10ms "clear" Enter +Show diff --git a/docs/src/development/vhs/zsh.tape b/docs/src/development/vhs/zsh.tape new file mode 100644 index 000000000..7ba17e040 --- /dev/null +++ b/docs/src/development/vhs/zsh.tape @@ -0,0 +1,18 @@ +Require example + +Set Theme "Snazzy" +Set FontFamily "JetBrains Mono" +Set FontSize 30 +Set Width 1400 +Set Height 300 +Set Padding 0 + +Set Shell "zsh" + +Hide +Type@10ms "autoload -U compinit && compinit" Enter +Type@10ms "zstyle ':completion:*' menu select" Enter +Type@10ms "zstyle ':completion:*' format $'\e[2;37mCompleting %d\e[m'" Enter +Type@10ms "source <(example _carapace zsh)" Enter +Type@10ms "clear" Enter +Show