diff --git a/book/_toc.yml b/book/_toc.yml index 3334e7b..41c8f76 100644 --- a/book/_toc.yml +++ b/book/_toc.yml @@ -10,6 +10,7 @@ parts: - file: exercises/exercises sections: - file: exercises/001.md + - file: exercises/002.md - file: references.md - file: changelog.md - file: credits.md diff --git a/book/exercises/001.md b/book/exercises/001.md index ad66766..e9fecb9 100644 --- a/book/exercises/001.md +++ b/book/exercises/001.md @@ -4,13 +4,13 @@ Let's start with the most basic edit: add some text to a file and see that the w Can you add some content to the intro page? -1. Go to the source file of this page on your GitHub repository (`https://github.com//`) - {octicon}`code;1em` `Code` - `Book` - `intro.md` - {octicon}`pencil;1em` `Edit this file` +1. Go to the the file `book/intro.md` on your GitHub repository (`https://github.com//`) - {octicon}`code;1em` `Code` - `Book` - `intro.md` - {octicon}`pencil;1em` `Edit this file` 2. Add some text. Feeling brave? Have a look at the [MyST cheat sheet](https://jupyterbook.org/en/stable/reference/cheatsheet.html). Don't worry if that feels daunting, there will be exercises on this! 3. Click `Commit changes` -4. Add a description of your change +4. Add a message and description of your change 5. Select `Commit directly to the main branch` (this adds your change your change to the default version instead of making a new one) 6. Click `Commit changes` -7. Go to {octicon}`play;1em` `Actions` - The most recent workflow run `Update intro.md / the name of the commit you just made` - Wait for it to finish - In the summary, click on the link of your book shown in the table `Branches deployed` and under `Primary book at root` +7. Go to {octicon}`play;1em` `Actions` - The most recent workflow run `Update intro.md / the commit messageof the commit you just made` - Wait for it to finish - In the summary, click on the link of your book shown in the table `Branches deployed` and under `Primary book at root` 8. Do you see your change? If you don't see it click `CTRL`+`F5`/`Control`+`F5`to refresh the page (your browser keeps a cached version of website you recently visit, but we actually want the most up-to-date version!). ```{admonition} Check your understanding diff --git a/book/exercises/002.md b/book/exercises/002.md new file mode 100644 index 0000000..e080436 --- /dev/null +++ b/book/exercises/002.md @@ -0,0 +1,56 @@ +# Exercise 1: Add a new file to the table of contents + +Let's continue by adding one additional step. Let's add a file to the table of contents! the `_toc.yml` contains a list of all the files to be shown in your book-website. Let's create a new file and add it to that list! + +Can you create a file named `my_first_file.md` and add it successfully to the book? + +1. Go to the `/book` directory of your GitHub repository and add a file (`https://github.com//`) - {octicon}`code;1em` `Code` - `Book` - `intro.md` - `Add file` - {octicon}`plus;1em` `Create new file` +2. Name your file `my_first_file.md`. Don't forget the `.md`! +3. In the `Edit` field, start the first line with the header of your page (each file needs to have a header which will be the title shown in the table of contents): +```md +# Title of my first file +``` +4. On a new line, add some more text so that you end up with something like: + +```md +# Title of my first file +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean id diam non mauris auctor sollicitudin. Ut quis nunc lobortis, iaculis massa id, eleifend justo. Nulla ac auctor sapien. Etiam sit amet est a ex vestibulum porta. Nulla non lacus a purus luctus blandit sit amet non nibh. Curabitur vitae cursus dolor. Ut eu nisi nec enim ullamcorper fermentum. +``` +5. Want to view all the text without horizontal scrolling? Click `No wrap` and select `Soft wrap` +6. Click `Commit changes` +7. Add a message and description of your change +8. Select `Commit directly to the main branch` (this adds your change your change to the default version instead of making a new one) +9. Click `Commit changes` +10. Go to the the file `book/_toc.yml` on your GitHub repository (`https://github.com//`) - {octicon}`code;1em` `Code` - `Book` - `_toc.yml` - {octicon}`pencil;1em` `Edit this file` +11. Add this file as a second item in the `Some content` chapter + +````{admonition} Need some help? +:class: tip, dropdown +Your `_toc.yml` should look like +```yml +... +parts: + - caption: Contents + chapters: + - file: some_content/overview.md + sections: + - file: some_content/text_and_code.ipynb + - file: my_first_file.md +... +``` +```` +12. Click `Commit changes` +13. Add a message and description of your change +14. Select `Commit directly to the main branch` (this adds your change your change to the default version instead of making a new one) +15. Click `Commit changes` +16. Go to {octicon}`play;1em` `Actions` - The most recent workflow run `Update _toc.yml / the commit message of the commit you just made` - Wait for it to finish - In the summary, click on the link of your book shown in the table `Branches deployed` and under `Primary book at root` (getting bored of waiting, there'll be exercising on doing this locally which prevents you from waiting) +17. Do you see your change? If you don't see it click `CTRL`+`F5`/`Control`+`F5`to refresh the page (your browser keeps a cached version of website you recently visit, but we actually want the most up-to-date version!). + +```{admonition} Check your understanding +:class: tip + +Before moving on to the next exercise, make sure you understand the following: +1. Are all files in the repository added to the website? +2. How many commits does it take to add a file online? +3. What needs to be on a page at least to be edit to the book? +``` \ No newline at end of file diff --git a/book/some_content/overview.md b/book/some_content/overview.md index 5adab4e..ec79e50 100644 --- a/book/some_content/overview.md +++ b/book/some_content/overview.md @@ -1,3 +1,3 @@ -# Overview +# Some content Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file