Skip to content

Commit 8b3824f

Browse files
committed
initial commit
1 parent 0945379 commit 8b3824f

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

documentation/Functions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The following functions are already implemented:
1818
* [npmInstall](#npmInstall)
1919
* [dockerCompose](#dockerCompose)
2020
* [downloadFile](#downloadFile)
21-
* [nextKatacodaStep](#nextKatacodaStep)
21+
* [displayContent](#displayContent)
2222
* [adaptTemplatesCobiGen](#adaptTemplatesCobiGen)
2323
* [createDevon4ngProject](#createDevon4ngProject)
2424
* [addSetupScript](#addSetupScript)
@@ -349,19 +349,19 @@ path: The URL path on which is checked if the server is running
349349
If the tutorial should be tested on the console environment, you have to specify a port.
350350
***
351351

352-
### nextKatacodaStep <a name="nextKatacodaStep"></a>
352+
### displayContent <a name="displayContent"></a>
353353
#### parameter
354354
1. The title of the step.
355-
2. An array of json objects with files, content, or images to be rendered within the katacoda step.
355+
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!
356356
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.
357357
#### example
358-
nextKatacodaStep("Step title", [{ "file": "files/description.md" }, { "content": "This is just plain content." }, { "image": "files/image.png" }])
358+
display("Step title", [{ "file": "files/description.asciidoc" }, { "content": "This is just plain content." }, { "image": "files/image.png" }])
359359

360360
#### Details
361361
Available attributes in the json objects:
362362

363-
file: Path to a file whose content is to be displayed in the katacoda step (e.g. .md or .txt file).
364-
content: Plain text to be displayed in the katacoda step.
363+
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. additional formating information.
364+
content: Plain text to be displayed in the katacoda step. This Text should be following the formating of markdown or asciidoc // Todo
365365
image: Path to an image to be displayed in the katacoda step.
366366

367367
***

runners/console/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ export class Console extends Runner {
413413
return result;
414414
}
415415

416-
runNextKatacodaStep(runCommand: RunCommand): RunResult {
416+
runDisplayContent(runCommand: RunCommand): RunResult {
417417
//Only needed for katacoda and wiki runner
418418
return null;
419419
}

runners/katacoda/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ export class Katacoda extends Runner {
344344
return null;
345345
}
346346

347-
runNextKatacodaStep(runCommand: RunCommand): RunResult {
347+
runDisplayContent(runCommand: RunCommand): RunResult {
348348
let tempFile = path.join(this.getTempDirectory(), runCommand.command.name + ".md");
349349
fs.writeFileSync(tempFile, "");
350350
for(let i = 0; i < runCommand.command.parameters[1].length; i++) {
@@ -364,7 +364,7 @@ export class Katacoda extends Runner {
364364
let content = fs.readFileSync(tempFile, "utf-8");
365365
this.pushStep(runCommand, runCommand.command.parameters[0], "step" + runCommand.stepIndex + ".md");
366366

367-
this.renderTemplate("nextKatacodaStep.md", this.outputPathTutorial + "step" + runCommand.stepIndex + ".md", { text: runCommand.text, textAfter: runCommand.textAfter, content: content });
367+
this.renderTemplate("displayContent.md", this.outputPathTutorial + "step" + runCommand.stepIndex + ".md", { text: runCommand.text, textAfter: runCommand.textAfter, content: content });
368368

369369
if(runCommand.command.parameters[2]) {
370370
this.currentDir = path.join(this.getVariable(this.WORKSPACE_DIRECTORY), runCommand.command.parameters[2]);
File renamed without changes.

runners/wikiConsole/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export class WikiConsole extends WikiRunner {
155155
return null;
156156
}
157157

158-
runNextKatacodaStep(runCommand: RunCommand): RunResult {
158+
rundisplayContent(runCommand: RunCommand): RunResult {
159159
let tempFile = path.join(this.getTempDirectory(), runCommand.command.name + ".md");
160160
fs.writeFileSync(tempFile, "");
161161
for(let i = 0; i < runCommand.command.parameters[1].length; i++) {
@@ -172,7 +172,7 @@ export class WikiConsole extends WikiRunner {
172172
}
173173

174174
let content = fs.readFileSync(tempFile, "utf-8");
175-
this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "nextKatacodaStep.asciidoc"), { title: runCommand.command.parameters[0], content: content, path: runCommand.command.parameters[2]});
175+
this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "displayContent.asciidoc"), { title: runCommand.command.parameters[0], content: content, path: runCommand.command.parameters[2]});
176176

177177
return null;
178178
}

runners/wikiConsole/templates/nextKatacodaStep.asciidoc renamed to runners/wikiConsole/templates/displayContent.asciidoc

File renamed without changes.

0 commit comments

Comments
 (0)