Skip to content

Commit

Permalink
Restructure and add build script for generating class material
Browse files Browse the repository at this point in the history
  • Loading branch information
benhylau committed Apr 12, 2018
1 parent a14d087 commit 67fe23b
Show file tree
Hide file tree
Showing 44 changed files with 72 additions and 28 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Generated asset directory
output

# GitBook
_book
book.pdf
book.epub
book.mobi
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ Participants will be expected to bring their own laptop.

## Module Topics

1. [What is mesh?](./module-1.md)
1. [Setting up your first node](./module-2.md)
1. [Building nodes (hardware)](./module-3.md)
1. [Planning a network](./module-4.md)
1. [Measuring networks](./module-5.md)
1. [Living on a decentralized network](./module-6.md)
1. [What is mesh?](./module-1/README.md)
1. [Setting up your first node](./module-2/README.md)
1. [Building nodes (hardware)](./module-3/README.md)
1. [Planning a network](./module-4/README.md)
1. [Measuring networks](./module-5/README.md)
1. [Living on a decentralized network](./module-6/README.md)

## Learning Outcomes

Expand All @@ -34,7 +34,7 @@ Participants will be expected to bring their own laptop.

- TPL will provide Raspberry Pi 2s and 3s
- Participants will bring their own laptop
- Participants will receive primer information via a [welcome email](./organization/welcome-email.txt), which includes [laptop setup instructions](./SETUP.md), a Linux shell primer, and a [pre-workshop survey](./organization/pre-workshop-survey.md)
- Participants will receive primer information via a [welcome email](./general/welcome-email.txt), which includes [laptop setup instructions](./SETUP.md), a Linux shell primer, and a [pre-workshop survey](./general/pre-workshop-survey.md)
- Participants are comfortable using a computer before, with no assumptions about prior programming or networking knowledge

## Facilitation Guidelines
Expand Down
57 changes: 57 additions & 0 deletions build
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env bash

# Check for required tools
echo "Checking for markdown-pdf node module"
npm -g list markdown-pdf
S=$?
if [ $S -ne 0 ]; then
echo "markdown-pdf is missing, install by running:"
echo " npm install -g markdown-pdf"
return $S
fi

echo "Checking for gitbook-cli node module"
npm -g list gitbook-cli
S=$?
if [ $S -ne 0 ]; then
echo "gitbook-cli is missing, install by running:"
echo " npm install -g gitbook-cli"
return $S
fi

# Delete generated assets
rm -rf output
mkdir output

# Get absolute path to pdf.css
basedir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
css="$basedir/pdf.css"
echo "Using CSS styles from $css"

# Go through each module
for mod in module-*; do
# Generate lesson plans .pdf
doc="$mod/README.md"
if [ -f $doc ]; then
out="output/$mod.pdf"
echo "Generating lesson plan from $doc to $out"
markdown-pdf "$doc" --out "$out" --cwd "$mod" --css-path pdf.css
fi

# Generate worksheets as .pdf
for doc in $mod/worksheet/*.md; do
if [ -f $doc ]; then
out="output/$(echo "$doc" | sed 's|/|-|g' | sed 's|.md|.pdf|')"
echo "Generating worksheet from $doc to $out"
markdown-pdf "$doc" --out "$out" --cwd "$mod/worksheet" --css-path pdf.css
fi
done

# Generate presentation GitBooks
book="$mod/presentation"
if [ -d $book ]; then
out="output/$(echo "$book" | sed 's|/|-|g')"
echo "Generating presentation from $book to $out"
gitbook build "$book" "$out"
fi
done
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions materials/module-1/presentation/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions materials/module-1/presentation/serve-presentation

This file was deleted.

1 change: 0 additions & 1 deletion materials/module-1/worksheets/.gitignore

This file was deleted.

12 changes: 0 additions & 12 deletions materials/module-1/worksheets/generate-pdf

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 67fe23b

Please sign in to comment.