Groups & Tabsets
Groups
Groups allow users to easily switch between different variants of the documentation. In order for a Group to be activated and work on a page, you need specifiy an existing group at the top of the .adoc
file. For example on this page a Java/Scala group has been added using :page-supergroup-java-scala: Language
. As a result a drop down picker has been added to the rendered page that visitors can use to pick their preferred language.
Please refer to your documentation’s |
= Groups & Tabsets
:page-supergroup-java-scala: Language
Adding content variants
Inline text
Plain inline text about [.group-scala]#scala# [.group-java]#java#.
Bold styling [.group-scala]#*scala*# [.group-java]#*java*# or formatted as [.group-scala]#`scala code`# [.group-java]#`java code`#.
Result
Plain inline text about scala java that respects super groups.
Bold styling scala java or formatted as scala code
java code
.
Tabsets
Group Tabsets
Group Tabsets allow you to define 'tabbed' content that respect the users current 'Group' selection.
[.tabset]
Java::
+
[source,java]
----
public class Java {
private String name;
public Person(String name) {
this.name = name;
}
}
----
Scala::
+
[source,scala]
----
public class Scala {
private String name;
public Person(String name) {
this.name = name;
}
}
----
Result
- Java
-
public class Java { private String name; public Person(String name) { this.name = name; } }
- Scala
-
public class Scala { private String name; public Person(String name) { this.name = name; } }
Stand-alone Tabs
You can also use the tabset syntax to define a stand-alone Tabbed UI element. In this case the tabs are rendered but not respect a group setting.
[.tabset]
Play Station::
This is the Play Station stuff for the first tab.
Xbox::
This is the Xbox stuff for the second tab.
Result
- Play Station
-
This is the Play Station stuff for the first tab.
- Xbox
-
This is the Xbox stuff for the second tab.
And a more complex example:
[.tabset]
Tab One::
+
--
Akka provides an API called https://doc.akka.io/docs/akka/current/discovery/index.html[Akka Discovery] that includes a number of backends. Several are compatible with a Kubernetes environment. We're going to use a service locator implementation built on Akka Discovery, and then we're going to use the DNS implementation of Akka discovery to discover other services.
[source,console]
----
$ a code block
----
--
Tab Two::
+
--
This is the java of the second tab.
[source,json]
----
{
"name": "module-name",
"version": "10.0.1",
"description": "An example module to illustrate the usage of package.json",
"author": "Author Name <author@example.com>",
"scripts": {
"test": "mocha",
"lint": "eslint"
}
}
----
--
Result
- Tab One
-
Akka provides an API called Akka Discovery that includes a number of backends. Several are compatible with a Kubernetes environment. We’re going to use a service locator implementation built on Akka Discovery, and then we’re going to use the DNS implementation of Akka discovery to discover other services.
$ a code block
- Tab Two
-
This is the java of the second tab.
{ "name": "module-name", "version": "10.0.1", "description": "An example module to illustrate the usage of package.json", "author": "Author Name <author@example.com>", "scripts": { "test": "mocha", "lint": "eslint" } }