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
7 changes: 7 additions & 0 deletions runners/wikiConsole/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ export class WikiConsole extends WikiRunner {
return null;
}

runAdaptTemplatesCobiGen(runComannd: RunCommand): RunResult{
let devonPath = path.relative(this.getWorkingDirectory(), this.getVariable(this.WORKSPACE_DIRECTORY)).replace(/\\/g, "/");
this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "adaptTemplates.asciidoc"), {devonPath: devonPath});
return null;
}

runNextKatacodaStep(runCommand: RunCommand): RunResult {
let tempFile = path.join(this.getTempDirectory(), runCommand.command.name + ".md");
fs.writeFileSync(tempFile, "");
Expand All @@ -153,6 +159,7 @@ export class WikiConsole extends WikiRunner {

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

return null;
}
}
Expand Down
19 changes: 19 additions & 0 deletions runners/wikiConsole/templates/adaptTemplates.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
== Generate CobiGen Templates
How to use CobiGen, to generate templates for the following code generation.
More information about CobiGen on https://devonfw.com/website/pages/docs/master-cobigen.asciidoc.html.

=== Prerequisites

* An installed devonfw distribution is needed. To execute the CobiGen CLI, you have to install the devonfw IDE first. Follow the https://devonfw.com/website/pages/docs/devonfw-ide-introduction.asciidoc.html[devonfw IDE] documentation to install the same.

=== Generate CobiGen Templates with CobiGen CLI

First open a command prompt in your current workspace. You should be inside your devonfw directory, if not change your directory to *<%= devonPath;%>*.
Run the CobiGen command `devon cobigen adapt-templates`
to generate a new templates folder next to the CobiGen CLI and save its location in a configuration file.

You can also spezify the location of the templates folder with the parameter `--custom-location` or `-cl` and pass the absolute path to your custom location.




4 changes: 4 additions & 0 deletions runners/wikiEclipse/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,8 @@ export class WikiEclipse extends WikiRunner {
this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "createDevon4jProject.asciidoc"), { name: runCommand.command.parameters[0]});
return null;
}
runAdaptTemplatesCobiGen(runComannd: RunCommand): RunResult{
this.renderWiki(path.join(this.getRunnerDirectory(), "templates", "adaptTemplates.asciidoc"), {});
return null;
}
}
11 changes: 11 additions & 0 deletions runners/wikiEclipse/templates/adaptTemplates.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
== Generate new Templates for CobiGen
How to use CobiGen, to generate templates for the following code generation.
More information about CobiGen on https://devonfw.com/website/pages/docs/master-cobigen.asciidoc.html.

=== Prerequisites
An installed devonfw distribution is needed. To execute CobiGen in Eclipse IDE, you have to install the devonfw IDE with the Eclipse IDE first. Follow the https://devonfw.com/website/pages/docs/devonfw-ide-introduction.asciidoc.html[devonfw-ide] documentation to install the same.

=== Generate CobiGen Templates with Eclipse IDE

First, open Eclipse IDE, and if your file explorer is empty load any file, create a file, or project into Eclipse.
Right-click any file in the file explorer to open a dropdown menu where you can select CobiGen and an additional menu opens. Select *Adapt Templates...* and CobiGen starts generating a new template folder. CobiGen gives you a warning that existing templates will be overridden in your current workspace, you can confirm to continue. If the folder is already existing CobiGen will inform you, that for updating your templates you have to use the *Update Templates...* functionality else CobiGen will create a folder and download the latest template to use it. You can confirm the messages with *OK* or *Update* and the CobiGen templates folder is imported successfully.