Skip to content

Commit 63c2dd1

Browse files
Merge pull request #72 from GuentherJulian/tutorial/tutorial-compiler
tutorial-compiler tutorial
2 parents 836ff32 + 5a6986d commit 63c2dd1

16 files changed

Lines changed: 232 additions & 175 deletions
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
If you want to add some additional text after the step to explain the results of a step then you have to use the following syntax.
2+
3+
```
4+
====
5+
The explanation for the step
6+
[step]
7+
--
8+
functionName(parameters)
9+
--
10+
The explanation of the results
11+
====
12+
```
13+
14+
Here the whole block has to be surrounded by `====`.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Create a new branch inside the cloned repository.
2+
3+
Navigate into the tutorials directory.
4+
5+
`cd tutorials`{{execute T1}}
6+
7+
Create a new branch for your tutorial and switch into this branch.
8+
9+
`git branch tutorial/myOwnTutorial`{{execute T1}}
10+
11+
`git checkout tutorial/myOwnTutorial`{{execute T1}}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Before starting write content into the tutorial, you have to create a pull request from your newly created branch into the main repository.
2+
This has the advantage that your tutorial will automatically be build and pushed to https://katacoda.com/devonfw-dev. So you can directly test it.
3+
4+
For this step you need to open you local terminal at your forked and cloned 'tutorials' folder and run the following commands:
5+
1. 'git add .'
6+
2. 'git commit -m "initial commit for tutorial myTutorial"'
7+
3. 'git push'
8+
9+
This will save all the changes and push them into your tutorials GitHub repository.
10+
11+
Switch to your browser and open:
12+
https://github.com/devonfw-tutorials/tutorials
13+
14+
Click on 'Pull requests' > 'New pull request'.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
Select
3+
4+
* base repository: devonfw-tutorials
5+
* base: main
6+
* head repository: [your username]/tutorials
7+
* compare: [your branch name]
8+
9+
and finally create the pull request by clicking on 'Create pull request'.
10+
11+
Write 'WIP:' in front of the pull request title to show that you are still working on this pull request. 'WIP' stands for 'Work In Progress'.
12+
13+
A workflow in the tutorials repository will build the tutorial. Currently the pipeline will fails because a tutorial must contain at least a title, a description and one step.
14+
15+
Let's fix that and fill the tutorial.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
= Title of my new tutorial
2+
====
3+
In this section you can write the description of the tutorial. This can consist of several lines.
4+
5+
The description should explain the tutorial in a few words and explain what is to be learned.
6+
====
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Now you should have a ideo how to create your own tutorials.
2+
3+
There is also a way to test your tutorials on your local machine. For this you have to clone the tutorial-compiler repository.
4+
5+
The directory with the tutorial-compiler has to be located next to the directory with the tutorials repository.
6+
7+
So go back to the root directory and clone the repository.
8+
9+
`cd /root`{{execute T1}}
10+
11+
`git clone https://github.com/devonfw-tutorials/tutorial-compiler.git`{{execute T1}}
12+
13+
The tutorial-compiler needs typescript to be installed to work. So install typescript on your machine.
14+
15+
`npm install typescript -g`{{execute T1}}
16+
17+
Now navigate into the tutorial-compiler directory and install the needed dependencies.
18+
19+
`cd tutorial-compiler`{{execute T1}}
20+
21+
`npm install`{{execute T1}}
22+
23+
24+
# Test your tutorial locally
25+
To run the tutorial-compiler execute the following command:
26+
27+
`bash localBuildRun.sh -e katacoda -p myTutorial`{{execute T1}}
28+
29+
This will execute your newly create tutorial in the 'katacoda' environment. If you obmit the '-e' and '-p' paramter, all tutorials are executed in all environments.
30+
31+
The tutorial-compiler now generates the files needed for a katacoda tutorial. You can find the files in the 'build/output/katacoda/myTutorial' directory of the tutorial compiler.
32+
The step you added to your tutorial is shown in the following file:
33+
34+
`tutorial-compiler/build/output/katacoda/myTutorial/step1.md`{{open}}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
You now have a working tutorial.
2+
3+
Push the changes again to GitHub by executing the following commands:
4+
5+
1. 'git add .'
6+
2. 'git commit -m "added createFile step to the tutorial"'
7+
3. 'git push'
8+
9+
This will automatically start the workflow in the tutorials repository.
10+
11+
After a while you can find your tutorial on https://katacoda.com/devonfw-dev.
12+
13+
After you have completed your tutorial and tested it on the katacoda account, remove the 'WIP' from your pull request to show that the tutorial is finished.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
= Title of my new tutorial
2+
====
3+
In this section you can write the description of the tutorial. This can consist of several lines.
4+
5+
The description should explain the tutorial in a few words and explain what is to be learned.
6+
====
7+
8+
Before the '[step]' keyword the explanation is written.
9+
The explanation can consist of multiple lines.
10+
[step]
11+
--
12+
createFile("pathToTheFile/fileName.txt")
13+
--
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)