Migrate docs shell samples to asciinema
- Update antora settings - Move cast files and remove old ones - Switch shell svg's to asciinema - Fixes #884
@@ -10,6 +10,7 @@ antora:
|
||||
- '@antora/atlas-extension'
|
||||
- require: '@springio/antora-extensions/root-component-extension'
|
||||
root_component_name: 'shell'
|
||||
- require: '@springio/antora-extensions/asciinema-extension'
|
||||
site:
|
||||
title: Spring Shell
|
||||
url: https://docs.spring.io/spring-shell/reference/
|
||||
@@ -38,4 +39,5 @@ runtime:
|
||||
format: pretty
|
||||
ui:
|
||||
bundle:
|
||||
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.4/ui-bundle.zip
|
||||
url: https://github.com/spring-io/antora-ui-spring/releases/download/latest/ui-bundle.zip
|
||||
snapshot: true
|
||||
|
||||
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 8.5 KiB |
@@ -1,7 +1,7 @@
|
||||
[[using-shell-components-flow]]
|
||||
= Flow
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
When you use xref:components/ui/index.adoc[Flow Components] to build something that involves
|
||||
use of a multiple components, your implementation may become a bit cluttered.
|
||||
@@ -16,7 +16,10 @@ The following listings show examples of flows and their output in a shell:
|
||||
include::{snippets}/FlowComponentSnippets.java[tag=snippet1]
|
||||
----
|
||||
|
||||
image::component-flow-showcase-1.svg[text input]
|
||||
[asciinema,rows=15]
|
||||
----
|
||||
include::example$component-flow-showcase-1.cast[]
|
||||
----
|
||||
|
||||
Normal execution order of a components is same as defined with a builder. It's
|
||||
possible to conditionally choose where to jump in a flow by using a `next`
|
||||
@@ -28,7 +31,11 @@ or doesn't exist flow is essentially stopped right there.
|
||||
include::{snippets}/FlowComponentSnippets.java[tag=snippet2]
|
||||
----
|
||||
|
||||
image::component-flow-conditional-1.svg[text input]
|
||||
[asciinema,rows=11]
|
||||
----
|
||||
include::example$component-flow-conditional-1.cast[]
|
||||
----
|
||||
|
||||
|
||||
TIP: The result from running a flow returns `ComponentFlowResult`, which you can
|
||||
use to do further actions.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[[using-shell-components-ui-confirmation]]
|
||||
= Confirmation
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
The confirmation component asks a user for a simple confirmation. It is essentially a
|
||||
yes-or-no question.
|
||||
@@ -11,9 +11,12 @@ yes-or-no question.
|
||||
include::{snippets}/UiComponentSnippets.java[tag=snippet5]
|
||||
----
|
||||
|
||||
The following image shows the typical output from a confirmation component:
|
||||
The following screencast shows the typical output from a confirmation component:
|
||||
|
||||
image::component-confirmation-1.svg[text input]
|
||||
[asciinema,rows=8]
|
||||
----
|
||||
include::example$component-confirmation-1.cast[]
|
||||
----
|
||||
|
||||
The context object is `ConfirmationInputContext`. The following table describes its context variables:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[[using-shell-components-ui-multiselect]]
|
||||
= Multi Select
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
The multi select component asks a user to select multiple items from a list.
|
||||
The following listing shows an example:
|
||||
@@ -11,9 +11,12 @@ The following listing shows an example:
|
||||
include::{snippets}/UiComponentSnippets.java[tag=snippet7]
|
||||
----
|
||||
|
||||
The following image shows a typical multi-select component:
|
||||
The following screencast shows a typical multi-select component:
|
||||
|
||||
image::component-multi-select-1.svg[text input]
|
||||
[asciinema,rows=9]
|
||||
----
|
||||
include::example$component-multi-select-1.cast[]
|
||||
----
|
||||
|
||||
The context object is `MultiItemSelectorContext`. The following table describes its context variables:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[[using-shell-components-ui-pathinput]]
|
||||
= Path Input
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
The path input component asks a user for a `Path` and gives additional information about a path itself.
|
||||
|
||||
@@ -10,9 +10,12 @@ The path input component asks a user for a `Path` and gives additional informati
|
||||
include::{snippets}/UiComponentSnippets.java[tag=snippet4]
|
||||
----
|
||||
|
||||
The following image shows typical output from a path input component:
|
||||
The following screencast shows typical output from a path input component:
|
||||
|
||||
image::component-path-input-1.svg[text input]
|
||||
[asciinema,rows=6]
|
||||
----
|
||||
include::example$component-path-input-1.cast[]
|
||||
----
|
||||
|
||||
The context object is `PathInputContext`. The following table describes its context variables:
|
||||
|
||||
|
||||
@@ -15,9 +15,12 @@ include::{snippets}/UiComponentSnippets.java[tag=snippet9]
|
||||
NOTE: Logic for search is passed as is into algorithms documented
|
||||
in xref:appendices/techintro/searchalgorithm.adoc[Search Algorithms].
|
||||
|
||||
The following image shows typical output from a path search component:
|
||||
The following screencast shows typical output from a path search component:
|
||||
|
||||
image::component-path-search-1.svg[text input]
|
||||
[asciinema,rows=10]
|
||||
----
|
||||
include::example$component-path-search-1.cast[]
|
||||
----
|
||||
|
||||
The context object is `PathSearchContext`. The following table describes its context variables:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[[using-shell-components-ui-singleselect]]
|
||||
= Single Select
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
A single select component asks a user to choose one item from a list. It is similar to a simple
|
||||
dropbox implementation. The following listing shows an example:
|
||||
@@ -11,9 +11,12 @@ dropbox implementation. The following listing shows an example:
|
||||
include::{snippets}/UiComponentSnippets.java[tag=snippet6]
|
||||
----
|
||||
|
||||
The following image shows typical output for a single select component:
|
||||
The following screencast shows typical output for a single select component:
|
||||
|
||||
image::component-single-select-1.svg[text input]
|
||||
[asciinema,rows=8]
|
||||
----
|
||||
include::example$component-single-select-1.cast[]
|
||||
----
|
||||
|
||||
The context object is `SingleItemSelectorContext`. The following table describes its context variables:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[[using-shell-components-ui-stringinput]]
|
||||
= String Input
|
||||
|
||||
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
|
||||
ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]
|
||||
|
||||
The string input component asks a user for simple text input, optionally masking values
|
||||
if the content contains something sensitive. The following listing shows an example:
|
||||
@@ -11,9 +11,12 @@ if the content contains something sensitive. The following listing shows an exam
|
||||
include::{snippets}/UiComponentSnippets.java[tag=snippet3]
|
||||
----
|
||||
|
||||
The following image shows typical output from a string input component:
|
||||
The following screencast shows typical output from a string input component:
|
||||
|
||||
image::component-text-input-1.svg[text input]
|
||||
[asciinema,rows=6]
|
||||
----
|
||||
include::example$component-text-input-1.cast[]
|
||||
----
|
||||
|
||||
The context object is `StringInputContext`. The following table lists its context variables:
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
Some info how screen recordings were made
|
||||
|
||||
asciinema rec spring-shell-docs/src/main/asciidoc/asciinema/component-text-input-1.cast
|
||||
asciinema rec spring-shell-docs/src/main/asciidoc/asciinema/component-path-input-1.cast
|
||||
asciinema rec spring-shell-docs/src/main/asciidoc/asciinema/component-path-search-1.cast
|
||||
asciinema rec spring-shell-docs/src/main/asciidoc/asciinema/component-confirmation-1.cast
|
||||
asciinema rec spring-shell-docs/src/main/asciidoc/asciinema/component-single-select-1.cast
|
||||
asciinema rec spring-shell-docs/src/main/asciidoc/asciinema/component-multi-select-1.cast
|
||||
asciinema rec spring-shell-docs/src/main/asciidoc/asciinema/component-flow-showcase-1.cast
|
||||
asciinema rec spring-shell-docs/src/main/asciidoc/asciinema/component-flow-conditional-1.cast
|
||||
|
||||
svg-term \
|
||||
--in spring-shell-docs/src/main/asciidoc/asciinema/component-text-input-1.cast \
|
||||
--out spring-shell-docs/src/main/asciidoc/images/component-text-input-1.svg
|
||||
svg-term \
|
||||
--in spring-shell-docs/src/main/asciidoc/asciinema/component-path-input-1.cast \
|
||||
--out spring-shell-docs/src/main/asciidoc/images/component-path-input-1.svg
|
||||
svg-term \
|
||||
--in spring-shell-docs/src/main/asciidoc/asciinema/component-path-search-1.cast \
|
||||
--out spring-shell-docs/src/main/asciidoc/images/component-path-search-1.svg
|
||||
svg-term \
|
||||
--in spring-shell-docs/src/main/asciidoc/asciinema/component-confirmation-1.cast \
|
||||
--out spring-shell-docs/src/main/asciidoc/images/component-confirmation-1.svg
|
||||
svg-term \
|
||||
--in spring-shell-docs/src/main/asciidoc/asciinema/component-single-select-1.cast \
|
||||
--out spring-shell-docs/src/main/asciidoc/images/component-single-select-1.svg
|
||||
svg-term \
|
||||
--in spring-shell-docs/src/main/asciidoc/asciinema/component-multi-select-1.cast \
|
||||
--out spring-shell-docs/src/main/asciidoc/images/component-multi-select-1.svg
|
||||
svg-term \
|
||||
--in spring-shell-docs/src/main/asciidoc/asciinema/component-flow-showcase-1.cast \
|
||||
--out spring-shell-docs/src/main/asciidoc/images/component-flow-showcase-1.svg
|
||||
svg-term \
|
||||
--in spring-shell-docs/src/main/asciidoc/asciinema/component-flow-conditional-1.cast \
|
||||
--out spring-shell-docs/src/main/asciidoc/images/component-flow-conditional-1.svg
|
||||
@@ -26,7 +26,7 @@ antora {
|
||||
'@antora/atlas-extension': '1.0.0-alpha.1',
|
||||
'@antora/collector-extension': '1.0.0-alpha.3',
|
||||
'@asciidoctor/tabs': '1.0.0-beta.3',
|
||||
'@springio/antora-extensions': '1.4.2',
|
||||
'@springio/antora-extensions': '1.8.0',
|
||||
'@springio/asciidoctor-extensions': '1.0.0-alpha.8',
|
||||
]
|
||||
}
|
||||
|
||||