Skip to content

Commit 1e86aa4

Browse files
committed
✨ add website for course
1 parent aeef451 commit 1e86aa4

6 files changed

Lines changed: 177 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Build website and save it on gh-pages branch
2+
name: build-and-save-website
3+
4+
# Only run this when the master branch is ch
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
branches:
11+
- main
12+
# workflow_dispatch:
13+
14+
# This job installs dependencies, builds the website and pushes it to `gh-pages`
15+
jobs:
16+
deploy:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-python@v5
23+
- name: Install dependencies
24+
run: |
25+
pip install -r requirements.txt
26+
27+
- name: Build the site
28+
run: |
29+
sphinx-build -nW --keep-going -b html . _build
30+
31+
# If we've pushed to main, push the book's HTML to github-pages
32+
- if: ${{ github.ref == 'refs/heads/main' }}
33+
name: Save to gh-pages
34+
uses: peaceiris/actions-gh-pages@v4
35+
with:
36+
github_token: ${{ secrets.GITHUB_TOKEN }}
37+
publish_dir: ./_build
38+
# # set it to a subfolder of the root to keep all PR previews:
39+
# destination_dir: latest
40+
# cname: website.com
41+
- if: ${{ github.ref != 'refs/heads/main' }}
42+
name: Save to gh-pages
43+
uses: peaceiris/actions-gh-pages@v4
44+
with:
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
publish_dir: ./_build
47+
# # create a version for an PR
48+
# # will be automatically deleted in case the build in on the root
49+
destination_dir: dev

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
.bash_logout
1111
.profile
1212
.DS_Store
13+
_build

conf.py

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
#
7+
# created from notes_template: https://github.com/enryH/notes_template
8+
# -- Project information -----------------------------------------------------
9+
10+
project = "Git Tutorial"
11+
copyright = "2025, DTU Biosustain, Informatics Platform, DSP"
12+
author = "Henry Webel"
13+
14+
15+
# -- General configuration ---------------------------------------------------
16+
17+
18+
extensions = [
19+
"myst_nb",
20+
# "sphinx_design", # https://sphinx-design.readthedocs.io/en/sbt-theme/
21+
# "sphinx_copybutton", # https://sphinx-copybutton.readthedocs.io/
22+
"sphinx_new_tab_link",
23+
]
24+
25+
templates_path = ["_templates"]
26+
# As we can use percent notebooks and markdowns files, we need to exclude some files
27+
# additinally to the default ones (add to the list if needed)
28+
exclude_patterns = [
29+
"_build",
30+
"Thumbs.db",
31+
".DS_Store",
32+
"**/pandoc_ipynb/inputs/*",
33+
".nox/*",
34+
'.venv/*',
35+
# "README.md",
36+
"**/.ipynb_checkpoints/*",
37+
"jupyter_execute",
38+
"conf.py",
39+
"check_recipes.py"
40+
]
41+
42+
43+
# -- Notebook related settings -----------------------------------------------
44+
45+
# add notebooks
46+
# https://myst-nb.readthedocs.io/en/latest/computation/execute.html
47+
nb_execution_mode = "auto"
48+
49+
myst_enable_extensions = ["dollarmath", "amsmath"]
50+
51+
# Plolty support through require javascript library
52+
# https://myst-nb.readthedocs.io/en/latest/render/interactive.html#plotly
53+
# html_js_files = [
54+
# "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"
55+
# ]
56+
57+
# https://myst-nb.readthedocs.io/en/latest/configuration.html
58+
# Execution
59+
nb_execution_raise_on_error = True
60+
# Rendering
61+
nb_merge_streams = True
62+
63+
# https://myst-nb.readthedocs.io/en/latest/authoring/custom-formats.html#write-custom-formats
64+
nb_custom_formats = {
65+
# ".py": ["jupytext.reads", {"fmt": "py:percent"}]
66+
}
67+
68+
69+
# -- Options for HTML output -------------------------------------------------
70+
71+
# 2. Select a tempalate
72+
# ! you might need additional dependencies in requirements.txt
73+
# browse available themes: https://sphinx-themes.org/
74+
75+
76+
# The theme to use for HTML and HTML Help pages. See the documentation for
77+
# a list of builtin themes.
78+
# See:
79+
# https://github.com/executablebooks/MyST-NB/blob/master/docs/conf.py
80+
# html_title = ""
81+
html_theme = "sphinx_book_theme"
82+
# html_theme = "sphinx_book_theme" # alternative
83+
# html_logo = "_static/logo-wide.svg"
84+
# html_favicon = "_static/logo-square.svg"
85+
html_theme_options = {
86+
"github_url": "https://github.com/biosustain/git-tutorial",
87+
"repository_url": "https://github.com/biosustain/git-tutorial",
88+
# "repository_branch": "main",
89+
# "home_page_in_toc": True,
90+
# "path_to_docs": "docs",
91+
"show_navbar_depth": 1,
92+
# "use_edit_page_button": True,
93+
"use_repository_button": True,
94+
"use_download_button": True,
95+
"launch_buttons": {
96+
"colab_url": "https://colab.research.google.com"
97+
# "binderhub_url": "https://mybinder.org",
98+
# "notebook_interface": "jupyterlab",
99+
},
100+
"navigation_with_keys": False,
101+
}
102+
# Add any paths that contain custom static files (such as style sheets) here,
103+
# relative to this directory. They are copied after the builtin static files,
104+
# so a file named "default.css" will overwrite the builtin "default.css".
105+
# html_static_path = ['_static']

index.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
```{include} README.md
2+
```
3+
4+
5+
```{toctree}
6+
:maxdepth: 1
7+
:hidden:
8+
9+
instructions_251105
10+
instructions_241113
11+
12+
13+
```

instructions_251105.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Workshop on the 5th of November 2025
2+
3+
> to be continued.

requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sphinx
2+
sphinx-book-theme
3+
myst-nb
4+
ipywidgets
5+
sphinx-new-tab-link!=0.2.2
6+
jupytext

0 commit comments

Comments
 (0)