Use tabs in samples

- Use tabbing model from a new docs backend.
- Relates #637
This commit is contained in:
Janne Valkealahti
2023-05-01 08:29:37 +01:00
parent 6db122a498
commit c36aa41878

View File

@@ -5,54 +5,42 @@ ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
Short style _POSIX_ option is usually just a synonym to long format. As
shown below option `--arg` is equal to `-a`.
[tabs]
====
Programmatic::
+
[source, java, indent=0]
[source,java,indent=0,role="primary"]
.Programmatic
----
include::{snippets}/ShortOptionSnippets.java[tag=option-type-string-programmatic]
----
Annotation::
+
[source, java, indent=0]
[source,java,indent=0,role="secondary"]
.Annotation
----
include::{snippets}/ShortOptionSnippets.java[tag=option-type-string-annotation]
----
Legacy Annotation::
+
[source, java, indent=0]
[source,java,indent=0,role="secondary"]
.Legacy Annotation
----
include::{snippets}/ShortOptionSnippets.java[tag=option-type-string-legacyannotation]
----
====
Short option with combined format is powerful if type is defined as a flag
which means type is a _boolean_. That way you can define a presence of a flags
as `-abc`, `-abc true` or `-abc false`.
[tabs]
====
Programmatic::
+
[source, java, indent=0]
[source,java,indent=0,role="primary"]
.Programmatic
----
include::{snippets}/ShortOptionSnippets.java[tag=option-type-multiple-booleans-programmatic]
----
Annotation::
+
[source, java, indent=0]
[source,java,indent=0,role="secondary"]
.Annotation
----
include::{snippets}/ShortOptionSnippets.java[tag=option-type-multiple-booleans-annotation]
----
Legacy Annotation::
+
[source, java, indent=0]
[source,java,indent=0,role="secondary"]
.Legacy Annotation
----
include::{snippets}/ShortOptionSnippets.java[tag=option-type-multiple-booleans-legacyannotation]
----
====