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