|
| 1 | += Tutorial Compiler |
| 2 | +==== |
| 3 | +In this scenario you will use the tutorial-compiler to generate the "my-thai-star" tutorial. |
| 4 | +
|
| 5 | +The first part will be to setup your workspace. |
| 6 | +
|
| 7 | +Afterwards we will show you, how to write your own tutorials. |
| 8 | +
|
| 9 | +Requirements: |
| 10 | + * GitHub account |
| 11 | +
|
| 12 | +You can find the documentation here: |
| 13 | +
|
| 14 | +https://github.com/devonfw-forge/tutorial-compiler/wiki |
| 15 | +
|
| 16 | +==== |
| 17 | + |
| 18 | +==== |
| 19 | +# Setup your workspace |
| 20 | +Let's start! |
| 21 | +
|
| 22 | +First of all, go to the tutorial-compiler repository on GitHub: |
| 23 | +
|
| 24 | +https://github.com/devonfw-tutorials/tutorial-compiler |
| 25 | +
|
| 26 | +Fork the repository by clicking on the fork-button. |
| 27 | +This will create a copy of this repository in your GitHub account. You will find it in 'Your repositories'. |
| 28 | +
|
| 29 | +[step] |
| 30 | +-- |
| 31 | +nextKatacodaStep("Fork the 'tutorial-compiler'-repository and copy the URL", [{"image": "images/fork.jpg"}, {"content": "\nGo to your repositories, click on 'tutorial-compiler' and copy the repository URL as shown in image below.\n"}, {"image": "images/clone_code.jpg"}]) |
| 32 | +-- |
| 33 | +==== |
| 34 | + |
| 35 | + |
| 36 | +Usually you would paste the copied URLs next to the 'git clone' - command, but in this tutorial we will clone the original 'tutorial-compiler'-repository. Therefore we are able to write the asciidoc-files and generate the tutorials, but we can not push changes in the source code to it. |
| 37 | +[step] |
| 38 | +-- |
| 39 | +cloneRepository("", "https://github.com/devonfw-tutorials/tutorial-compiler.git") |
| 40 | +-- |
| 41 | + |
| 42 | +==== |
| 43 | +Switch to the 'tutorials'-repository and repeat all the previous steps: |
| 44 | +
|
| 45 | +https://github.com/devonfw-tutorials/tutorials.git |
| 46 | +
|
| 47 | +- Fork the 'tutorials'-repository |
| 48 | +- Copy the 'tutorials'-URL |
| 49 | +
|
| 50 | +[step] |
| 51 | +-- |
| 52 | +cloneRepository("", "https://github.com/devonfw-tutorials/tutorials.git") |
| 53 | +-- |
| 54 | +
|
| 55 | +After this step you should have both repositories in the same folder next to each other. |
| 56 | +==== |
| 57 | + |
| 58 | +[step] |
| 59 | +-- |
| 60 | +npmInstall("", {"name": "typescript", "global": true}) |
| 61 | +npmInstall("tutorial-compiler") |
| 62 | +-- |
| 63 | + |
| 64 | +# Write the my-thai-star tutorial |
| 65 | + |
| 66 | +Let's start with the second part of this tutorial and write the "my-thai-star" tutorial. |
| 67 | + |
| 68 | +[step] |
| 69 | +-- |
| 70 | +createFile("tutorials/my-thai-star/index.asciidoc") |
| 71 | +-- |
| 72 | + |
| 73 | +Add the tutorial title "My Thai Star" |
| 74 | +[step] |
| 75 | +-- |
| 76 | +changeFile("tutorials/my-thai-star/index.asciidoc", {"content": "= My Thai Star"}) |
| 77 | +-- |
| 78 | + |
| 79 | +You have to write the introduction in between these equal signs '====' and underneath the title. |
| 80 | + |
| 81 | +[step] |
| 82 | +-- |
| 83 | +changeFile("tutorials/my-thai-star/index.asciidoc", {"file": "text/intro.txt", "placeholder": "= My Thai Star" }) |
| 84 | +-- |
| 85 | + |
| 86 | +Last but not least add all the needed functions for this tutorial. |
| 87 | + |
| 88 | +Follow the link below to find a list of all available functions and their descriptions |
| 89 | +https://github.com/devonfw-tutorials/tutorial-compiler/wiki/Functions |
| 90 | + |
| 91 | +Feel free to add your own functions to the compiler |
| 92 | + |
| 93 | +You will find all the information you need on: |
| 94 | + |
| 95 | +https://github.com/devonfw-tutorials/tutorial-compiler/wiki/Development |
| 96 | + |
| 97 | +[step] |
| 98 | +-- |
| 99 | +changeFile("tutorials/my-thai-star/index.asciidoc", {"file": "text/functions.txt", "placeholder": "This is the online demo of https://github.com/devonfw/my-thai-star" }) |
| 100 | +-- |
| 101 | + |
| 102 | +==== |
| 103 | +For this step you need to open you local terminal at your forked and cloned 'tutorials' folder. |
| 104 | +Run the commands |
| 105 | +1. 'git add .' |
| 106 | +2. 'git commit -m "my-thai-star"' |
| 107 | +3. 'git push' |
| 108 | +
|
| 109 | +This will save all the changes and push them into your GitHub-repository 'tutorials'. |
| 110 | +
|
| 111 | +Switch to your browser and open: |
| 112 | +https://github.com/devonfw-tutorials/tutorials |
| 113 | +
|
| 114 | +Click on 'Pull requests' > 'New pull request'. |
| 115 | +
|
| 116 | +[step] |
| 117 | +-- |
| 118 | +nextKatacodaStep("Create a pull request", [{"image": "images/pull_request.jpg"},{"image": "images/compare.jpg"}]) |
| 119 | +-- |
| 120 | +
|
| 121 | +You might have to click on 'compare across forks'. |
| 122 | +
|
| 123 | +Select |
| 124 | +
|
| 125 | + * base repository: devonfw-tutorials |
| 126 | + * base: main |
| 127 | + * head repository: [username]/tutorials |
| 128 | + * compare: 'main' |
| 129 | +
|
| 130 | +and finally create the pull request by clicking on 'Create pull request'. |
| 131 | +
|
| 132 | +After a while you will find your tutorial on: |
| 133 | +https://www.katacoda.com/devonfw-dev |
| 134 | +==== |
0 commit comments