Skip to content

Commit 0cf117c

Browse files
Merge pull request #300 from dixyushi/update-doc-displayContent
Update doc display content
2 parents 9fe530a + 314fb63 commit 0cf117c

1 file changed

Lines changed: 22 additions & 10 deletions

File tree

documentation/Functions.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -607,20 +607,28 @@ If the tutorial should be tested on the console environment, you have to specify
607607
***
608608

609609
### displayContent <a name="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+
610612
#### 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.
616619

617-
#### Details
618-
Available attributes in the json objects:
620+
Note: The title should never be empty and it is of type string.
619621

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.
623629

630+
#### example
631+
displayContent("Step title", [{ "file": "files/description.asciidoc" }, { "content": "This is just plain content." }, { "image": "files/image.png" }])
624632

625633
#### Formatting rules for content and .asciidoc or .txt files.
626634
* 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:
648656
The tutorials repository can be found https://github.com/devonfw-tutorials/tutorials/issues[here].
649657
```
650658

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.
662+
651663
***
652664

653665
### adaptTemplatesCobiGen <a name="adaptTemplatesCobiGen"></a>

0 commit comments

Comments
 (0)