Skip to content

Commit

Permalink
Changed two to existing file
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-van-Woudenberg committed Dec 13, 2024
1 parent dc4e7fb commit 2309707
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 31 deletions.
44 changes: 14 additions & 30 deletions book/exercises/002.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
# Exercise 2: 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!
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 add a file which is not in the table of contents yet!

Can you create a file named `my_first_file.md` and add it successfully to the book?
Add the file named `file_to_be_added_to_toc.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/<your_username>/<your_repo_name>`) - {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/<your_username>/<your_repo_name>`) - {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
1. Go to the (`https://github.com/<your_username>/<your_repo_name>`) - {octicon}`code;1em` `Code` - `Book` directory of your GitHub repository and find the location of `file_to_be_added_to_toc.md`
2. Go to the the file `book/_toc.yml` on your GitHub repository (`https://github.com/<your_username>/<your_repo_name>`) - {octicon}`code;1em` `Code` - `Book` - `_toc.yml` - {octicon}`pencil;1em` `Edit this file`
3. Add `file_to_be_added_to_toc.md` as a second item in the `Some content` chapter

````{admonition} Need some help?
:class: tip, dropdown
Expand All @@ -37,7 +21,7 @@ parts:
- file: some_content/overview.md
sections:
- file: some_content/text_and_code.ipynb
- file: my_first_file.md
- file: file_to_be_added_to_toc.md
- file: exercises/exercises
sections:
- file: exercises/001.md
Expand All @@ -51,19 +35,19 @@ parts:
- file: credits.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.
4. Click `Commit changes`
5. Add a message and description of your change
6. Select `Commit directly to the main branch` (this adds your change your change to the default version instead of making a new one)
7. Click `Commit changes`
8. 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)
9. Do you see your change? If you don't see it click `CTRL`+`F5`/`Control`+`F5`to refresh the page.

```{admonition} Check your understanding
:class: note
Before moving on to the next exercise, make sure you understand the following:
- Are all files in the repository added to the website?
- How many commits does it take to add a file online?
- What needs to be on a page at least to be edit to the book?
- What is the purpose of the `_toc.yml` file?
- What happens if a file is not listed in the `_toc.yml`?
- How can you verify that your changes to `_toc.yml` were successful?
```
2 changes: 1 addition & 1 deletion book/exercises/004.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ By now, we've covered the essentials: content files, `_toc.yml` and `_config.yml

Can you make a new `branch` of your book with an additional file `file_on_new_version.md` and view it online?

1. Add a new Issue to let people know you're working on something by going to your repository (`https://github.com/<your_username>/<your_repo_name>`) - {octicon}`issue-opened;1em` `Issues` - `New issue` (note that is not required for making your own version, but it's good practice)
1. Add a new Issue to let people know you're working on something by going to your repository (`https://github.com/<your_username>/<your_repo_name>`) - {octicon}`issue-opened;1em` `Issues` - `New issue` (note that is not required for making your own version, but it's good practice so that people know where you're working on)
2. Add a title and description, eg. `Added some content`
3. On `Assignees`, click `Assign yourself
4. Click `Submit new issue`
Expand Down
2 changes: 2 additions & 0 deletions book/file_to_be_added_to_toc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Title of the file to be added to the toc
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.

0 comments on commit 2309707

Please sign in to comment.