Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions documentation/Functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ path: The URL path on which is checked if the server is running
#### parameter
1. The title of the step.
2. An array of json objects with files, content, or images to be rendered within the katacoda step.
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.
#### example
nextKatacodaStep("Step title", [{ "file": "files/description.md" }, { "content": "This is just plain content." }, { "image": "files/image.png" }])

Expand Down
7 changes: 6 additions & 1 deletion runners/katacoda/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export class Katacoda extends Runner {

runCreateFolder(step: Step, command: Command): RunResult {
let folderPath = new DirUtils().getCdParam(this.currentDir, path.join(this.getVariable(this.workspaceDirectory), command.parameters[0]));

this.steps.push({
"title": "Create a new folder",
"text": "step" + this.stepsCount + ".md"
Expand Down Expand Up @@ -335,6 +335,11 @@ export class Katacoda extends Runner {
"text": "step" + this.stepsCount + ".md"
});
this.renderTemplate("nextKatacodaStep.md", this.outputPathTutorial + "step" + (this.stepsCount++) + ".md", { text: step.text, textAfter: step.textAfter, content: content });

if(command.parameters[2]) {
this.currentDir = path.join(this.getVariable(this.workspaceDirectory), command.parameters[2]);
}

return null;
}

Expand Down