template/book/exercises/008.md
Julie Kirsch fd0e1a131f works?
2025-02-24 17:53:06 +01:00

51 lines
1.9 KiB
Markdown

# Exercise 8: Add visual media
To help you illustrate your content, it can be sueful to add some type of visual media such as figures, videos or gifs. If you want to add a figure/gif/video to you book, you can refer to another website. This is quite handy for video's but it does carry the risk that this figure/gif/video will no longer be visible if the location is changed. So it is better to add the source directly to the book.
````{tab-set}
```{tab-item} Linking
Hello
```
```{tab-item} Embedding
1. You will first need to upload your media to the repository. Navigate to the folder called figures(`book/figures`) and make sure you are i the right branch. On the right top, click on `Add file` and `Upload new file`.
2. Choose the visual media you want to upload. Remember its file name as you will need it later.
3. Commit your changes.
4. Now let's add the figure to a chapter. Navigate to the file you want to work in (for example `book/some_content/overview.md`) and make sure you're in the correct branch.
5. Copy this syntax
```md
```{figure} figures/<new_figure>.PNG
---
width: 80%
align: center
name: my_new_figure
---
New figure
```
```
```{Warning}
Make sure the file extension of your figure is correct because markdown differentiates capital letters!
```
6. When you are ready, commit your changes to the repository by clicking on the green `Commit changes` button.
7. Add a commit message.
8. To see you changes, go to {octicon}`play;1em` `Actions` - The most recent workflow run `overview.md / 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 (user type 4))
9. Do you see your change? If you don't see it click `CTRL`+`F5`/`Control`+`F5`to refresh the page.
```
````