Skip to content

Instantly share code, notes, and snippets.

@betamax
Created June 19, 2015 10:53
Show Gist options
  • Save betamax/aba46e69f346b7e7756d to your computer and use it in GitHub Desktop.
Save betamax/aba46e69f346b7e7756d to your computer and use it in GitHub Desktop.
A script that we use at Lateral to generate our documentation
#!/bin/sh
# Which md files to compile
declare -a arr=("hybrid-recommender" "text-matching" "pre-populated-recommenders")
# Now loop through the above array
for i in "${arr[@]}"
do
# Where to store the documentation
OUTDIR=/Users/Max/Lateral/lateral.io/app/views/documentation
# Generate nav
aglio -t templates/nav-$i.jade -i $i.md --no-condense -o $OUTDIR/_${i//-/_}_nav.html.erb
# Generate docs
aglio -t templates/api-reference-$i.jade -i $i.md --no-condense -o $OUTDIR/${i//-/_}_api_reference.html.erb
# Convert blueprint to JSON format
drafter $i.md -o $i.json -f json
# Generate code samples
if [ $i != 'pre-populated-recommenders' ]; then
./apib2httpsnippets $i.json
mv $i-snippets.js /Users/Max/Lateral/lateral.io/app/assets/javascripts/lateral-io/_${i//-/_}_snippets.js
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment