another small change

This commit is contained in:
Tom van Woudenberg 2025-04-14 09:27:08 +02:00
parent 5dcd816588
commit df988b1a6d

View file

@ -147,15 +147,21 @@ This content is both highlighted as important and collapsible.
**Step A: Add to `requirements.txt`**
Ensure that the package is included in your project's `requirements.txt` to track the dependency:
Ensure that the package is included in your project's `requirements.txt` (in the root of your repository) to make it available:
```
.
.
.
sphinx-named-colors
.
.
.
```
**Step B: Enable in `_config.yml`**
In your `_config.yml` file, add the extension to the list of Sphinx extra extensions:
In your `_config.yml` file (in the `book/` subdirectory of your repository), add the extension to the list of Sphinx extra extensions so that it's included in the building of your book:
```md
sphinx:
@ -174,34 +180,32 @@ sphinx:
15. Once you have chosen a colour, coloured admonitions can be generated in two ways, depending on how you'd like to structure your content. The first method is by adding the name-colour via `:class:` to an existing `admonition` or `dropdown` type block, similar to what was done above. This can be done as follows:
````md
```{admonition} Custom Colour Example
```{admonition} Custom Colour Example 1
:class: darkred
This is a custom coloured admonition using `:class: darkred`.
```
````
16. When using the above method, a new class is introduced: `no-title`. This suppresses printing of the title bar, even if the title is given. Try this out by adding this class to the above code.
17. The second method of adding coloured admonitions is by directly creating an admonition based on a colour. This method can be used if you'd rather not use the generic type and want a minimal syntax. In this case, the title is optional, and if omitted, the title bar will not appear. Try this out with the code below:
16. The second method of adding coloured admonitions is by directly creating an admonition based on a colour. This method can be used if you'd rather not use the generic type and want a minimal syntax. In this case, the title is optional, and if omitted, the title bar will not appear. Try this out with the code below:
````md
```{darkgreen} Optional Title
```{darkgreen} Optional Title with custom coluor example 2
This is a green-styled custom admonition.
```
````
18. For more details, see the documentation of this extension in [our manual](https://teachbooks.io/manual/external/Sphinx-Named-Colors/README.html). This also describes how to add your own custom colours!
17. For more details, see the documentation of this extension in [our manual](https://teachbooks.io/manual/external/Sphinx-Named-Colors/README.html). This also describes how to add your own custom colours!
19. When you are ready, commit your changes to the repository by clicking on the green `Commit changes` button.
18. When you are ready, commit your changes to the repository by clicking on the green `Commit changes` button.
20. Add a commit message.
19. Add a commit message.
21. To see your changes, go to {octicon}`play` `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).
20. To see your changes, go to {octicon}`play` `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).
22. Do you see your change? If you don't see it click `CTRL`+`F5`/`Control`+`F5`to refresh the page.
21. 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