mirror of
https://github.com/TeachBooks/manual.git
synced 2026-11-12 22:35:51 +00:00
Merge branch 'release' into 30-add-section-on-icons
This commit is contained in:
commit
829bfcaf55
12 changed files with 223 additions and 5 deletions
13
.github/dependabot.yml
vendored
Normal file
13
.github/dependabot.yml
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "gitsubmodule" # See documentation for possible values
|
||||
directory: "/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
day: "sunday"
|
||||
time: "22:59"
|
||||
1
.github/workflows/call-deploy-book.yml
vendored
1
.github/workflows/call-deploy-book.yml
vendored
|
|
@ -4,6 +4,7 @@ on:
|
|||
push:
|
||||
branches:
|
||||
- '**'
|
||||
# - '!dependabot**'
|
||||
# If your git repository has the Jupyter Book within some-subfolder next to
|
||||
# unrelated files, you can make this run only if a file within that specific
|
||||
# folder (or the workflow file itself) has been modified.
|
||||
|
|
|
|||
11
.gitmodules
vendored
11
.gitmodules
vendored
|
|
@ -1,33 +1,44 @@
|
|||
[submodule "book/external/Nested-Books"]
|
||||
path = book/external/Nested-Books
|
||||
url = https://github.com/TeachBooks/Nested-Books.git
|
||||
branch = manual-description
|
||||
[submodule "book/external/template"]
|
||||
path = book/external/template
|
||||
url = https://github.com/TeachBooks/template.git
|
||||
branch = manual_description
|
||||
[submodule "book/external/deploy-book-workflow"]
|
||||
path = book/external/deploy-book-workflow
|
||||
url = https://github.com/TeachBooks/deploy-book-workflow.git
|
||||
branch = manual_docs
|
||||
[submodule "book/external/Useful_python_code"]
|
||||
path = book/external/Useful_python_code
|
||||
url = https://github.com/TeachBooks/Useful_python_code.git
|
||||
branch = manual
|
||||
[submodule "book/external/Sphinx-Image-Inverter"]
|
||||
path = book/external/Sphinx-Image-Inverter
|
||||
url = https://github.com/TeachBooks/Sphinx-Image-Inverter.git
|
||||
branch = Manual
|
||||
[submodule "book/external/JupyterBook-Patches"]
|
||||
path = book/external/JupyterBook-Patches
|
||||
url = https://github.com/TeachBooks/JupyterBook-Patches.git
|
||||
branch = manual_docs
|
||||
[submodule "book/external/Download-Link-Replacer"]
|
||||
path = book/external/Download-Link-Replacer
|
||||
url = https://github.com/TeachBooks/Download-Link-Replacer.git
|
||||
branch = manual_docs
|
||||
[submodule "book/external/Sphinx-Grasple-public"]
|
||||
path = book/external/Sphinx-Grasple-public
|
||||
url = https://github.com/TeachBooks/Sphinx-Grasple-public.git
|
||||
branch = manual_docs
|
||||
[submodule "book/external/Sphinx-TUDelft-theme"]
|
||||
path = book/external/Sphinx-TUDelft-theme
|
||||
url = https://github.com/TeachBooks/Sphinx-TUDelft-theme.git
|
||||
branch = Manual
|
||||
[submodule "book/external/teachbooks-sphinx-tippy"]
|
||||
path = book/external/teachbooks-sphinx-tippy
|
||||
url = https://github.com/TeachBooks/teachbooks-sphinx-tippy.git
|
||||
branch = Manual
|
||||
[submodule "book/external/annotater"]
|
||||
path = book/external/annotater
|
||||
url = https://github.com/TeachBooks/annotater
|
||||
branch = manual
|
||||
|
|
@ -16,6 +16,6 @@ This book will continue to develop, so feel free to contribute https://github.co
|
|||
|
||||
The released book can be found on on https://teachbooks.io/manual. This page shows the built book of the `release` branch All branches will also be visible as seen in the action's summaries: https://github.com/TeachBooks/mirror_teachbook_manual/actions
|
||||
|
||||
Some parts of this book are taken from other sources in the form of submodules (linked in the folder [book/external](book/external)). To contribute to those pages, contribute to the source repository directly with a fork and merge/pull request. If you intent to clone this boko including its submodules, clone using: `git clone --recurse-submodules git@github.com:TeachBooks/manual.git`
|
||||
Some parts of this book are taken from other sources in the form of submodules (linked in the folder [book/external](book/external)). To contribute to those pages, contribute to the source repository directly with a fork and merge/pull request. If you intent to clone this book including its submodules, clone using: `git clone --recurse-submodules git@github.com:TeachBooks/manual.git`
|
||||
|
||||
Happy book building!
|
||||
|
|
|
|||
|
|
@ -43,6 +43,10 @@ sphinx:
|
|||
html_static_path: ["images"]
|
||||
bibtex_default_style: myapastyle
|
||||
bibtex_reference_style: author_year_round
|
||||
mathjax3_config:
|
||||
tex:
|
||||
macros:
|
||||
"newcolor": ['\definecolor{newcolor}{RGB}{111, 29, 119}{\color{newcolor}#1}',1]
|
||||
local_extensions:
|
||||
apastyle: _ext/
|
||||
bracket_citation_style: _ext/
|
||||
|
|
|
|||
19
book/_static/color.css
Normal file
19
book/_static/color.css
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
:root {
|
||||
--newcolor-light: rgb(111, 29, 119);
|
||||
--newcolor-dark: rgb(255, 167, 255);
|
||||
--newcolor: var(--newcolor-light);
|
||||
}
|
||||
|
||||
html[data-theme="dark"] {
|
||||
--newcolor: var(--newcolor-dark);
|
||||
}
|
||||
|
||||
.newcolor {color: var(--newcolor);}
|
||||
|
||||
.newcolor-same {color: var(--newcolor-light);}
|
||||
|
||||
.newcolor-filter {color: var(--newcolor-light);}
|
||||
|
||||
html[data-theme="dark"] .newcolor-filter {
|
||||
filter: invert(1) hue-rotate(180deg) saturate(1.5);
|
||||
}
|
||||
|
|
@ -79,6 +79,7 @@ parts:
|
|||
- file: external/Sphinx-TUDelft-theme/README.md
|
||||
- file: external/teachbooks-sphinx-tippy/README.md
|
||||
- file: features/apa
|
||||
- file: features/custom_colors.md
|
||||
- file: features/students
|
||||
sections:
|
||||
- file: external/annotater/README.md
|
||||
|
|
|
|||
2
book/external/Nested-Books
vendored
2
book/external/Nested-Books
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 3cf61525f3985916805a59361935764d78e460df
|
||||
Subproject commit 51f0ba6754f0a5f95032e09482a7a28145687624
|
||||
2
book/external/Sphinx-TUDelft-theme
vendored
2
book/external/Sphinx-TUDelft-theme
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 35ecbddad78b567a0b2d1d4bdb513d8b95181348
|
||||
Subproject commit 71399c659b037a550a253e38ddacfb33e03cc882
|
||||
2
book/external/deploy-book-workflow
vendored
2
book/external/deploy-book-workflow
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit ed2cdc81be5036deb8da244814a946d17ece7708
|
||||
Subproject commit 317a9cc8607f74f29957b28a86450eccba6a4e2c
|
||||
2
book/external/teachbooks-sphinx-tippy
vendored
2
book/external/teachbooks-sphinx-tippy
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit a80e7645bc5a377b3c75befdf29eb67934bb9ab7
|
||||
Subproject commit 3f9a5c2a72607d5e32c3a99649f37a5e6548e92a
|
||||
169
book/features/custom_colors.md
Normal file
169
book/features/custom_colors.md
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
# Custom colors
|
||||
|
||||
```{admonition} User types
|
||||
:class: tip
|
||||
This page is useful for user type 4 and 5.
|
||||
```
|
||||
|
||||
Within these online books sometimes extra/new colors are wished for. In this page is shown how this can be achieved.
|
||||
|
||||
## Using `definecolor`
|
||||
|
||||
::::{warning}
|
||||
This method only works for $\LaTeX$ colors.
|
||||
::::
|
||||
|
||||
::::{warning}
|
||||
In this case the color remains the same in ligt and dark mode.
|
||||
::::
|
||||
|
||||
### Code in `_config.yml`
|
||||
|
||||
```yaml
|
||||
sphinx:
|
||||
config:
|
||||
mathjax3_config:
|
||||
tex:
|
||||
macros:
|
||||
"newcolor": ['\definecolor{newcolor}{RGB}{111, 29, 119}{\color{newcolor}#1}',1]
|
||||
```
|
||||
|
||||
### Code in content
|
||||
|
||||
```latex
|
||||
:::{math}
|
||||
\newcolor{\LaTeX}
|
||||
:::
|
||||
```
|
||||
|
||||
### Result
|
||||
|
||||
:::{math}
|
||||
\newcolor{\LaTeX}
|
||||
:::
|
||||
|
||||
## Using CSS
|
||||
|
||||
In this case one has three options:
|
||||
|
||||
1. Light and dark mode the same color
|
||||
1. Light and dark mode different colors using two color definitions
|
||||
1. Light and dark mode different colors using a color filter
|
||||
|
||||
### Light and dark mode the same color
|
||||
|
||||
::::{note}
|
||||
This method has the benefit that the custom color can be used also within html and css elements.
|
||||
::::
|
||||
|
||||
#### Code in `_static/color.css`
|
||||
|
||||
```css
|
||||
:root {
|
||||
--newcolor: rgb(111, 29, 119);
|
||||
}
|
||||
|
||||
.newcolor {color: var(--newcolor);}
|
||||
```
|
||||
|
||||
#### Code in content
|
||||
|
||||
```latex
|
||||
:::{math}
|
||||
\class{newcolor}{\LaTeX}
|
||||
:::
|
||||
```
|
||||
|
||||
```html
|
||||
<div class="newcolor">HTML text</div>
|
||||
```
|
||||
|
||||
#### Result
|
||||
|
||||
:::{math}
|
||||
\class{newcolor-same}{\LaTeX}
|
||||
:::
|
||||
|
||||
<div class="newcolor-same">HTML text</div>
|
||||
|
||||
### Light and dark mode different colors using two color definitions
|
||||
|
||||
::::{note}
|
||||
This method has the benefit that the custom colors can be used also within html and css elements with automatic changes when the mode changes from Light to dark or vice versa.
|
||||
::::
|
||||
|
||||
|
||||
#### Code in `_static/color.css`
|
||||
|
||||
```css
|
||||
:root {
|
||||
--newcolor: rgb(111, 29, 119);
|
||||
}
|
||||
|
||||
html[data-theme="dark"] {
|
||||
--newcolor: rgb(255, 167, 255)
|
||||
}
|
||||
|
||||
.newcolor {color: var(--newcolor);}
|
||||
```
|
||||
|
||||
#### Code in content
|
||||
|
||||
```latex
|
||||
:::{math}
|
||||
\class{newcolor}{\LaTeX}
|
||||
:::
|
||||
```
|
||||
|
||||
```html
|
||||
<div class="newcolor">HTML text</div>
|
||||
```
|
||||
|
||||
#### Result
|
||||
|
||||
:::{math}
|
||||
\class{newcolor}{\LaTeX}
|
||||
:::
|
||||
|
||||
<div class="newcolor">HTML text</div>
|
||||
|
||||
### Light and dark mode different colors using a color filter
|
||||
|
||||
::::{warning}
|
||||
This method has the drawback that the custom colors can only be used as a class.
|
||||
::::
|
||||
|
||||
#### Code in `_static/color.css`
|
||||
|
||||
```css
|
||||
:root {
|
||||
--newcolor: rgb(111, 29, 119);
|
||||
}
|
||||
|
||||
.newcolor {color: var(--newcolor);}
|
||||
|
||||
html[data-theme="dark"] .newcolor {
|
||||
filter: invert(1) hue-rotate(180deg) saturate(1.5);
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
#### Code in content
|
||||
|
||||
```latex
|
||||
:::{math}
|
||||
\class{newcolor}{\LaTeX}
|
||||
:::
|
||||
```
|
||||
|
||||
```html
|
||||
<div class="newcolor">HTML text</div>
|
||||
```
|
||||
|
||||
#### Result
|
||||
|
||||
:::{math}
|
||||
\class{newcolor-filter}{\LaTeX}
|
||||
:::
|
||||
|
||||
<div class="newcolor-filter">HTML text</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue