Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jvalkeal committed Oct 7, 2023
1 parent 2e95fcc commit 9a5f189
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 24 deletions.
26 changes: 13 additions & 13 deletions spring-shell-docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
* xref:index.adoc[Overview]
* xref:getting-started.adoc[]
* xref:using-shell-basics.adoc[]
** xref:using-shell-basics-reading.adoc[]
* xref:basics/index.adoc[]
** xref:basics/reading.adoc[]
* xref:commands/index.adoc[]
** xref:commands/registration/index.adoc[]
** xref:commands/registration/programmatic.adoc[]
Expand Down Expand Up @@ -72,18 +72,18 @@
** xref:customization/singlecommand.adoc[]
** xref:customization/contextclose.adoc[]
* xref:using-shell-execution.adoc[]
* xref:using-shell-testing.adoc[]
** xref:using-shell-testing-basics.adoc[]
** xref:using-shell-testing-settings.adoc[]
* xref:testing/index.adoc[]
** xref:testing/basics.adoc[]
** xref:testing/settings.adoc[]
* Appendices
** xref:appendices-techical-intro.adoc[]
*** xref:appendices-techical-intro-registration.adoc[]
*** xref:appendices-techical-intro-parser.adoc[]
*** xref:appendices-techical-intro-execution.adoc[]
*** xref:appendices-techical-intro-commandcontext.adoc[]
*** xref:appendices-techical-intro-commandcatalog.adoc[]
*** xref:appendices-techical-intro-theming.adoc[]
*** xref:appendices-techical-intro-searchalgorithm.adoc[]
** xref:appendices/techintro/index.adoc[]
*** xref:appendices/techintro/registration.adoc[]
*** xref:appendices/techintro/parser.adoc[]
*** xref:appendices/techintro/execution.adoc[]
*** xref:appendices/techintro/commandcontext.adoc[]
*** xref:appendices/techintro/commandcatalog.adoc[]
*** xref:appendices/techintro/theming.adoc[]
*** xref:appendices/techintro/searchalgorithm.adoc[]
** xref:appendices-debugging.adoc[]
** xref:appendices/tui/index.adoc[]
*** xref:appendices/tui/viewdev.adoc[]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[[command-catalog]]
= Command Catalog

ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]

The `CommandCatalog` interface defines how command registrations exist in
a shell application. It is possible to dynamically register and de-register
commands, which gives flexibility for use cases where possible commands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
= Command Context
:page-section-summary-toc: 1

ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]

The `CommandContext` interface gives access to a currently running
context. You can use it to get access to options:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
= Command Execution
:page-section-summary-toc: 1

ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]

When command parsing has done its job and command registration has been resolved, command execution
does the hard work of running the code.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[#appendix-tech-intro-registration]
= Command Registration

ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]

Defining a command registration is a first step to introducing the structure of a command and its options
and parameters. This is loosely decoupled from what happens later, such as parsing command-line input and running
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[#appendix-tech-intro-searchalgorithm]
= Search Algorithms

ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]

`SearchMatch` is an interface to match _text_ with a _pattern_. Match
results are in a returned value `SearchMatchResult`. Match result
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[#appendix-tech-intro-theming]
= Theming

ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]

Styling in a theming is provided by a use of a _AttributedString_ from `JLine`.
Unfortunately styling in `JLine` is mostly undocumented but we try to go through
Expand Down
2 changes: 1 addition & 1 deletion spring-shell-docs/modules/ROOT/pages/commands/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]

In this section, we go through an actual command registration and leave command options
and execution for later in a documentation. You can find more detailed info in
xref:appendices-techical-intro-registration.adoc[Command Registration].
xref:appendices/techintro/registration.adoc[Command Registration].



Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[using-shell-components-ui-pathsearch]]
= Path Search

ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]

The path search component asks base directory for scan and optional search expression.
Results are shown in a single select list where user can pick a path.
Expand All @@ -13,7 +13,7 @@ include::{snippets}/UiComponentSnippets.java[tag=snippet9]
----

NOTE: Logic for search is passed as is into algorithms documented
in xref:appendices-techical-intro-searchalgorithm.adoc[Search Algorithms].
in xref:appendices/techintro/searchalgorithm.adoc[Search Algorithms].

The following image shows typical output from a path search component:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[theming]]
= Theming

ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
ifndef::snippets[:snippets: ../../../../src/test/java/org/springframework/shell/docs]

Current terminal implementations are rich in features and can usually show
something else that just plain text. For example a text can be styled to be
Expand All @@ -13,7 +13,7 @@ Spring Shell supports these via it's theming framework which contains two parts,
firstly _styling_ can be used to change text type and secondly _figures_ how
some characters are shown. These two are then combined together as a _theme_.

More about _theming_ internals, see xref:appendices-techical-intro-theming.adoc[Theming].
More about _theming_ internals, see xref:appendices/techintro/theming.adoc[Theming].

NOTE: Default theme is named `default` but can be change using property
`spring.shell.theme.name`. Other built-in theme named `dump` uses
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[using-shell-testing-basics]]
= Basics

ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
ifndef::snippets[:snippets: ../../../../src/test/java/org/springframework/shell/docs]

Spring Shell provides a number of utilities and annotations to help when testing your application.
Test support is provided by two modules: `spring-shell-test` contains core items, and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
= Testing
:page-section-summary-toc: 1

ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
ifndef::snippets[:snippets: ../../../../src/test/java/org/springframework/shell/docs]

Testing cli application is difficult due to various reasons:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[using-shell-testing-settings]]
= Settings

ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
ifndef::snippets[:snippets: ../../../../src/test/java/org/springframework/shell/docs]

Built in emulation uses terminal width 80 and height 24 on default.
Changing dimensions is useful if output would span into multiple
Expand Down

0 comments on commit 9a5f189

Please sign in to comment.