Modify _config.yml for Sphinx settings

Updated configuration options for live code and added new settings for Sphinx extensions.
This commit is contained in:
Tom van Woudenberg 2025-09-14 08:56:38 +02:00 • committed by GitHub
parent 30909e1406
commit 776d252faa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,10 +16,10 @@ sphinx: # Options passed on to the
config:
language: en # Defines language (English) of everything except the content itself. For Dutch: replace with `nl`
html_js_files:
- https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js # Required for live code: https://teachbooks.io/manual/features/live_code.html
- https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js # Required for live code, part of TeachBooks-Sphinx-Thebe (https://teachbooks.io/manual/features/live_code.html)
thebe_config:
use_thebe_lite: true # Required for live code: https://teachbooks.io/manual/features/live_code.html
exclude_patterns: ["**/_*.yml", "**/*.md", "**/*.ipynb"] #exclude files which should not be accessible for live code: https://teachbooks.io/manual/features/live_code.html
use_thebe_lite: true # Required for live code, part of TeachBooks-Sphinx-Thebe (https://teachbooks.io/manual/features/live_code.html)
exclude_patterns: ["**/_*.yml", "**/*.md", "**/*.ipynb"] #exclude files which should not be accessible for live code, configuration part of TeachBooks-Sphinx-Thebe (https://teachbooks.io/manual/features/live_code.html)
html_theme_options:
logo:
text: Template # Replace this with your own book title
@ -32,7 +32,7 @@ sphinx: # Options passed on to the
use_repository_button: true # Replace with false if you don't want the repository button (i.e. if you have a private repo)
use_issues_button : true # Replace with false if you don't want the issues button (i.e. if you don't want to use GitHub issues or have a private repo)
launch_buttons:
thebe: true # Required for live code: https://teachbooks.io/manual/features/live_code.html
thebe: true # Required for live code, part of TeachBooks-Sphinx-Thebe (https://teachbooks.io/manual/features/live_code.html)
html_show_copyright: false # As the copyright is included in the author field
html_last_updated_fmt: '%B %-d, %Y' # Adds the date of the last update to the footer
html_static_path: ["figures"] # Add folder that contain files that need to be included, such as the location of the logo(s)
@ -40,13 +40,36 @@ sphinx: # Options passed on to the
chtml: {
mtextInheritFont: true # To typeset text within math prettier
}
named_colors_custom_colors: {'attributiongrey':[150,150,150]} # Defines grey colour for attribution admonition of external pages, configuration part of TeachBooks package (https://teachbooks.io/manual/features/external_toc.html)
patch_config:
disabled-patches: [] # Default value (line can be removed), disables specific patches, configuration part of JupyterBook-Patches (https://teachbooks.io/manual/external/JupyterBook-Patches/README.html)
inverter_all: true # Default value (line can be removed), inverts all figures, configuration part of Sphinx-Image-Inverter (https://teachbooks.io/manual/external/Sphinx-Image-Inverter/README.html)
inverter_saturation: 1.5 # Default value (line can be removed), sets saturation of figures in dark mode to 1.5, configuration part of Sphinx-Image-Inverter (https://teachbooks.io/manual/external/Sphinx-Image-Inverter/README.html)
iframe_blend: true # Default value (line can be removed), blends all iframes with the background and in dark-mode also inverted., configuration part of Sphinx-Iframes (https://teachbooks.io/manual/external/sphinx-iframes/README.html)
iframe_saturation: 1.5 # Default value (line can be removed), sets saturation of iframes in dark mode to 1.5, configuration part of Sphinx-Iframes (https://teachbooks.io/manual/external/sphinx-iframes/README.html)
iframe_h5p_autoresize: true # Default value (line can be removed), automagically resized all h5p elements to fit the element in which the iframe is loadeds, configuration part of Sphinx-Iframes (https://teachbooks.io/manual/external/sphinx-iframes/README.html)
iframe_background: "#ffffff" # Default value (line can be removed), sets the standard background color of non-blended iframes to white, configuration part of Sphinx-Iframes (https://teachbooks.io/manual/external/sphinx-iframes/README.html)
iframe_width: calc(100% - 2.8rem) # Default value (line can be removed), sets the standard width of the iframe within the parent element, configuration part of Sphinx-Iframes (https://teachbooks.io/manual/external/sphinx-iframes/README.html)
iframe_aspectratio: auto 2 / 1 # Default value (line can be removed), sets the standard aspect ration of the iframe within the parent element, configuration part of Sphinx-Iframes (https://teachbooks.io/manual/external/sphinx-iframes/README.html)
hide_solutions: false # Default value (line can be removed), does not hide all solutions from exercises, configuration part of Sphinx-Exercise (https://ebp-sphinx-exercise.readthedocs.io/en/latest/syntax.html)
named_colors_include_CSS: true # Default value (line can be removed), includes all CSS colours, configuration part of Sphinx-Named-Colors (https://teachbooks.io/manual/external/Sphinx-Named-Colors/README.html)
named_colors_dark_and_light: true # Default value (line can be removed), creates dark mode colours for CSS and custom named colours, configuration part of Sphinx-Named-Colors (https://teachbooks.io/manual/external/Sphinx-Named-Colors/README.html)
named_colors_saturation: 1.5 # Default value (line can be removed), sets saturation of CSS and custom named colours in dark mode to 1.5, configuration part of Sphinx-Named-Colors (https://teachbooks.io/manual/external/Sphinx-Named-Colors/README.html)
named_colors_custom_colors: None # Default value (line can be removed), defines no custom named colours (include no colour for attribution admonition of external pages), configuration part of Sphinx-Named-Colors (https://teachbooks.io/manual/external/Sphinx-Named-Colors/README.html)
proof_minimal_theme: false # Default value (line can be removed), uses default color scheme for admonitions part of sphinx-proof, configuration part of Sphinx-Proof (https://sphinx-proof.readthedocs.io/en/latest/options.html)
sphinx_codex_name: "" # Default value (line can be removed), uses default 'Code example' as title for codex directives, configuration part of Sphinx-Code-Examples (https://teachbooks.io/manual/_git/github.com_TeachBooks_sphinx-code-examples/main/MANUAL.html)
sphinx_codex_style_from_proof: true # Default value (line can be removed), the CSS color style of the codex directive will be taken from the prf:example directive from the sphinx-proof extension, configuration part of Sphinx-Code-Examples (https://teachbooks.io/manual/_git/github.com_TeachBooks_sphinx-code-examples/main/MANUAL.html)
sphinx_codex_icon_from_proof: false # Default value (line can be removed), the icon of the codex directive will not be taken from the prf:example directive from the sphinx-proof extension, configuration part of Sphinx-Code-Examples (https://teachbooks.io/manual/_git/github.com_TeachBooks_sphinx-code-examples/main/MANUAL.html)
sphinx_codex_merge_with_proof: false # Default value (line can be removed), the codex directive will not be merged with the prf:example directive from the sphinx-proof extension, configuration part of Sphinx-Code-Examples (https://teachbooks.io/manual/_git/github.com_TeachBooks_sphinx-code-examples/main/MANUAL.html)
sphinx_togglebutton_selector: ".toggle, .admonition.dropdown" # Default value (line can be removed), configures the CSS selector used to insert toggle buttons, configuration part of https://sphinx-togglebutton.readthedocs.io/en/latest/use.html
togglebutton_hint: "Click to show" # Default value (line can be removed), defines hint when toggle is closed, configuration part of https://sphinx-togglebutton.readthedocs.io/en/latest/use.html
togglebutton_hint_hide: "Click to hide" # Default value (line can be removed), defines hint when toggle is opened, configuration part of https://sphinx-togglebutton.readthedocs.io/en/latest/use.html
togglebutton_open_on_print: true # Default value (line can be removed), opens all toggle-able content when you print, configuration part of https://sphinx-togglebutton.readthedocs.io/en/latest/use.html
extra_extensions:
- teachbooks_favourites # Gives you a starter package of extensions to use in your book, replace with individual extensions if you prefer some extensions not to be included (https://github.com/TeachBooks/TeachBooks-Favourites)
teachbooks:
attribution_location: top # Default value, sets location of attribution admonition of external pages, configuration part of TeachBooks package (https://teachbooks.io/manual/features/external_toc.html)
attribution_color: attributiongrey # Sets grey colour for attribution admonition of external pages, configuration part of TeachBooks package (https://teachbooks.io/manual/features/external_toc.html)
attribution_location: top # Default value (line can be removed), sets location of attribution admonition of external pages, configuration part of TeachBooks package (https://teachbooks.io/manual/features/external_toc.html)
attribution_color: None # Default value (line can be removed), uses blue colour for attribution admonition of external pages, configuration part of TeachBooks package (https://teachbooks.io/manual/features/external_toc.html)
bibtex_bibfiles:
- references.bib # Required for references