You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/Functions.md
+22-10Lines changed: 22 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -607,20 +607,28 @@ If the tutorial should be tested on the console environment, you have to specify
607
607
***
608
608
609
609
### displayContent <aname="displayContent"></a>
610
+
This function is only used when you want to display content such as text, image or any file content in your tutorial.
611
+
610
612
#### parameter
611
-
1. The title of the step.
612
-
2. An array of json objects with files, content, or images to be rendered within the Katacoda step. The use for this function is to display an image and some descriptive text. No Katacoda syntax is allowed in the files or the content!
613
-
3. (Optional) Path to the current directory where the user is located (relative to the workspace directory). Only needed if the directory is changed within this step.
614
-
#### example
615
-
display("Step title", [{ "file": "files/description.asciidoc" }, { "content": "This is just plain content." }, { "image": "files/image.png" }])
613
+
This function consists of two parameters.
614
+
615
+
1. First parameter:
616
+
-**Required**
617
+
-**Type**- String
618
+
-**Description**- The title of the step.
616
619
617
-
#### Details
618
-
Available attributes in the json objects:
620
+
Note: The title should never be empty and it is of type string.
619
621
620
-
1. file: Path to a file whose content is to be displayed in the Katacoda step (e.g. .asciidoc or .txt file). The file should be following the formating of asciidoc files.
621
-
2. content: Plain text to be displayed in the Katacoda step. This Text should be following the formating of asciidoc files.
622
-
3. image: Path to an image to be displayed in the Katacoda step.
622
+
2. Second parameter:
623
+
-**Required**
624
+
-**Type**- Array of JSON objects with files, content, or images to be rendered within the Katacoda step.
625
+
-**Description**-This function consists of three attributes. The use for this function is to display an image and some descriptive text. No Katacoda syntax is allowed in the files or the content!
626
+
* 1st attribute i.e. "file": Path to a file whose content is to be displayed in the Katacoda step (e.g. .asciidoc or .txt file). The file should be following the formating of asciidoc files.
627
+
* 2nd attribute i.e. "content": Plain text to be displayed in the Katacoda step. This Text should be following the formating of asciidoc files.
628
+
* 3rd attribute i.e. "image": Path to an image to be displayed in the Katacoda step. It should be placed under subfolder of the playbook directory.
623
629
630
+
#### example
631
+
displayContent("Step title", [{ "file": "files/description.asciidoc" }, { "content": "This is just plain content." }, { "image": "files/image.png" }])
624
632
625
633
#### Formatting rules for content and .asciidoc or .txt files.
626
634
* You can add headers to structure your text. The generated headers are shown in the examples below. The headers should fit into the overall structure of the generated wiki so level 1 header are not allowed, but the other header can be used at your judgement.
@@ -648,6 +656,10 @@ Link:
648
656
The tutorials repository can be found https://github.com/devonfw-tutorials/tutorials/issues[here].
649
657
```
650
658
659
+
Note:
660
+
661
+
1. You should avoid using any command inside any text file for which you want to display content. This will cause problems with the console runner and the tests.
0 commit comments