Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.vagrant
stats
*.pdf
vm/*.ova
vm/mnt
trainer/
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,11 @@ Requirements:
* Docker
* https://nws.netways.de GitLab instances for the trainer and participants

### Start Showoff in Docker
To run the presentation you will need [showoff 0.19.x](https://rubygems.org/gems/showoff/versions/0.19.6).
After installing it simply run `showoff serve` to get presenter mode with additional notes
and display window to present to your students.

```
./start.sh
```

### Print Static Content

For GitHub.

```
./print.sh
```
More instructions [here](https://github.com/NETWAYS/training-global#using-docker-to-build-and-serve-the-slide-deck).

### Environment

Expand Down
1 change: 1 addition & 0 deletions global/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
static
stats
trainer
21 changes: 15 additions & 6 deletions Dockerfile → global/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM ubuntu:xenial
FROM ubuntu:bionic
LABEL maintainer="support@netways.de"

ARG TEMP_DIR=/tmp

WORKDIR /training

# basic showoff and patched wkhtmltopdf dependencies
RUN apt-get update \
&& apt-get install -y \
&& apt-get install -y -q \
build-essential \
wget \
markdown \
Expand All @@ -20,19 +23,25 @@ RUN apt-get update \
libxext-dev \
libfontconfig1-dev \
libfreetype6-dev \
fontconfig
fontconfig \
&& apt-get clean \
&& rm -r /var/lib/apt/lists/*

# RUN rm -f /etc/alternatives/ruby \
# && ln -s /usr/bin/ruby1.9.3 /etc/alternatives/ruby \
# && rm -f /etc/alternatives/gem \
# && ln -s /usr/bin/gem1.9.3 /etc/alternatives/gem

# wkhtmltopdf needs a patched QT version
RUN cd $HOME \
RUN cd $TEMP_DIR \
&& wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz \
&& tar vxf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz \
&& cp wkhtmltox/bin/wk* /usr/local/bin/
&& cp wkhtmltox/bin/wk* /usr/local/bin/ \
&& rm -rf $TEMP_DIR/wkhtml*

RUN gem install showoff --version=0.19.6

CMD "/bin/bash"
EXPOSE 9090

CMD ["showoff", "serve"]

4 changes: 0 additions & 4 deletions global/Post/01_Feedback.md

This file was deleted.

4 changes: 0 additions & 4 deletions global/Post/02_Thanks.md

This file was deleted.

13 changes: 0 additions & 13 deletions global/Post/03_Contributing.md

This file was deleted.

17 changes: 0 additions & 17 deletions global/Pre/Title/01_Title.md

This file was deleted.

168 changes: 168 additions & 0 deletions global/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# NETWAYS Training global artefacts

This repository holds global artefacts 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": "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 docker to build and serve the slide deck

### Run showoff

```bash
$ docker run -it --rm -v "$PWD:/training" -p "9090:9090" \
netways/showoff:0.19.6 \
showoff serve
```

### Build static html files

```bash
$ docker run -it --rm -v "$PWD:/training" \
netways/showoff:0.19.6 \
showoff static print
```

### Create PDF from static html files

```bash
$ docker run -it --rm -v "$PWD:/training" \
netways/showoff:0.19.6 \
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] OSBConf

Which Layout? [1-4] (Default: 1):

### MODE ###

Which mode? [serve/print] (Default: serve): print

### PRINT ###

[1] Handouts
[2] Handouts & Solutions
[3] Handouts & Exercises & Solutions
[4] Exercises & Solutions

What to print? [1-4] (Default: 2):
Which version? (Default: 2.1.1):
```
Empty file added global/_files/share/test
Empty file.
Binary file added global/_preshow/training_slider_de_600x366.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added global/_preshow/training_slider_en_600x366.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions global/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "3"

services:
showoff:
build: .
image: netways/showoff:0.19.6
ports:
- "9090:9090"
volumes:
- "$PWD:/training"
environment:
- "LANG=C.UTF-8"
- "LANGUAGE=C.UTF-8"
- "LC_ALL=C.UTF-8"

Loading