https://github.com/netways/training-global
NETWAYS Training Global Templates
https://github.com/netways/training-global
training
Last synced: 2 months ago
JSON representation
NETWAYS Training Global Templates
- Host: GitHub
- URL: https://github.com/netways/training-global
- Owner: NETWAYS
- Created: 2018-07-11T07:31:05.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-16T10:28:20.000Z (9 months ago)
- Last Synced: 2025-03-27T22:11:31.296Z (3 months ago)
- Topics: training
- Language: CSS
- Homepage: https://www.netways.de/trainings/
- Size: 45.3 MB
- Stars: 2
- Watchers: 8
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NETWAYS Training global artifacts
This repository holds global artifacts for a specific NETWAYS training. For example, layouts, templates and images
resides here.## How to use
### 1. Add global resource directory to your project
The global resource dir is introduced by using git subtree mechanism. This keeps the training repository clear from
special git instructions and let users easily clone and use the repository. In addition, the external code (global) can
be patched locally if needed and pinned to a specific version.#### Add a new remote to git
```bash
$ git remote add global https://github.com/NETWAYS/training-global.git
$ git fetch global
remote: Counting objects: 157, done.
remote: Compressing objects: 100% (122/122), done.
remote: Total 157 (delta 24), reused 154 (delta 21), pack-reused 0
Receiving objects: 100% (157/157), 27.82 MiB | 913.00 KiB/s, done.
Resolving deltas: 100% (24/24), done.
From https://github.com/NETWAYS/training-global
* [new branch] master -> global/master
```#### Create a new subtree named global
```bash
$ git subtree add --squash --prefix=global/ global master
git fetch global master
From https://github.com/NETWAYS/training-global
* branch master -> FETCH_HEAD
Added dir 'global'
```### 2. Create a directory to provide trainer introduction
This is probably easy but we want to achieve that changes in this directory does not influence the source code from our
training.```bash
$ mkdir trainer
$ touch trainer/.keep
$ echo 'trainer/' >> .gitignore
$ git add -f trainer/ # Force add to git because it is in .gitignore
$ git commit -m "Add directory for trainer introduction"
```After this step you are able to copy files into the directory which are not captured by the git commit staging process.
### 3. Link stylesheet to root level
```bash
$ ln -s global/layouts/netways.css
```This step seems ugly and we totally agree with you. In order to print and convert the training slides into pdf, this
step is absolutely needed to succeed.### 4. Create a showoff.json stub file
```json
{
"name": "My awesome training",
"subtitle": "Train awesome stuff",
"author": "Colt Seavers & Howie Munson",
"release": "0.9.0","favicon": "global/favicon.ico",
"protected": ["presenter", "onepage", "print"],
"user": "netways",
"password": "awesome","templates" : {
"default": "global/layouts/netways.tpl"
},"sections": [
{"section": "global/pre/netways/title"},
{"section": "global/pre/toc"},
{"section": "trainer"},
{"section": "global/pre/netways/about"},
{"section": "global/pre/hints"},{"section": "sections/..."},
{"section": "global/post"}
]
}
```After the file is created you're able to start the slide deck (showoff):
```bash
$ showoff serve
```## Update global directory from GitHub
```bash
$ git fetch global
$ git subtree pull --squash --prefix=global/ global master
```Please make sure that no changed files present or staged commits pending.
## Using a Containers to build and serve the slide deck
### Building the Image
```bash
make image
make image RUNTIME=podman
```### Run showoff
```bash
docker run -it --rm -v "$PWD:/training" -p "9090:9090" netways/showoff:0.20.4
```### Build static html files
```bash
docker run -it --rm -v "$PWD:/training" netways/showoff:0.20.4 \
showoff static print
```### Create PDF from static html files
```bash
docker run -it --rm -v "$PWD:/training" \
netways/showoff:0.20.4 \
wkhtmltopdf -s A5 --print-media-type \
--footer-left \[page\] --footer-right '© NETWAYS' \
static/index.html test.pdf
```### NETWAYS Training Wizard
Alternatively you can simply run the NETWAYS training wizard:
```
$ ./global/wizard.sh
###########################
NETWAYS Training Wizard
############################## LAYOUT ###
[1] NETWAYS
[2] OSMC
[3] OSDC
[4] OSBConfWhich Layout? [1-4] (Default: 1):
### MODE ###
[1] serve
[2] printWhich mode? [1-2] (Default: 1): 2
### PRINT ###
[1] Handouts
[2] Handouts & Solutions
[3] Handouts & Exercises & Solutions
[4] Exercises & SolutionsWhat to print? [1-4] (Default: 2): 1
Which version? (Default: 0.0.1):
```