Skip to content

Commit b473389

Browse files
committed
Add release script for built assets
1 parent 67fe23b commit b473389

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Generated asset directory
22
output
3+
publish
34

45
# GitBook
56
_book

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Building the Peer-to-Peer Internet
22

3+
[![GitHub release](https://img.shields.io/github/release/qubyte/rubidium.svg)](https://github.com/tomeshnet/p2p-internet-workshop/releases)
4+
35
**Workshop Series** _by Toronto Mesh_, [tomesh.net/peer-to-peer-internet](https://tomesh.net/peer-to-peer-internet/)
46

57
## Description
@@ -58,6 +60,14 @@ Participants will be expected to bring their own laptop.
5860
- Engage students and equip them with necessary knowledge to continue involvement in local mesh community efforts
5961
- Publish this as open-source syllabus that other communities can adopt to kick-start a mesh community
6062

63+
### Workshop Materials
64+
65+
Workshop materials such as lesson plans and worksheets are written as simple [Markdown](https://en.wikipedia.org/wiki/Markdown) files. Each presentation slide deck is created as a Markdown-based [GitBook](https://www.gitbook.com). All generated assets are published to [GitHub Releases for download](https://github.com/tomeshnet/p2p-internet-workshop/releases).
66+
67+
If you want to generate these assets yourself, simply run `./build` and you will find the generated assets in the `output` folder. The `./release` script is used to zip up the generated assets into archives convenient for publishing, which is the form you will find in the GitHub Releases.
68+
69+
When using the GitBook presentations at a workshop, it is most convenient to clone this repository, navigate to the appropriate presentation directory of the module, and serve the gitbook locally by running `gitbook serve`, then navigate to [localhost:4000](http://localhost:4000) from your browser to see the slides.
70+
6171
### Credits
6272

6373
- [@benhylau](https://github.com/benhylau)

build

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ basedir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
2828
css="$basedir/pdf.css"
2929
echo "Using CSS styles from $css"
3030

31+
# Generate general assets
32+
for doc in general/*.md; do
33+
if [ -f $doc ]; then
34+
out="output/$(echo "$doc" | sed 's|/|-|g' | sed 's|.md|.pdf|')"
35+
echo "Generating document from $doc to $out"
36+
markdown-pdf "$doc" --out "$out" --cwd general --css-path pdf.css
37+
fi
38+
done
39+
3140
# Go through each module
3241
for mod in module-*; do
3342
# Generate lesson plans .pdf

release

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Package assets for release
4+
#
5+
6+
RELEASE_VERSION=0.1
7+
8+
./build
9+
10+
# Create directory for release assets ready to be published
11+
rm -rf publish
12+
mkdir publish
13+
14+
# Package assets in tar.gz and zip formats
15+
tar --create --gzip -f "publish/workshop-materials-${RELEASE_VERSION}.tar.gz" -C output .
16+
cd output; zip --recurse-paths "../publish/workshop-materials-${RELEASE_VERSION}.zip" .; cd ..

0 commit comments

Comments
 (0)