<commit_before>#!/usr/bin/env sh

# FIXME: find all revealjs markdown files and run pandoc on them like this

BUILD_DIR=`pwd`

BLOG="$BUILD_DIR/../hobson.github.io"
IPYNB="$BUILD_DIR/../hack-university-machine-learning/huml"

rsync -avz "$BLOG/images" "$BUILD_DIR/images"

# uncomment these to "rsync" images folders
# rm -rf "$BUILD_DIR/images/"
# mkdir -p "$BUILD_DIR/images/"
# # this seemed to break the github builder
# cp -rf "$BUILD_DIR/../hobson.github.io/images" "$BUILD_DIR/"

# cp -f "$BUILD_DIR/../hobson.github.io/images/"* "$BUILD_DIR/images/"
# cp -f `pwd`/../hobson.github.io/images/*.png `pwd`/images/
# cp -f `pwd`/../hobson.github.io/images/*.svg `pwd`/images/
# cp -f `pwd`/../hobson.github.io/images/*.gif `pwd`/images/

if [ -z "$1" ]; then
    PRESENTATION=2015-10-27-Hacking-Oregon-Hidden-Political-Connections
else
    PRESENTATION="$1"
fi
MARKDOWN="$BUILD_DIR/../hobson.github.io/_posts/${PRESENTATION}.md"

# if [ - "$MARKDOWN" ]
HTML="$BUILD_DIR/${PRESENTATION}.html"


pandoc -t revealjs --mathjax --template="$BUILD_DIR/pandoc-template-for-revealjs.html" -V theme=moon -s "$MARKDOWN" -o "$HTML"
sed -i -e 's/src\=\"\/images/src="\/talks\/images/g' "$HTML"

git add *.html
git add images/
git add notebooks/*.ipynb
git commit -am "auto-commit new build  $(date)"
git push tg
git push origin

git checkout master
git merge gh-pages
git push tg
git push origin

git checkout gh-pages
git merge master
git push tg
git push origin

cd "$BLOG"
git add _posts
git commit -am 'update blog post to reflect slides'
git push
cd "$BUILD_DIR"

cd "$IPYNB"
git add .
git commit -am 'update ipython notebooks and data to reflect talk slides'
git push
cd "$BUILD_DIR"<commit_msg>auto-commit new build  Sun Feb 14 09:39:51 PST 2016<commit_after>#!/usr/bin/env sh

# FIXME: find all revealjs markdown files and run pandoc on them like this

BUILD_DIR=`pwd`
BLOG="$BUILD_DIR/../hobson.github.io"
IPYNB="$BUILD_DIR/../hack-university-machine-learning/huml"
SLIDES_MD="$BUILD_DIR/../hack-university-machine-learning/docs/slides"
POSTS_MD="$BUILD_DIR/../hobson.github.io/_posts"

cp -f "$SLIDES_MD/*.md" "$POSTS_MD"
rsync -avz "$BLOG/images" "$BUILD_DIR/images"

# uncomment these to "rsync" images folders
# rm -rf "$BUILD_DIR/images/"
# mkdir -p "$BUILD_DIR/images/"
# # this seemed to break the github builder
# cp -rf "$BUILD_DIR/../hobson.github.io/images" "$BUILD_DIR/"

# cp -f "$BUILD_DIR/../hobson.github.io/images/"* "$BUILD_DIR/images/"
# cp -f `pwd`/../hobson.github.io/images/*.png `pwd`/images/
# cp -f `pwd`/../hobson.github.io/images/*.svg `pwd`/images/
# cp -f `pwd`/../hobson.github.io/images/*.gif `pwd`/images/

if [ -z "$1" ]; then
    echo "USAGE: build.sh filename.md"
    PRESENTATION=2015-10-27-Hacking-Oregon-Hidden-Political-Connections
else
    PRESENTATION="$1"
fi
MARKDOWN="$POSTS_MD/${PRESENTATION}.md"

# if [ - "$MARKDOWN" ]
HTML="$BUILD_DIR/${PRESENTATION}.html"


pandoc -t revealjs --mathjax --template="$BUILD_DIR/pandoc-template-for-revealjs.html" -V theme=moon -s "$MARKDOWN" -o "$HTML"
sed -i -e 's/src\=\"\/images/src="\/talks\/images/g' "$HTML"
echo "[${PRESENTATION}](http://totalgood.github.io/talks/${PRESENTATION}.html)" >> "$SLIDES_MD/../slides.md"

git add *.html
git add images/
git add notebooks/*.ipynb
git commit -am "auto-commit new build  $(date)"
git push tg
git push origin

git checkout master
git merge gh-pages
git push tg
git push origin

git checkout gh-pages
git merge master
git push tg
git push origin

cd "$BLOG"
git add _posts
git commit -am 'update blog post to reflect slides'
git push
cd "$BUILD_DIR"

cd "$IPYNB"
git add .
git commit -am 'update ipython notebooks and data to reflect talk slides'
git push
cd "$BUILD_DIR"


{'fraction_non_alphanumeric': 0.17049446095649826, 'fraction_numerical': 0.008646311807619562, 'mean_word_length': 3.858267716535433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4271605', 'n_tokens_mistral': 1457, 'n_tokens_neox': 1405, 'n_words': 366}