From 8c5eb238b4d2e73ebd2baee958614f635640904c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Signe=20Kirk=20Br=C3=B8db=C3=A6k?= Date: Sun, 19 Jan 2025 21:15:54 +0100 Subject: [PATCH 01/12] docs: :memo: add exercises --- sessions/lesson.qmd | 115 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 114 insertions(+), 1 deletion(-) diff --git a/sessions/lesson.qmd b/sessions/lesson.qmd index 36d7409..e6c7161 100644 --- a/sessions/lesson.qmd +++ b/sessions/lesson.qmd @@ -20,7 +20,120 @@ Specific learning objectives are: TODO: Reading text ::: -## Exercise: TODO: Add title +## Exercise: Add a new file and modify the content + +First, we want to add a file to the repository. + +1. Go to the repository on GitHub. +2. In the code tab, click "Add file" and then "Create new file". +3. In the "Name your file..." field, type a name for your file. For + simplicity, let's call it your name and make it a Markdown file. For + example, "your-name.md". +4. Click the green "Commit changes" button and fill in the commit + message. For example, "Add file with my name". You don't need to + fill in the extended description. Keep the "Commit directly to the + `main` branch" option selected. +5. When you have filled in the commit message, click the green "Commit + changes" button. +6. Go back to the repository and check that your file has been added. + +You have now made your first commit to the repository! :tada: + +Now that we have created a file, let's modify it: + +1. Go to the file on GitHub +2. Click the pencil icon on the right side of the screen ("Edit this + file") to edit the file +3. Make a change to the file by adding a new line of text. For example, + "This is a new line of text." +4. Now, commit the changes as you did before by clicking the green + "Commit changes" button and filling in the commit message. When you + have filled in the commit message, click the green "Commit changes" + button. +5. Go back to the file on GitHub and check that your changes have been + made. + +::: callout-tip +## See the history of changes + +If you want to see the history of changes to the file, go to the file +and click the "History" button on the right side of the screen. This +will show you all the changes that have been made to the file along with +the commit messages. + +Since you have made two commits to the file, you should see two entries +in the history. You can click on each entry to see the changes that were +made in that commit. + +This also shows the importance of meaningful commit messages. Imagine if +all the commit messages were "Update file.md". Then, it would be hard to +know what changes were made in each commit. By contrast, if the commits +have meaningful messages, it would be much more easy to get an overview +of the changes that have been made. +::: + +{{< text_snippet sticky_up >}} + +## Exercise: Rename and move your file + +Now it's time to make edits to the file itself. We want to rename the +file and move it to a new location in the repository. + +1. Go to the file on GitHub. +2. Click the pencil icon on the right side of the screen ("Edit this + file") to edit the file. +3. Now, click the name of the file at the top of the screen. After the + current name of the file, add "-new-filename". For example, if the + current name of the file is "file.txt", change it to + "file-new-filename.txt". Remember to keep the file extension (e.g., + ".txt") the same. +4. Commit the changes as we have done it previously, by clicking the + green "Commit changes" button and fill in the commit message. +5. Go back to the file on GitHub and check that your changes have been + made. + +{{< text_snippet sticky_up >}} + +## Exercise: Create an issue and interact with another's issue + +Let's create your first issue! + +1. In the repository on GitHub, click the "Issues" tab. +2. Click the green "New issue" button. +3. Fill in the title and the description. This could be anything you + want to work on or discuss. For example, it could be about something + you think should be added (a new file or a new section to a file) or + something you think should be changed. It could also be a discussion + issue where you ask for feedback on something. +4. Click the green "Create" button, to create the issue. + +Now, you have created your first issue! :partying_face: + +Now, let's interact with another's issue: + +1. Go back to the "Issues" tab in the repository. +2. Click on an issue that someone else has created. +3. Read the issue and the comments that have been made. +4. Scroll down to the bottom of the page and write a comment in the + comment field. You can ask a question, give feedback, or suggest a + solution to the issue. +5. When you have written your comment, click the green "Comment" button + to post the comment. + +{{< text_snippet sticky_up >}} + +## Exercise: Close your issue + +Now, let's close the issue you created earlier. + +1. Go to the "Issues" tab in the repository. +2. Click on the issue you created. +3. In the comment field, write a comment about why you are closing the + issue. For example, you could write "This issue has been resolved" + or "This issue is no longer relevant". Then, click the "Close issue" + button. + +{{< text_snippet sticky_up >}} ## Summary From 1a9e59a8bfee10d2088be8e8389f7dec1bc9a4ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Signe=20Kirk=20Br=C3=B8db=C3=A6k?= Date: Sun, 19 Jan 2025 21:32:27 +0100 Subject: [PATCH 02/12] docs: :pencil2: `txt` -> `md` --- sessions/lesson.qmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sessions/lesson.qmd b/sessions/lesson.qmd index e6c7161..de1260b 100644 --- a/sessions/lesson.qmd +++ b/sessions/lesson.qmd @@ -84,9 +84,9 @@ file and move it to a new location in the repository. file") to edit the file. 3. Now, click the name of the file at the top of the screen. After the current name of the file, add "-new-filename". For example, if the - current name of the file is "file.txt", change it to - "file-new-filename.txt". Remember to keep the file extension (e.g., - ".txt") the same. + current name of the file is "file.md", change it to + "your-name-new-filename.md". Remember to keep the file extension + (e.g., ".md") the same. 4. Commit the changes as we have done it previously, by clicking the green "Commit changes" button and fill in the commit message. 5. Go back to the file on GitHub and check that your changes have been From a16460317c1917a5ac9b2abf092f6fae874a4d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Signe=20Kirk=20Br=C3=B8db=C3=A6k?= Date: Sun, 19 Jan 2025 21:32:45 +0100 Subject: [PATCH 03/12] docs: :memo: add file deletion in exercise --- sessions/lesson.qmd | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/sessions/lesson.qmd b/sessions/lesson.qmd index de1260b..0c0cca0 100644 --- a/sessions/lesson.qmd +++ b/sessions/lesson.qmd @@ -8,7 +8,7 @@ The overall learning outcome for this session is to: -1. +1. Specific learning objectives are: @@ -74,7 +74,7 @@ of the changes that have been made. {{< text_snippet sticky_up >}} -## Exercise: Rename and move your file +## Exercise: Rename and move your file, then delete it Now it's time to make edits to the file itself. We want to rename the file and move it to a new location in the repository. @@ -89,9 +89,37 @@ file and move it to a new location in the repository. (e.g., ".md") the same. 4. Commit the changes as we have done it previously, by clicking the green "Commit changes" button and fill in the commit message. -5. Go back to the file on GitHub and check that your changes have been +5. Go back to the file on GitHub and see that your changes have been made. +Now, let's move the file to a new folder in the repository: + +1. Go to the file. +2. Click the pencil icon on the right side of the screen ("Edit this + file") as we did before. +3. Click the name of the file at the top of the screen. Change the path + of the file to a new location in the repository. For example, if the + current path is "your-name-new-filename.md", change it to + "folder/your-name-new-filename.md". Notice the `/` between the + folder name and the file name. +4. Commit the changes. + +Lastly, let's delete the file: + +1. Go to the file. +2. On the same line as the file name, click the button with the three + dots, saying "More file actions". Click it, scroll down and click + "Delete file". +3. Commit the changes. + +::: callout-tip +## See the changes in the repository + +After you have made the changes, go back to the repository and click the +History button to see the changes that have been made (including your +own and the changes made by others). +::: + {{< text_snippet sticky_up >}} ## Exercise: Create an issue and interact with another's issue From 907a33f7227a8fc4f46524843271277f8081f3df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Signe=20Kirk=20Br=C3=B8db=C3=A6k?= Date: Fri, 14 Feb 2025 13:33:12 +0100 Subject: [PATCH 04/12] docs: :art: use exercise snippet to match other websites --- sessions/lesson.qmd | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/sessions/lesson.qmd b/sessions/lesson.qmd index 0c0cca0..f3defb1 100644 --- a/sessions/lesson.qmd +++ b/sessions/lesson.qmd @@ -20,7 +20,9 @@ Specific learning objectives are: TODO: Reading text ::: -## Exercise: Add a new file and modify the content +## :woman_technologist: Exercise: Add a new file + +> Time: ~10 minutes. First, we want to add a file to the repository. @@ -39,6 +41,12 @@ First, we want to add a file to the repository. You have now made your first commit to the repository! :tada: +{{< text_snippet sticky_up >}} + +## :technologist: Exercise: Modify the content + +> Time: ~10 minutes. + Now that we have created a file, let's modify it: 1. Go to the file on GitHub @@ -52,9 +60,11 @@ Now that we have created a file, let's modify it: button. 5. Go back to the file on GitHub and check that your changes have been made. +{{< text_snippet sticky_up >}} -::: callout-tip -## See the history of changes +## :woman_technologist: Exercise: Take a look at the history + +> Time: ~10 minutes. If you want to see the history of changes to the file, go to the file and click the "History" button on the right side of the screen. This @@ -70,11 +80,13 @@ all the commit messages were "Update file.md". Then, it would be hard to know what changes were made in each commit. By contrast, if the commits have meaningful messages, it would be much more easy to get an overview of the changes that have been made. -::: {{< text_snippet sticky_up >}} -## Exercise: Rename and move your file, then delete it +## :technologist: Exercise: Rename and move your file, then delete it + +> Time: ~10 minutes. + Now it's time to make edits to the file itself. We want to rename the file and move it to a new location in the repository. @@ -112,17 +124,21 @@ Lastly, let's delete the file: "Delete file". 3. Commit the changes. -::: callout-tip -## See the changes in the repository +{{< text_snippet sticky_up >}} + +## :woman_technologist: Exercise: See the changes in the repository + +> Time: ~10 minutes. After you have made the changes, go back to the repository and click the History button to see the changes that have been made (including your own and the changes made by others). -::: {{< text_snippet sticky_up >}} -## Exercise: Create an issue and interact with another's issue +## :technologist: Exercise: Create an issue and interact with another's issue + +> Time: ~10 minutes. Let's create your first issue! @@ -150,7 +166,10 @@ Now, let's interact with another's issue: {{< text_snippet sticky_up >}} -## Exercise: Close your issue +## :woman_technologist: Exercise: Close your issue + +> Time: ~10 minutes. + Now, let's close the issue you created earlier. From 1a6e050e3349197bc176ac8657d0a5dc860721e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Signe=20Kirk=20Br=C3=B8db=C3=A6k?= Date: Fri, 14 Feb 2025 14:46:45 +0100 Subject: [PATCH 05/12] docs: :recycle: rewrite exercises with recipe context :cookie: :cake: --- sessions/lesson.qmd | 288 +++++++++++++++++++++++++++++++------------- 1 file changed, 203 insertions(+), 85 deletions(-) diff --git a/sessions/lesson.qmd b/sessions/lesson.qmd index f3defb1..3d79596 100644 --- a/sessions/lesson.qmd +++ b/sessions/lesson.qmd @@ -20,165 +20,283 @@ Specific learning objectives are: TODO: Reading text ::: -## :woman_technologist: Exercise: Add a new file +## :woman_technologist: Exercise: Add a cookie recipe to the repository {#sec-add-recipe-file} -> Time: ~10 minutes. +> Time: \~10 minutes. -First, we want to add a file to the repository. +Let's add the first recipe to your repository: A cookie recipe! :cookie: + +First, we want to add a file that will include the recipe to the +repository. 1. Go to the repository on GitHub. 2. In the code tab, click "Add file" and then "Create new file". -3. In the "Name your file..." field, type a name for your file. For - simplicity, let's call it your name and make it a Markdown file. For - example, "your-name.md". +3. In the "Name your file..." field, type a name for your file. Let's + call it "cooke-recipe.md". Remember the ".md" file extension so we + create a [Markdown](https://www.markdownguide.org/getting-started/) + file. 4. Click the green "Commit changes" button and fill in the commit - message. For example, "Add file with my name". You don't need to - fill in the extended description. Keep the "Commit directly to the - `main` branch" option selected. + message. For example, "Add file with cooke recipe". You don't need + to fill in the extended description. Keep the "Commit directly to + the `main` branch" option selected. 5. When you have filled in the commit message, click the green "Commit changes" button. 6. Go back to the repository and check that your file has been added. -You have now made your first commit to the repository! :tada: +You have now added your first recipe and made your first commit to your +repository! :tada: {{< text_snippet sticky_up >}} -## :technologist: Exercise: Modify the content +## :technologist: Exercise: Add the cookie recipe to `cookie-recipe.md` file {#sec-add-recipe-content} + +> Time: \~10 minutes. -> Time: ~10 minutes. +Now that we have created the `cookie-recipe.md` file, let's modify it by +adding the recipe to it: -Now that we have created a file, let's modify it: +1. Go to the file `cookie-recipe.md` in your GitHub repository -1. Go to the file on GitHub 2. Click the pencil icon on the right side of the screen ("Edit this - file") to edit the file -3. Make a change to the file by adding a new line of text. For example, - "This is a new line of text." + file") to edit the file. + +3. Make a change to the file by adding a cookie recipe. If you (like + most of us) don't know a cookie recipe by heart, you can find one + online, or use the example recipe below (inspired by + [this](https://twin-food.dk/mit-bud-pa-de-bedste-cookies/) recipe - + which is really good by the way :yum:): + + ``` markdown + # Chocolate chip cookies + + ## Ingredients + + - 240 grams flour + - 3/4 tsp salt + - 140 grams butter + - 145 grams brown sugar + - 115 grams sugar + - 1 1/2 tsp vanilla powder + - 1 egg + - 1/2 tsp baking soda + - 1 tsp baking powder + - 150 grams chocolate (e.g., a mix of dark and milk chocolate) + - 100 grams chopped hazelnuts (can be omitted or replaced with oats) + + ## Instructions + + 1. Mix the sugar, brown sugar, and butter well. + 2. Add the egg and mix again. + 3. Add salt, baking powder, vanilla powder, baking soda, and flour. + 4. Add the chopped chocolate and nuts. + 5. Form clumps of dough on a baking tray with plenty of space + between them. + 6. Bake at 175°C (top and bottom heat) for 16.5-17 minutes. + 7. Once baked, transfer the baking paper with the cookies onto a + wire rack and let them cool for 10 minutes before removing them + from the paper. + ``` + 4. Now, commit the changes as you did before by clicking the green - "Commit changes" button and filling in the commit message. When you - have filled in the commit message, click the green "Commit changes" - button. + "Commit changes" button and filling in the commit message (for + example: "add cookie recipe"). When you have filled in the commit + message, click the green "Commit changes" button. + 5. Go back to the file on GitHub and check that your changes have been made. + {{< text_snippet sticky_up >}} ## :woman_technologist: Exercise: Take a look at the history -> Time: ~10 minutes. +> Time: \~10 minutes. + +Now that we have made a couple of commits to our repositories, let's +take a look at the history of the file: -If you want to see the history of changes to the file, go to the file -and click the "History" button on the right side of the screen. This -will show you all the changes that have been made to the file along with -the commit messages. +1. Go to the `cookie-recipe.md` file and click the "History" button on + the right side of the screen. This will show you all the changes + that have been made to the file along with the commit messages. + Since you have made two commits to the file, you should see two + entries in the history. +2. Try clicking on each entry to see the changes that were made in each + commit. -Since you have made two commits to the file, you should see two entries -in the history. You can click on each entry to see the changes that were -made in that commit. +Looking at the history shows the importance of meaningful commit +messages. Imagine if all the commit messages were "Update file". Then, +it would be easy to lose track of what changes were made in each commit. -This also shows the importance of meaningful commit messages. Imagine if -all the commit messages were "Update file.md". Then, it would be hard to -know what changes were made in each commit. By contrast, if the commits -have meaningful messages, it would be much more easy to get an overview -of the changes that have been made. +By contrast, if the commits have meaningful messages (like "create +recipe file" and "add cookie recipe"), it is much easier to get an +overview of the changes. {{< text_snippet sticky_up >}} -## :technologist: Exercise: Rename and move your file, then delete it +## :technologist: Exercise: Rename and move the `cookie-recipe.md` file, then delete it -> Time: ~10 minutes. +> Time: \~10 minutes. +Let's imagine that you want to add another cookie recipe (e.g., a peanut +butter cookie recipe) to your recipe book. Because you know that you +would like to add other recipes in the future, you decide to create a +folder for the cookie recipes. Then, it would make sense to rename the +`cookie-recipe.md` file and move it to a new folder called `cookies`. -Now it's time to make edits to the file itself. We want to rename the -file and move it to a new location in the repository. +Let's start by renaming the `cookie-recipe.md` file: 1. Go to the file on GitHub. 2. Click the pencil icon on the right side of the screen ("Edit this file") to edit the file. -3. Now, click the name of the file at the top of the screen. After the - current name of the file, add "-new-filename". For example, if the - current name of the file is "file.md", change it to - "your-name-new-filename.md". Remember to keep the file extension - (e.g., ".md") the same. +3. Now, click the name of the file at the top of the screen. Rename the + file to `chocolate-chip-cookies.md`. Remember to avoid spaces in the + file name and keep the file extension (`.md`). 4. Commit the changes as we have done it previously, by clicking the green "Commit changes" button and fill in the commit message. 5. Go back to the file on GitHub and see that your changes have been made. -Now, let's move the file to a new folder in the repository: +Now, let's move the file to a new `cookies` folder in the repository: 1. Go to the file. 2. Click the pencil icon on the right side of the screen ("Edit this file") as we did before. 3. Click the name of the file at the top of the screen. Change the path - of the file to a new location in the repository. For example, if the - current path is "your-name-new-filename.md", change it to - "folder/your-name-new-filename.md". Notice the `/` between the + of the file to a new location in the repository. The current path is + `chocolate-chip-cookies.md`. To create a new folder, change the path + to `cookies/chocolate-chip-cookies.md`. Notice the `/` between the folder name and the file name. 4. Commit the changes. -Lastly, let's delete the file: - -1. Go to the file. -2. On the same line as the file name, click the button with the three - dots, saying "More file actions". Click it, scroll down and click - "Delete file". -3. Commit the changes. - -{{< text_snippet sticky_up >}} - -## :woman_technologist: Exercise: See the changes in the repository - -> Time: ~10 minutes. - -After you have made the changes, go back to the repository and click the -History button to see the changes that have been made (including your -own and the changes made by others). +You have now renamed your recipe file and moved it to a new folder in +the repository! :partying_face: {{< text_snippet sticky_up >}} -## :technologist: Exercise: Create an issue and interact with another's issue +## :technologist: Exercise: Create an issue with a list of future recipes for your book -> Time: ~10 minutes. +> Time: \~10 minutes. -Let's create your first issue! +Now that you have added a recipe to the repository, let's create a +GitHub Issue to keep track of the recipes you want to add to your recipe +book in the future. 1. In the repository on GitHub, click the "Issues" tab. 2. Click the green "New issue" button. -3. Fill in the title and the description. This could be anything you - want to work on or discuss. For example, it could be about something - you think should be added (a new file or a new section to a file) or - something you think should be changed. It could also be a discussion - issue where you ask for feedback on something. +3. Fill in the title and the description. For example, you could write + "List of future recipes" as the title and "I want to add the + following recipes to the recipe book: + - Pancakes + - Apple pie" as the description. 4. Click the green "Create" button, to create the issue. -Now, you have created your first issue! :partying_face: +Now, you have created your first issue! :tada: -Now, let's interact with another's issue: +{{< text_snippet sticky_up >}} + +## :woman_technologist: Exercise: Add a recipe suggestion to another's issue + +> Time: \~10 minutes. + +Since one of the nice things about GitHub is that it allows for easy +collaboration, let's interact with another's issue by adding a recipe +suggestion to it. With your neighbour: -1. Go back to the "Issues" tab in the repository. -2. Click on an issue that someone else has created. -3. Read the issue and the comments that have been made. +1. Go to each other's GitHub repositories. +2. Go to the "Issues" tab in the repository. +3. Click on the issue that they have created with the list of future + recipes. 4. Scroll down to the bottom of the page and write a comment in the - comment field. You can ask a question, give feedback, or suggest a - solution to the issue. + comment field suggesting a recipe that they could add to their + recipe book. For example, you could suggest them to add a brownie + recipe as well :cake:. 5. When you have written your comment, click the green "Comment" button to post the comment. {{< text_snippet sticky_up >}} -## :woman_technologist: Exercise: Close your issue +## :technologist: Exercise: Add a recipe to another's repository :cake: -> Time: ~10 minutes. - +> Time: \~10 minutes. + +::: {.callout-note collapse="true"} +## :teacher: Instructor note + +Before starting this exercise, make sure that the learners have added +their neighbour as collaborators to their repositories. If they haven't, +they can do so by going to the repository, clicking on "Settings", then +"Collaborators and teams", and then "Add people". +::: -Now, let's close the issue you created earlier. +Now, let's add a recipe to your neighbour's repository. -1. Go to the "Issues" tab in the repository. +1. Go to your neighbour's GitHub repository. + +2. As we did in @sec-add-recipe-file and @sec-add-recipe-content , add + a new file with a recipe - this time, it's just in another person's + repository. For example, you could add a brownie recipe like the one + below: + + ``` markdown + # Brownies + + ## Ingredients + + - 350 grams dark chocolate + - 250 grams butter + - 4 eggs + - 150 grams brown sugar + - 150 grams white sugar + - 60 grams flour + - 1 tsp baking powder + + ## Instructions + + 1. Melt the chocolate and butter together. + 2. Whisk the eggs until frothy and add brown and white sugar. + 3. Add the melted chocolate and butter to the egg mixture. + 4. Add the flour and baking powder. + 5. Pour the mixture into a baking tray and bake at 170°C for 30-35 minutes. + ``` + +3. Commit the changes as we have done it previously and go to the + repository's history to see the changes you have made. + +{{< text_snippet sticky_up >}} + +## :woman_technologist: Exercise: See the changes in the repository + +> Time: \~10 minutes. + +After you have made the changes, go back to the repository and click the +History button to see the changes that have been made (including your +own and the changes made by others). + +{{< text_snippet sticky_up >}} + +## :woman_technologist: Exercise: Cleaning up + +> Time: \~10 minutes. + +Now, let's close the "Future recipes" issue you created earlier. + +1. Go to the "Issues" tab in your repository. 2. Click on the issue you created. 3. In the comment field, write a comment about why you are closing the issue. For example, you could write "This issue has been resolved" - or "This issue is no longer relevant". Then, click the "Close issue" - button. + or "I have now added all the relevant recipes from this issue". + Then, click the "Close issue" button. + +Lastly, let's delete the `chocolate-chip-cookies.md` file along with the +`cookies` folder you created earlier: + +1. Go to the file. +2. On the same line as the file name, click the button with the three + dots, saying "More file actions". Click it, scroll down and click + "Delete file". +3. Commit the changes. +4. Now, go the `cookies` folder and delete it in the same way as you + deleted the `chocolate-chip-cookies.md` file. For folders, it will + say "Delete directory" instead of "Delete file". {{< text_snippet sticky_up >}} From 8f1f2a985a75301f1b57eefe20cf34abb41d9656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Signe=20Kirk=20Br=C3=B8db=C3=A6k?= <40836345+signekb@users.noreply.github.com> Date: Tue, 18 Feb 2025 13:22:06 +0100 Subject: [PATCH 06/12] docs: :memo: apply suggestions from code review Co-authored-by: Luke W. Johnston --- sessions/lesson.qmd | 168 +++++++++++++++++--------------------------- 1 file changed, 66 insertions(+), 102 deletions(-) diff --git a/sessions/lesson.qmd b/sessions/lesson.qmd index 3d79596..218d0b6 100644 --- a/sessions/lesson.qmd +++ b/sessions/lesson.qmd @@ -20,20 +20,19 @@ Specific learning objectives are: TODO: Reading text ::: -## :woman_technologist: Exercise: Add a cookie recipe to the repository {#sec-add-recipe-file} +## :woman_technologist: Exercise: Add a cookie recipe to your repository > Time: \~10 minutes. Let's add the first recipe to your repository: A cookie recipe! :cookie: -First, we want to add a file that will include the recipe to the +First, we want to add a file that will include the recipe to your repository. -1. Go to the repository on GitHub. -2. In the code tab, click "Add file" and then "Create new file". +1. In the "Code" tab of your repository, click "Add file" and then "Create new file". 3. In the "Name your file..." field, type a name for your file. Let's call it "cooke-recipe.md". Remember the ".md" file extension so we - create a [Markdown](https://www.markdownguide.org/getting-started/) + create a [Markdown](https://quarto.org/docs/authoring/markdown-basics.html) file. 4. Click the green "Commit changes" button and fill in the commit message. For example, "Add file with cooke recipe". You don't need @@ -41,29 +40,27 @@ repository. the `main` branch" option selected. 5. When you have filled in the commit message, click the green "Commit changes" button. -6. Go back to the repository and check that your file has been added. +6. Go back to your repository and check that your file has been added. You have now added your first recipe and made your first commit to your repository! :tada: {{< text_snippet sticky_up >}} -## :technologist: Exercise: Add the cookie recipe to `cookie-recipe.md` file {#sec-add-recipe-content} +## :technologist: Exercise: Add the cookie recipe to `cookie-recipe.md` file -> Time: \~10 minutes. +**Time: \~10 minutes** Now that we have created the `cookie-recipe.md` file, let's modify it by adding the recipe to it: -1. Go to the file `cookie-recipe.md` in your GitHub repository - -2. Click the pencil icon on the right side of the screen ("Edit this +1. In your `cookie-recipe.md` file on your repository, click the pencil icon on the right side of the screen ("Edit this file") to edit the file. 3. Make a change to the file by adding a cookie recipe. If you (like most of us) don't know a cookie recipe by heart, you can find one online, or use the example recipe below (inspired by - [this](https://twin-food.dk/mit-bud-pa-de-bedste-cookies/) recipe - + [this](https://twin-food.dk/mit-bud-pa-de-bedste-cookies/) recipe--- which is really good by the way :yum:): ``` markdown @@ -102,14 +99,12 @@ adding the recipe to it: example: "add cookie recipe"). When you have filled in the commit message, click the green "Commit changes" button. -5. Go back to the file on GitHub and check that your changes have been - made. {{< text_snippet sticky_up >}} ## :woman_technologist: Exercise: Take a look at the history -> Time: \~10 minutes. +**Time: \~10 minutes** Now that we have made a couple of commits to our repositories, let's take a look at the history of the file: @@ -132,89 +127,92 @@ overview of the changes. {{< text_snippet sticky_up >}} -## :technologist: Exercise: Rename and move the `cookie-recipe.md` file, then delete it +## :technologist: Exercise: Rename and move the `cookie-recipe.md` file -> Time: \~10 minutes. +**Time: \~10 minutes** -Let's imagine that you want to add another cookie recipe (e.g., a peanut -butter cookie recipe) to your recipe book. Because you know that you -would like to add other recipes in the future, you decide to create a -folder for the cookie recipes. Then, it would make sense to rename the -`cookie-recipe.md` file and move it to a new folder called `cookies`. +Just like we did with our soup recipe above, let's rename the +`cookie-recipe.md` file so the name is more specific and move it +to a new baked goods folder. That way, if you want to +add other recipes for baked goods, you can put it in that +folder. -Let's start by renaming the `cookie-recipe.md` file: +While you can move and rename in the same step, for practice, +rename the file first before moving it to another folder: +Start by renaming the `cookie-recipe.md` file: -1. Go to the file on GitHub. -2. Click the pencil icon on the right side of the screen ("Edit this - file") to edit the file. -3. Now, click the name of the file at the top of the screen. Rename the - file to `chocolate-chip-cookies.md`. Remember to avoid spaces in the +1. Click the pencil icon on the right side of the screen ("Edit this + file") to edit the `cookie-recipe.md` file. +3. Click the name of the file at the top of the screen and rename the + file to `chocolate-chip-cookies.md`. Remember to not use spaces in the file name and keep the file extension (`.md`). 4. Commit the changes as we have done it previously, by clicking the green "Commit changes" button and fill in the commit message. -5. Go back to the file on GitHub and see that your changes have been - made. - -Now, let's move the file to a new `cookies` folder in the repository: - -1. Go to the file. -2. Click the pencil icon on the right side of the screen ("Edit this - file") as we did before. -3. Click the name of the file at the top of the screen. Change the path - of the file to a new location in the repository. The current path is - `chocolate-chip-cookies.md`. To create a new folder, change the path - to `cookies/chocolate-chip-cookies.md`. Notice the `/` between the + +Next, move the file to a new `baked-goods/` folder in your repository: + +1. Click the pencil icon on the right side of the screen ("Edit this + file") as we did before on the `chocolate-chip-cookies.md` file. +3. Click the name of the file at the top of the screen and change the path + of the file to a new folder in your repository. The current file path is + `chocolate-chip-cookies.md`. To create a new folder, change the file path by typing `baked-goods/` at the start of the file name. + Notice the `/` between the folder name and the file name. 4. Commit the changes. You have now renamed your recipe file and moved it to a new folder in -the repository! :partying_face: +your repository! :partying_face: {{< text_snippet sticky_up >}} -## :technologist: Exercise: Create an issue with a list of future recipes for your book +## :technologist: Exercise: Create an issue with a list of future recipes to add -> Time: \~10 minutes. +**Time: \~10 minutes** -Now that you have added a recipe to the repository, let's create a -GitHub Issue to keep track of the recipes you want to add to your recipe -book in the future. +You may or may not want to make a to-do list of other recipes to +add to the repository. Assuming you do want to, you can use GitHub +Issues to keep track of the recipes you want to add. Time to make one! -1. In the repository on GitHub, click the "Issues" tab. +1. In your repository, click the "Issues" tab. 2. Click the green "New issue" button. -3. Fill in the title and the description. For example, you could write - "List of future recipes" as the title and "I want to add the - following recipes to the recipe book: +3. Fill in the title with text like "List of future recipes". + Then fill in the description box with some recipes you + would like to add. If you don't know any recipes or are + not sure, you could write: + + ``` markdown + I want to add the following recipes to the recipe book: + - Pancakes - - Apple pie" as the description. -4. Click the green "Create" button, to create the issue. + - Apple pie + ``` +4. Click the green "Create" button to create the issue. -Now, you have created your first issue! :tada: +You now have an issue to remind yourself of recipes to add! :tada: {{< text_snippet sticky_up >}} -## :woman_technologist: Exercise: Add a recipe suggestion to another's issue +## :woman_technologist: Exercise: Comment with a recipe suggestion to your neighbour's issue -> Time: \~10 minutes. +**Time: \~10 minutes** -Since one of the nice things about GitHub is that it allows for easy -collaboration, let's interact with another's issue by adding a recipe -suggestion to it. With your neighbour: +One of the great things about GitHub is that it makes it easier to +collaborate with others. So, interact with someone else's issue by adding a comment to it: -1. Go to each other's GitHub repositories. -2. Go to the "Issues" tab in the repository. +1. One at a time, go to your neighbour's GitHub repository. +2. Go to the "Issues" tab in their repository. 3. Click on the issue that they have created with the list of future recipes. 4. Scroll down to the bottom of the page and write a comment in the comment field suggesting a recipe that they could add to their - recipe book. For example, you could suggest them to add a brownie + recipe book. For example, you could suggest that they add a brownie recipe as well :cake:. 5. When you have written your comment, click the green "Comment" button to post the comment. {{< text_snippet sticky_up >}} -## :technologist: Exercise: Add a recipe to another's repository :cake: +## :technologist: Exercise: Add a recipe to your neighbour's repository :cake: > Time: \~10 minutes. @@ -231,10 +229,11 @@ Now, let's add a recipe to your neighbour's repository. 1. Go to your neighbour's GitHub repository. -2. As we did in @sec-add-recipe-file and @sec-add-recipe-content , add - a new file with a recipe - this time, it's just in another person's - repository. For example, you could add a brownie recipe like the one - below: +2. As we've done during this workshop, add + a new file with a recipe, naming the file by using the recipe name (remember the correct naming for files!). + This time, you will be adding the file to your + neighbour's repository. In the file, add a recipe of your choice. + For convenience, you can also use the brownie recipe below: ``` markdown # Brownies @@ -258,47 +257,12 @@ Now, let's add a recipe to your neighbour's repository. 5. Pour the mixture into a baking tray and bake at 170°C for 30-35 minutes. ``` -3. Commit the changes as we have done it previously and go to the +3. Commit the changes as you have done previously in the workshop. Then go to the neighbour's repository's history to see the changes you have made. {{< text_snippet sticky_up >}} -## :woman_technologist: Exercise: See the changes in the repository - -> Time: \~10 minutes. - -After you have made the changes, go back to the repository and click the -History button to see the changes that have been made (including your -own and the changes made by others). - -{{< text_snippet sticky_up >}} - -## :woman_technologist: Exercise: Cleaning up - -> Time: \~10 minutes. - -Now, let's close the "Future recipes" issue you created earlier. - -1. Go to the "Issues" tab in your repository. -2. Click on the issue you created. -3. In the comment field, write a comment about why you are closing the - issue. For example, you could write "This issue has been resolved" - or "I have now added all the relevant recipes from this issue". - Then, click the "Close issue" button. -Lastly, let's delete the `chocolate-chip-cookies.md` file along with the -`cookies` folder you created earlier: - -1. Go to the file. -2. On the same line as the file name, click the button with the three - dots, saying "More file actions". Click it, scroll down and click - "Delete file". -3. Commit the changes. -4. Now, go the `cookies` folder and delete it in the same way as you - deleted the `chocolate-chip-cookies.md` file. For folders, it will - say "Delete directory" instead of "Delete file". - -{{< text_snippet sticky_up >}} ## Summary From 23df38cc0adcae455f324008fd2d8e3f67835f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Signe=20Kirk=20Br=C3=B8db=C3=A6k?= <40836345+signekb@users.noreply.github.com> Date: Tue, 18 Feb 2025 13:22:31 +0100 Subject: [PATCH 07/12] docs: :memo: apply suggestions from code review Co-authored-by: Luke W. Johnston --- sessions/lesson.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sessions/lesson.qmd b/sessions/lesson.qmd index 218d0b6..d0948e9 100644 --- a/sessions/lesson.qmd +++ b/sessions/lesson.qmd @@ -22,7 +22,7 @@ TODO: Reading text ## :woman_technologist: Exercise: Add a cookie recipe to your repository -> Time: \~10 minutes. +**Time: \~10 minutes** Let's add the first recipe to your repository: A cookie recipe! :cookie: From 5bd00c8cbd3ddd5f2bd3e30827eb1ebead9994e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Signe=20Kirk=20Br=C3=B8db=C3=A6k?= Date: Tue, 18 Feb 2025 13:50:36 +0100 Subject: [PATCH 08/12] docs: :memo: merge exercises that add a file and modify a file --- sessions/lesson.qmd | 70 ++++++++------------------------------------- 1 file changed, 12 insertions(+), 58 deletions(-) diff --git a/sessions/lesson.qmd b/sessions/lesson.qmd index d0948e9..8d2d8dc 100644 --- a/sessions/lesson.qmd +++ b/sessions/lesson.qmd @@ -30,38 +30,12 @@ First, we want to add a file that will include the recipe to your repository. 1. In the "Code" tab of your repository, click "Add file" and then "Create new file". -3. In the "Name your file..." field, type a name for your file. Let's +1. In the "Name your file..." field, type a name for your file. Let's call it "cooke-recipe.md". Remember the ".md" file extension so we create a [Markdown](https://quarto.org/docs/authoring/markdown-basics.html) file. -4. Click the green "Commit changes" button and fill in the commit - message. For example, "Add file with cooke recipe". You don't need - to fill in the extended description. Keep the "Commit directly to - the `main` branch" option selected. -5. When you have filled in the commit message, click the green "Commit - changes" button. -6. Go back to your repository and check that your file has been added. - -You have now added your first recipe and made your first commit to your -repository! :tada: - -{{< text_snippet sticky_up >}} - -## :technologist: Exercise: Add the cookie recipe to `cookie-recipe.md` file - -**Time: \~10 minutes** - -Now that we have created the `cookie-recipe.md` file, let's modify it by -adding the recipe to it: - -1. In your `cookie-recipe.md` file on your repository, click the pencil icon on the right side of the screen ("Edit this - file") to edit the file. - -3. Make a change to the file by adding a cookie recipe. If you (like - most of us) don't know a cookie recipe by heart, you can find one - online, or use the example recipe below (inspired by - [this](https://twin-food.dk/mit-bud-pa-de-bedste-cookies/) recipe--- - which is really good by the way :yum:): +1. Add a cookie recipe to the file by either finding one online or using the example recipe below (inspired by + [this](https://twin-food.dk/mit-bud-pa-de-bedste-cookies/) recipe---which is really good by the way :yum:): ``` markdown # Chocolate chip cookies @@ -94,36 +68,16 @@ adding the recipe to it: from the paper. ``` -4. Now, commit the changes as you did before by clicking the green - "Commit changes" button and filling in the commit message (for - example: "add cookie recipe"). When you have filled in the commit - message, click the green "Commit changes" button. - - -{{< text_snippet sticky_up >}} - -## :woman_technologist: Exercise: Take a look at the history - -**Time: \~10 minutes** - -Now that we have made a couple of commits to our repositories, let's -take a look at the history of the file: - -1. Go to the `cookie-recipe.md` file and click the "History" button on - the right side of the screen. This will show you all the changes - that have been made to the file along with the commit messages. - Since you have made two commits to the file, you should see two - entries in the history. -2. Try clicking on each entry to see the changes that were made in each - commit. - -Looking at the history shows the importance of meaningful commit -messages. Imagine if all the commit messages were "Update file". Then, -it would be easy to lose track of what changes were made in each commit. +1. Click the green "Commit changes" button and fill in the commit + message. For example, "Add cooke recipe". You don't need + to fill in the extended description. Keep the "Commit directly to + the `main` branch" option selected. +1. When you have filled in the commit message, click the green "Commit + changes" button. +1. Go back to your repository and check that your file has been added. -By contrast, if the commits have meaningful messages (like "create -recipe file" and "add cookie recipe"), it is much easier to get an -overview of the changes. +You have now added your first recipe and made your first commit to your +repository! :tada: {{< text_snippet sticky_up >}} From 56ccd82e05059e6f5905c2c76867772aa731a850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Signe=20Kirk=20Br=C3=B8db=C3=A6k?= Date: Tue, 18 Feb 2025 13:51:55 +0100 Subject: [PATCH 09/12] docs: :truck: add that learners should look for a specific commit And move the exercise down, so it's later in the workshop where there will be more history to investigate. --- sessions/lesson.qmd | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/sessions/lesson.qmd b/sessions/lesson.qmd index 8d2d8dc..8751fae 100644 --- a/sessions/lesson.qmd +++ b/sessions/lesson.qmd @@ -216,7 +216,36 @@ Now, let's add a recipe to your neighbour's repository. {{< text_snippet sticky_up >}} +## :woman_technologist: Exercise: Find the commit where you moved the cookie recipe +**Time: \~10 minutes** + +Now that you---and your neighbour--have made commits to your repository, let's +take a look at the history to find the commit where you first added the cookie recipe. + +1. In your repository, click the "Commits" button on + the right side of the screen. This will show you all the changes + that have been made to your repository along with the commit messages, the author of the changes, and when the changes where made. Neat! +2. Go through the list of commits to find the commit where you added the + cookie recipe. The commit message should be "Add cookie recipe". + + +::: {.callout-note} +Looking at the history shows the importance of meaningful commit +messages. Imagine if all the commit messages were "Update file". Then, +it would be easy to lose track of what changes were made in each commit. + +By contrast, if the commits have meaningful messages (like "Add cookie recipe" or "Move cookie recipe to baked-goods folder"), it is much easier to get an +overview of the changes. +::: + +{{< text_snippet sticky_up >}} + +::: {.callout-tip} +You can both look at the history of the entire repository or the history of a specific file. The history of the entire repository shows all the commits that have been made to all files in the repository, while the history of a specific file shows the commits that have been made to that file only. + +You can access the history of a specific file by going to the file in the repository and clicking the "History" button on the right side of the screen. +::: ## Summary From 876a553d1bdcd041069ce3da3e76eb8bb7e09e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Signe=20Kirk=20Br=C3=B8db=C3=A6k?= Date: Tue, 18 Feb 2025 15:05:50 +0100 Subject: [PATCH 10/12] docs: :truck: move exercises to their respective sessions + minor text edits and formatting. --- sessions/using-issues.qmd | 226 +++++++------------------------- sessions/working-with-files.qmd | 145 +++++++++++++++++++- 2 files changed, 193 insertions(+), 178 deletions(-) diff --git a/sessions/using-issues.qmd b/sessions/using-issues.qmd index eb4d6c2..83b935d 100644 --- a/sessions/using-issues.qmd +++ b/sessions/using-issues.qmd @@ -20,140 +20,45 @@ Specific learning objectives are: TODO: Reading text ::: -## :woman_technologist: Exercise: Add a cookie recipe to your repository - -**Time: \~10 minutes** - -Let's add the first recipe to your repository: A cookie recipe! :cookie: - -First, we want to add a file that will include the recipe to your -repository. - -1. In the "Code" tab of your repository, click "Add file" and then "Create new file". -1. In the "Name your file..." field, type a name for your file. Let's - call it "cooke-recipe.md". Remember the ".md" file extension so we - create a [Markdown](https://quarto.org/docs/authoring/markdown-basics.html) - file. -1. Add a cookie recipe to the file by either finding one online or using the example recipe below (inspired by - [this](https://twin-food.dk/mit-bud-pa-de-bedste-cookies/) recipe---which is really good by the way :yum:): - - ``` markdown - # Chocolate chip cookies - - ## Ingredients - - - 240 grams flour - - 3/4 tsp salt - - 140 grams butter - - 145 grams brown sugar - - 115 grams sugar - - 1 1/2 tsp vanilla powder - - 1 egg - - 1/2 tsp baking soda - - 1 tsp baking powder - - 150 grams chocolate (e.g., a mix of dark and milk chocolate) - - 100 grams chopped hazelnuts (can be omitted or replaced with oats) - - ## Instructions - - 1. Mix the sugar, brown sugar, and butter well. - 2. Add the egg and mix again. - 3. Add salt, baking powder, vanilla powder, baking soda, and flour. - 4. Add the chopped chocolate and nuts. - 5. Form clumps of dough on a baking tray with plenty of space - between them. - 6. Bake at 175°C (top and bottom heat) for 16.5-17 minutes. - 7. Once baked, transfer the baking paper with the cookies onto a - wire rack and let them cool for 10 minutes before removing them - from the paper. - ``` - -1. Click the green "Commit changes" button and fill in the commit - message. For example, "Add cooke recipe". You don't need - to fill in the extended description. Keep the "Commit directly to - the `main` branch" option selected. -1. When you have filled in the commit message, click the green "Commit - changes" button. -1. Go back to your repository and check that your file has been added. - -You have now added your first recipe and made your first commit to your -repository! :tada: - -{{< text_snippet sticky_up >}} - -## :technologist: Exercise: Rename and move the `cookie-recipe.md` file - -**Time: \~10 minutes** - -Just like we did with our soup recipe above, let's rename the -`cookie-recipe.md` file so the name is more specific and move it -to a new baked goods folder. That way, if you want to -add other recipes for baked goods, you can put it in that -folder. - -While you can move and rename in the same step, for practice, -rename the file first before moving it to another folder: -Start by renaming the `cookie-recipe.md` file: - -1. Click the pencil icon on the right side of the screen ("Edit this - file") to edit the `cookie-recipe.md` file. -3. Click the name of the file at the top of the screen and rename the - file to `chocolate-chip-cookies.md`. Remember to not use spaces in the - file name and keep the file extension (`.md`). -4. Commit the changes as we have done it previously, by clicking the - green "Commit changes" button and fill in the commit message. - -Next, move the file to a new `baked-goods/` folder in your repository: - -1. Click the pencil icon on the right side of the screen ("Edit this - file") as we did before on the `chocolate-chip-cookies.md` file. -3. Click the name of the file at the top of the screen and change the path - of the file to a new folder in your repository. The current file path is - `chocolate-chip-cookies.md`. To create a new folder, change the file path by typing `baked-goods/` at the start of the file name. - Notice the `/` between the - folder name and the file name. -4. Commit the changes. - -You have now renamed your recipe file and moved it to a new folder in -your repository! :partying_face: - -{{< text_snippet sticky_up >}} - ## :technologist: Exercise: Create an issue with a list of future recipes to add **Time: \~10 minutes** -You may or may not want to make a to-do list of other recipes to -add to the repository. Assuming you do want to, you can use GitHub -Issues to keep track of the recipes you want to add. Time to make one! +To help you keep track of future tasks, you can use GitHub Issues. Let's +make an Issue with a list of recipes you want to add to your repository. 1. In your repository, click the "Issues" tab. + 2. Click the green "New issue" button. -3. Fill in the title with text like "List of future recipes". - Then fill in the description box with some recipes you - would like to add. If you don't know any recipes or are - not sure, you could write: - + +3. Fill in the title with text like "List of future recipes". Then fill + in the description box with some recipes you would like to add. If + you don't know any recipes or are not sure, you could write: + ``` markdown I want to add the following recipes to the recipe book: - + - Pancakes - Apple pie ``` + 4. Click the green "Create" button to create the issue. -You now have an issue to remind yourself of recipes to add! :tada: +You now have an issue to remind yourself of recipes you want to add! +:tada: {{< text_snippet sticky_up >}} -## :woman_technologist: Exercise: Comment with a recipe suggestion to your neighbour's issue +## :woman_technologist: Exercise: Comment on your neighbour's issue with a recipe suggestion **Time: \~10 minutes** One of the great things about GitHub is that it makes it easier to -collaborate with others. So, interact with someone else's issue by adding a comment to it: +collaborate with others. So, interact with someone else's issue by +adding a comment to it: -1. One at a time, go to your neighbour's GitHub repository. +1. With your neighbour one at a time, go to each other's GitHub + repository. 2. Go to the "Issues" tab in their repository. 3. Click on the issue that they have created with the list of future recipes. @@ -166,87 +71,58 @@ collaborate with others. So, interact with someone else's issue by adding a comm {{< text_snippet sticky_up >}} -## :technologist: Exercise: Add a recipe to your neighbour's repository :cake: +## Add a collaborator to your repository -> Time: \~10 minutes. + -::: {.callout-note collapse="true"} -## :teacher: Instructor note +In your repository, click "Settings", then "Collaborators and teams", +and then "Add people". Add your neighbour as a collaborator to your +repository. -Before starting this exercise, make sure that the learners have added -their neighbour as collaborators to their repositories. If they haven't, -they can do so by going to the repository, clicking on "Settings", then -"Collaborators and teams", and then "Add people". -::: +## :technologist: Exercise: Add a recipe to your neighbour's repository -Now, let's add a recipe to your neighbour's repository. +> Time: \~10 minutes. + +Now, you'll add a recipe to your neighbour's repository. 1. Go to your neighbour's GitHub repository. -2. As we've done during this workshop, add - a new file with a recipe, naming the file by using the recipe name (remember the correct naming for files!). - This time, you will be adding the file to your +2. As we've done during this workshop, add a new file with a recipe, + naming the file by using the recipe name (remember the correct + naming for files!). This time, you will be adding the file to your neighbour's repository. In the file, add a recipe of your choice. - For convenience, you can also use the brownie recipe below: - - ``` markdown - # Brownies - - ## Ingredients - - - 350 grams dark chocolate - - 250 grams butter - - 4 eggs - - 150 grams brown sugar - - 150 grams white sugar - - 60 grams flour - - 1 tsp baking powder + For convenience, you can also use the brownie recipe below. - ## Instructions +3. Commit the changes as you have done previously in the workshop. Then + go to the neighbour's repository's history to see the changes you + have made. - 1. Melt the chocolate and butter together. - 2. Whisk the eggs until frothy and add brown and white sugar. - 3. Add the melted chocolate and butter to the egg mixture. - 4. Add the flour and baking powder. - 5. Pour the mixture into a baking tray and bake at 170°C for 30-35 minutes. - ``` - -3. Commit the changes as you have done previously in the workshop. Then go to the neighbour's - repository's history to see the changes you have made. - -{{< text_snippet sticky_up >}} - -## :woman_technologist: Exercise: Find the commit where you moved the cookie recipe +**Example brownie recipe:** -**Time: \~10 minutes** +``` markdown +# Brownies -Now that you---and your neighbour--have made commits to your repository, let's -take a look at the history to find the commit where you first added the cookie recipe. +## Ingredients -1. In your repository, click the "Commits" button on - the right side of the screen. This will show you all the changes - that have been made to your repository along with the commit messages, the author of the changes, and when the changes where made. Neat! -2. Go through the list of commits to find the commit where you added the - cookie recipe. The commit message should be "Add cookie recipe". +- 350 grams dark chocolate +- 250 grams butter +- 4 eggs +- 150 grams brown sugar +- 150 grams white sugar +- 60 grams flour +- 1 tsp baking powder +## Instructions -::: {.callout-note} -Looking at the history shows the importance of meaningful commit -messages. Imagine if all the commit messages were "Update file". Then, -it would be easy to lose track of what changes were made in each commit. - -By contrast, if the commits have meaningful messages (like "Add cookie recipe" or "Move cookie recipe to baked-goods folder"), it is much easier to get an -overview of the changes. -::: +1. Melt the chocolate and butter together. +2. Whisk the eggs until frothy and add brown and white sugar. +3. Add the melted chocolate and butter to the egg mixture. +4. Add the flour and baking powder. +5. Pour the mixture into a baking tray and bake at 170°C for 30-35 minutes. +``` {{< text_snippet sticky_up >}} -::: {.callout-tip} -You can both look at the history of the entire repository or the history of a specific file. The history of the entire repository shows all the commits that have been made to all files in the repository, while the history of a specific file shows the commits that have been made to that file only. - -You can access the history of a specific file by going to the file in the repository and clicking the "History" button on the right side of the screen. -::: - ## Summary - TODO: List of summary items diff --git a/sessions/working-with-files.qmd b/sessions/working-with-files.qmd index 383df6d..e9e0954 100644 --- a/sessions/working-with-files.qmd +++ b/sessions/working-with-files.qmd @@ -6,7 +6,7 @@ The overall learning outcome for this session is to: -1. +1. Specific learning objectives are: @@ -20,9 +20,148 @@ Specific learning objectives are: TODO: Reading text ::: -## Exercise: TODO: Add title +## :woman_technologist: Exercise: Add a cookie recipe to your repository + +**Time: \~10 minutes** + +Let's add the first recipe to your repository: A cookie recipe! :cookie: + +1. In the "Code" tab of your repository, click the "Add file" button + and then "Create new file". +2. In the "Name your file..." field, type the name of your file. Let's + call it `cooke-recipe.md`. Remember to not use spaces in the file + name as well as the `.md` file extension so you create a + [Markdown](https://quarto.org/docs/authoring/markdown-basics.html) + file. +3. Add a cookie recipe to the file by either finding one online or + using the example recipe below. +4. Click the green "Commit changes" button and write a descriptive + commit message like "Add cookie recipe". You don't need to write an + extended description. Keep the "Commit directly to the `main` + branch" option selected. +5. When you have filled in the commit message, click the green "Commit + changes" button. + +**Example cookie recipe:** + +``` markdown +# Chocolate chip cookies + +## Ingredients + +- 240 grams flour +- 3/4 tsp salt +- 140 grams butter +- 145 grams brown sugar +- 115 grams sugar +- 1 1/2 tsp vanilla powder +- 1 egg +- 1/2 tsp baking soda +- 1 tsp baking powder +- 150 grams chocolate (e.g., a mix of dark and milk chocolate) +- 100 grams chopped hazelnuts (can be omitted or replaced with oats) + +## Instructions + +1. Mix the sugar, brown sugar, and butter well. +2. Add the egg and mix again. +3. Add salt, baking powder, vanilla powder, baking soda, and flour. +4. Add the chopped chocolate and nuts. +5. Form clumps of dough on a baking tray with plenty of space + between them. +6. Bake at 175°C (top and bottom heat) for 16.5-17 minutes. +7. Once baked, transfer the baking paper with the cookies onto a + wire rack and let them cool for 10 minutes before removing them + from the paper. +``` + +This recipe is a simplified version of +[this](https://twin-food.dk/mit-bud-pa-de-bedste-cookies/) +recipe---which is really good by the way :yum:): + +You have now added your first recipe and made your first commit to your +repository! :tada: + +{{< text_snippet sticky_up >}} + +## :technologist: Exercise: Rename and move the `cookie-recipe.md` file + +**Time: \~10 minutes** + +Just like we did with the soup recipe above, let's rename the +`cookie-recipe.md` file so the name is more specific. Let's also move it +to a new baked goods folder. That way, if you want to add other recipes +for baked goods, you can put it in that folder. + +While you can move and rename in the same step, for practice, rename the +file first before moving it to the new folder: Start by renaming the +`cookie-recipe.md` file: + +1. Click the pencil icon on the right side of the screen ("Edit this + file") to edit the `cookie-recipe.md` file. +2. Click the name of the file at the top of the screen and rename the + file to `chocolate-chip-cookies.md`. Remember to not use spaces in + the file name and keep the file extension (`.md`). +3. Commit the changes as we have done it previously, by clicking the + green "Commit changes" button and fill in the commit message. + +Next, move the file to a new `baked-goods/` folder: + +1. Click the pencil icon on the right side of the screen ("Edit this + file") as we did before on the `chocolate-chip-cookies.md` file. +2. Click the name of the file at the top of the screen and change the + path of the file to a new folder to your repository. The current + file path is `chocolate-chip-cookies.md`. To create a new folder, + change the file path by typing `baked-goods/` at the start of the + file name, so the whole file path + becomes`baked-goods/chocolate-chip-cookies.md`. Notice the `/` + between the folder name and the file name. +3. Commit the changes. + +You have now renamed your cookies recipe file and moved it to a new +folder in your repository! :partying_face: + +{{< text_snippet sticky_up >}} + +## :woman_technologist: Exercise: Find the commit where you added the cookie recipe + +**Time: \~10 minutes** + +Now that you have made a couple of commits to your repository, take a +look at the history to find the commit where you first added the cookie +recipe. + +1. In your repository, click the "Commits" button on the right side of + the screen. This will show you all the changes that have been made + to your repository along with the commit messages, the author of the + changes, and when the changes where made. Neat! +2. Go through the list of commits to find the commit where you added + the cookie recipe. The commit message should be "Add cookie recipe". + +::: callout-note +Looking at the history shows the importance of meaningful commit +messages. Imagine if all the commit messages were "Update file". Then, +it would be easy to lose track of what changes were made in each commit. + +By contrast, if the commits have meaningful messages (like "Add cookie +recipe" or "Move cookie recipe to baked-goods folder"), it is much +easier to get an overview of the changes. +::: + +{{< text_snippet sticky_up >}} + +::: callout-tip +You can both look at the history of the entire repository or the history +of a specific file. The history of the entire repository shows all the +commits that have been made to all files in the repository, while the +history of a specific file shows the commits that have been made to that +file only. + +You can access the history of a specific file by going to the file in +the repository and clicking the "History" button on the right side of +the screen. +::: ## Summary - TODO: List of summary items - From 39f7a38c5f2ae53fdb2983eef225461bdf4fbd6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Signe=20Kirk=20Br=C3=B8db=C3=A6k?= Date: Tue, 18 Feb 2025 15:07:39 +0100 Subject: [PATCH 11/12] docs: :fire: remove link to cookie recipe that inspired the example recipe Not needed. --- sessions/working-with-files.qmd | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sessions/working-with-files.qmd b/sessions/working-with-files.qmd index e9e0954..bf3447d 100644 --- a/sessions/working-with-files.qmd +++ b/sessions/working-with-files.qmd @@ -75,10 +75,6 @@ Let's add the first recipe to your repository: A cookie recipe! :cookie: from the paper. ``` -This recipe is a simplified version of -[this](https://twin-food.dk/mit-bud-pa-de-bedste-cookies/) -recipe---which is really good by the way :yum:): - You have now added your first recipe and made your first commit to your repository! :tada: From 52b5843dad4e02ada3fb078e1cab2b422505a044 Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Tue, 18 Feb 2025 16:24:28 +0100 Subject: [PATCH 12/12] docs: :pencil2: small edits, mainly removing Markdown syntax --- sessions/using-issues.qmd | 6 ++---- sessions/working-with-files.qmd | 13 ++++--------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/sessions/using-issues.qmd b/sessions/using-issues.qmd index 83b935d..682e242 100644 --- a/sessions/using-issues.qmd +++ b/sessions/using-issues.qmd @@ -100,9 +100,7 @@ Now, you'll add a recipe to your neighbour's repository. **Example brownie recipe:** ``` markdown -# Brownies - -## Ingredients +Ingredients for brownies - 350 grams dark chocolate - 250 grams butter @@ -112,7 +110,7 @@ Now, you'll add a recipe to your neighbour's repository. - 60 grams flour - 1 tsp baking powder -## Instructions +Instructions 1. Melt the chocolate and butter together. 2. Whisk the eggs until frothy and add brown and white sugar. diff --git a/sessions/working-with-files.qmd b/sessions/working-with-files.qmd index bf3447d..b243c0f 100644 --- a/sessions/working-with-files.qmd +++ b/sessions/working-with-files.qmd @@ -45,9 +45,7 @@ Let's add the first recipe to your repository: A cookie recipe! :cookie: **Example cookie recipe:** ``` markdown -# Chocolate chip cookies - -## Ingredients +Ingredients for chocolate chip cookies - 240 grams flour - 3/4 tsp salt @@ -61,18 +59,15 @@ Let's add the first recipe to your repository: A cookie recipe! :cookie: - 150 grams chocolate (e.g., a mix of dark and milk chocolate) - 100 grams chopped hazelnuts (can be omitted or replaced with oats) -## Instructions +Instructions 1. Mix the sugar, brown sugar, and butter well. 2. Add the egg and mix again. 3. Add salt, baking powder, vanilla powder, baking soda, and flour. 4. Add the chopped chocolate and nuts. -5. Form clumps of dough on a baking tray with plenty of space - between them. +5. Form clumps of dough on a baking tray with plenty of space between them. 6. Bake at 175°C (top and bottom heat) for 16.5-17 minutes. -7. Once baked, transfer the baking paper with the cookies onto a - wire rack and let them cool for 10 minutes before removing them - from the paper. +7. Once baked, transfer the baking paper with the cookies onto a wire rack and let them cool for 10 minutes before removing them from the paper. ``` You have now added your first recipe and made your first commit to your