diff --git a/runners/wikiConsole/index.ts b/runners/wikiConsole/index.ts index 74a3e479..67ba96fd 100644 --- a/runners/wikiConsole/index.ts +++ b/runners/wikiConsole/index.ts @@ -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, ""); @@ -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; } } diff --git a/runners/wikiConsole/templates/adaptTemplates.asciidoc b/runners/wikiConsole/templates/adaptTemplates.asciidoc new file mode 100644 index 00000000..d57429a3 --- /dev/null +++ b/runners/wikiConsole/templates/adaptTemplates.asciidoc @@ -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. + + + + diff --git a/runners/wikiEclipse/index.ts b/runners/wikiEclipse/index.ts index 71b73d4c..8bb5efb4 100644 --- a/runners/wikiEclipse/index.ts +++ b/runners/wikiEclipse/index.ts @@ -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; + } } \ No newline at end of file diff --git a/runners/wikiEclipse/templates/adaptTemplates.asciidoc b/runners/wikiEclipse/templates/adaptTemplates.asciidoc new file mode 100644 index 00000000..84a6ffd3 --- /dev/null +++ b/runners/wikiEclipse/templates/adaptTemplates.asciidoc @@ -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. \ No newline at end of file