Skip to content

Commit 345bde3

Browse files
committed
DesignSafe training template
1 parent 73d689d commit 345bde3

1 file changed

Lines changed: 106 additions & 18 deletions

File tree

README.md

Lines changed: 106 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,118 @@
1-
# Training Template
1+
# Jupyter Book Training Template
22

3-
> Krishna Kumar, UT Austin
3+
[![GitHub Pages](https://img.shields.io/badge/GitHub-Pages-blue?logo=github)](https://img.shields.io/badge/GitHub-Pages-blue?logo=github)
4+
[![Jupyter Book](https://img.shields.io/badge/Powered%20by-Jupyter%20Book-orange)](https://jupyterbook.org)
45

5-
- Template for DesignSafe training built using [Jupyter Book](https://jupyterbook.org/en/stable/intro.html).
6-
- Fork this [repo](https://github.com/DesignSafe-CI/training-template)
7-
- To add `Open In DesignSafe` in Jupyter Notebooks copy the jupyter notebook to Community Data and then point the URL to the folder in Community Data `https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/`
8-
- The repo will automatically build a website using GitHub pages
6+
A customizable template for creating training materials on DesignSafe using [Jupyter Book](https://jupyterbook.org/en/stable/intro.html).
97

10-
## Template edits
11-
- `_config.yml` Edit for title, author and URL
12-
- `_toc.yml` Set-up the table of contents
13-
- You can write markdown and Jupyter Notebooks and add to table of contents `_toc.yml`
8+
> Maintained by Krishna Kumar, University of Texas at Austin
149
15-
## Build locally
10+
## Features
11+
- Pre-configured Jupyter Book structure
12+
- GitHub Pages integration
13+
- DesignSafe-specific workflows
14+
- Easy content authoring with Markdown/Jupyter Notebooks
15+
- Customizable table of contents
16+
- "Open in DesignSafe" button integration
1617

18+
## Quick Start
19+
1. **Fork the Repository**
20+
[Fork original repository](https://github.com/DesignSafe-CI/training-template/fork)
21+
22+
2. **Enable GitHub Pages**
23+
Go to Settings → Pages → Set source to `gh-pages` branch
24+
25+
3. **Clone Your Fork**
26+
```bash
27+
git clone https://github.com/DesignSafe-CI/training-template.git
28+
29+
## Configuration
30+
1. Basic Settings (`_config.yml`)
31+
32+
```yaml
33+
title: "Your Training Title"
34+
author: "Your Name"
35+
url: "https://your-username.github.io/training-template"
1736
```
18-
# Create a virtual env
19-
virtualenv env
20-
source env/bin/activate
21-
# Install required packages
22-
pip3 install -r requirements.txt
23-
# Build your book
37+
38+
2. Table of Contents (`_toc.yml`)
39+
```yaml
40+
format: jb-book
41+
root: intro
42+
chapters:
43+
- file: path/to/chapter1
44+
- file: path/to/chapter2
45+
```
46+
47+
3. DesignSafe Integration
48+
49+
To add "Open in DesignSafe" buttons:
50+
51+
- Upload notebooks to `Community Data >> Training`
52+
- Update notebook URLs to:
53+
[![Try on DesignSafe](https://raw.githubusercontent.com/DesignSafe-CI/training-template/main/DesignSafe-Badge.svg)](https://jupyter.designsafe-ci.org/hub/user-redirect/lab/tree/CommunityData/Training/template/01-template-exercise.ipynb)
54+
55+
## Adding Content
56+
57+
Supported formats:
58+
59+
- 📝 Markdown (.md)
60+
61+
- 📓 Jupyter Notebooks (.ipynb)
62+
63+
- 🔄 MyST Markdown
64+
65+
### Organization tips:
66+
67+
```
68+
├── content/
69+
│ ├── intro.md
70+
│ ├── chapter1/
71+
│ │ ├── notebook.ipynb
72+
│ │ └── images/
73+
├── _toc.yml
74+
└── _config.yml
75+
```
76+
77+
## Building Locally
78+
```bash
79+
# Create and activate virtual environment
80+
python -m venv venv
81+
source venv/bin/activate # Linux/macOS
82+
# venv\Scripts\activate # Windows
83+
84+
# Install dependencies
85+
pip install -r requirements.txt
86+
87+
# Build book
2488
jupyter-book build .
2589
```
2690

27-
This will create a `_build/html` directory with all the files. Open the `index.html` file to start
91+
## Serve built content (optional)
92+
93+
> python -m http.server --directory _build/html
94+
95+
## Deployment
96+
97+
Commit changes:
98+
```bash
99+
git add .
100+
git commit -m "Update content"
101+
git push origin main
102+
```
103+
104+
GitHub Actions will automatically:
105+
106+
- Build book
107+
108+
- Deploy to GitHub Pages
109+
110+
- View at: https://<your-username>.github.io/training-template
111+
112+
113+
## License
114+
115+
BSD 3-Clause License - See [LICENSE](LICENSE.md)
28116

29117
## Jupyter example templates
30118

0 commit comments

Comments
 (0)