Skip to content

Commit db2033f

Browse files
authored
Initial commit
0 parents  commit db2033f

25 files changed

Lines changed: 1741 additions & 0 deletions

.github/workflows/pages.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy static content to Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["main", ]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Single deploy job since we're just deploying
26+
deploy:
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v3
34+
- uses: actions/setup-python@v4
35+
with:
36+
python-version: '3.11'
37+
cache: 'pip' # caching pip dependencies
38+
- run: pip install -r requirements.txt
39+
- name: Spinx build pages
40+
run: |
41+
sphinx-build -b html source docs/html -E -A build="pages"
42+
- name: Spinx build slides
43+
run: |
44+
sphinx-build -b html source docs/html/slides -E -A build="slides"
45+
- name: Setup Pages
46+
uses: actions/configure-pages@v3
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@v2
49+
with:
50+
path: 'docs/html'
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v2

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.swp
2+
*.swo
3+
docs/
4+
*.nix
5+
venv/

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# 1.1.1
2+
[diff](https://github.com/t4d-gmbh/web-course-template/compare/1.1.0...1.1.1)
3+
4+
> 2024-10-10
5+
6+
* some minor 🐞 bug fixes
7+
8+
# 1.1.0
9+
[diff](https://github.com/t4d-gmbh/web-course-template/compare/1.0.0...1.1.0)
10+
11+
> 2024-10-10
12+
13+
* Condensed config ([#3](https://github.com/t4d-gmbh/web-course-template/issues/3))
14+
15+
# 1.0.0
16+
[diff](https://github.com/t4d-gmbh/web-course-template/releases/tag/1.0.0)
17+
18+
> 2024-10-09
19+
20+
* Initial release

CONTRIBUTING.md

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# Contributing to <img src="./source/_static/T4D_logo_bw.svg" alt="T4D" width="20" height="20">'s `Web Course Template` 📚
2+
3+
Thank you for your interest in contributing to this template!
4+
5+
We appreciate your help in improving this template.
6+
Please follow the guidelines below to ensure a smooth contribution process.
7+
8+
## General Guidelines 📝
9+
10+
- **Be Respectful**: Treat all contributors with respect and kindness.
11+
We are all here to learn and improve.
12+
- **Read the existing documentation**: Familiarize yourself with the existing content before making changes.
13+
This will also help you understand the structure and style.
14+
- **Use Clear Language**: Aim for clarity and conciseness in your writing.
15+
Avoid jargon unless you are using terms that are generally understood.
16+
17+
## Setting Up Your Environment ⚙️
18+
19+
To contribute to this course, you'll need to set up your build environment 🏗️.
20+
21+
Follow these steps:
22+
23+
1. **Clone the Repository**:
24+
```
25+
git clone https://github.com/t4d-gmbh/web-course-template
26+
cd web-course-template
27+
```
28+
29+
2. **Install Dependencies**:
30+
Make sure you have Sphinx installed.
31+
You can install it, along with all ohter dependencies using pip:
32+
```bash
33+
pip install -r requirements.txt
34+
```
35+
36+
3. **Build&view the content**
37+
To build the content locally, run:
38+
```
39+
sphinx-build -b html source docs/html -E -A build="pages"
40+
sphinx-build -b html source docs/html/slides -E -A build="slides"
41+
```
42+
This will generate the HTML documentation in the `docs/html` directory.
43+
44+
The first command will build the static html pages and the second command builds the slides 🖼️.
45+
46+
To browse the html pages locally, open `docs/html/index.html` in your favorite browser.
47+
For the slides, open `docs/html/slides/index.html`
48+
49+
⚠️ Note ⚠️: The links to switch from the html pages view to the slides view are broken when locally
50+
viewing the files.
51+
52+
## Implementing Changes 🛠️
53+
54+
The content is situated under `source/content` and split up into topical sub-folders.
55+
Each sub-folder should contain an `index.md` that determines which `*.md` files to include.
56+
The content from the sub-folder is then included in the main content by including its `index.md`
57+
file in the `toctree` of [`source/index.md`](./source/index.md):
58+
59+
# source/index.md
60+
...
61+
```{toctree}
62+
...
63+
content/<sub-folder>/index
64+
```
65+
66+
### Slide vs. Page Content
67+
68+
The content is rendered both as slides and as html pages.
69+
Typically, slides should contain illustrations and bullet-point like text snippets while the
70+
pages should be somewhat more self-contained.
71+
72+
Since we do not wont to duplicate content we can create markdown files that can be rendered both
73+
as slides and included into the static view of html pages.
74+
To achieve this we render all the markdown content with `jinja` before converting it to `html` and
75+
pass a `build` context variable along that is either set to `"slides"` or `"pages"`.
76+
77+
Following this procedure we then setup the `index.md` file in each sub(-sub)-folder as follows:
78+
79+
80+
{% if build == "slides" %}
81+
<!-- BUILDING THE SLIDES -->
82+
```{toctree}
83+
:maxdepth: 2
84+
:caption: Contents
85+
86+
./slide1
87+
./slide2
88+
...
89+
```
90+
{% else %}
91+
<!-- BUILDING THE PAGES -->
92+
```{include} ./slide1.md
93+
```
94+
Maybe some extra text for the pages
95+
```{include} ./slide2.md
96+
```
97+
{% endif %}
98+
99+
This will render each slide on a separate page for the slides and build a document
100+
that includes the slides for the html page.
101+
Note that we also adapt the styling of the page depending on the value of the `build`
102+
context variable.
103+
104+
Within each included or imported `.md` file you can also specify what content you want
105+
to show in the slides and what should be shown in the page view.
106+
You can use:
107+
108+
- `{% if builds == 'pages' %}...{% endif %}` or `{% if page %}...{% endif %}` to include
109+
content only in the static page
110+
- `{% if builds == 'slides' %}...{% endif %}` or `{% if slide %}...{% endif %}` to include
111+
content only in the slide
112+
113+
The above `slide1.md` could look as follows:
114+
115+
{% if build == "slides" %}
116+
# Slide 1 title
117+
{% else %}
118+
## Subtitle for slide 1 content
119+
{% endif %}
120+
121+
**This text is both on the slide and in the pages
122+
{% if slide %}
123+
🤪 This in only on the slide 🤪
124+
{% endif %}
125+
126+
{% if page %}
127+
This text is only in the pages view and not on the slide
128+
{% endif %}
129+
130+
131+
## Making Contributions ✨
132+
133+
Here are some ways you can contribute:
134+
135+
- **Fixing Typos**: Simple fixes like correcting typos or grammatical errors are always welcome!
136+
- **Improving Clarity**: If you find sections that are unclear, feel free to rewrite them for better understanding.
137+
- **Adding Examples**: Examples can greatly enhance the documentation. If you have a use case, consider adding it.
138+
- **Suggest Additions**: If you think that the course is missing come curcial aspects, let us know by [creating an Issue](https://github.com/t4d-gmbh/working-with-git/issues/new).
139+
140+
## Submitting Changes 🚀
141+
142+
Once you have made your changes, follow these steps to submit them:
143+
144+
1. **Create a New Branch**:
145+
```
146+
git checkout -b my-feature-branch
147+
```
148+
149+
2. **Commit Your Changes**:
150+
Make sure to write clear and descriptive commit messages:
151+
```
152+
git commit -m "Fix typo in about git section"
153+
```
154+
155+
3. **Push to Your Fork**:
156+
```
157+
git push origin my-feature-branch
158+
```
159+
160+
4. **Open a Pull Request**:
161+
Go to the original repository on GitHub and open a pull request.
162+
Provide a clear description of your changes and why they are needed.
163+
164+
## Additional Resources 🌐
165+
166+
- [Sphinx Documentation](https://www.sphinx-doc.org/en/master/)
167+
- [Markdown Guide](https://www.markdownguide.org/)
168+
- [GitHub Flow](https://guides.github.com/introduction/flow/)
169+
170+
Thank you for contributing!
171+
Your efforts help make our documentation better for everyone. If you have any questions, feel free to reach out to the maintainers.
172+

0 commit comments

Comments
 (0)