2014-09-26 10:05:41 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-09-26 10:37:28 -07:00
|
|
|
filename=Manual
|
2015-01-05 07:58:27 -08:00
|
|
|
doc_files=(
|
2015-04-03 07:02:12 -07:00
|
|
|
'Introduction.md'
|
2015-08-03 04:54:51 -07:00
|
|
|
'Getting Started.md'
|
2015-04-03 07:02:12 -07:00
|
|
|
'Safety.md'
|
|
|
|
'Installation.md'
|
|
|
|
'Configuration.md'
|
|
|
|
'Cli.md'
|
|
|
|
'Serial.md'
|
2014-09-26 11:07:31 -07:00
|
|
|
'Rx.md'
|
2015-01-05 07:58:27 -08:00
|
|
|
'Spektrum bind.md'
|
2014-09-26 11:07:31 -07:00
|
|
|
'Failsafe.md'
|
|
|
|
'Battery.md'
|
|
|
|
'Gps.md'
|
|
|
|
'Rssi.md'
|
|
|
|
'Telemetry.md'
|
|
|
|
'LedStrip.md'
|
|
|
|
'Display.md'
|
2015-04-03 07:02:12 -07:00
|
|
|
'Buzzer.md'
|
2014-09-26 11:07:31 -07:00
|
|
|
'Sonar.md'
|
2015-01-05 07:58:27 -08:00
|
|
|
'Profiles.md'
|
2015-04-03 07:02:12 -07:00
|
|
|
'Modes.md'
|
|
|
|
'Inflight Adjustments.md'
|
|
|
|
'Controls.md'
|
2014-09-26 11:07:31 -07:00
|
|
|
'Autotune.md'
|
2015-01-06 14:17:49 -08:00
|
|
|
'Blackbox.md'
|
2015-01-07 09:37:24 -08:00
|
|
|
'Migrating from baseflight.md'
|
2015-01-16 03:32:59 -08:00
|
|
|
'Boards.md'
|
2016-01-27 00:40:58 -08:00
|
|
|
'Board - AlienFlight.md'
|
2015-04-03 07:02:12 -07:00
|
|
|
'Board - CC3D.md'
|
|
|
|
'Board - CJMCU.md'
|
|
|
|
'Board - Naze32.md'
|
|
|
|
'Board - Sparky.md'
|
|
|
|
'Board - Olimexino.md'
|
|
|
|
'Board - ChebuzzF3.md'
|
2015-01-07 09:37:24 -08:00
|
|
|
)
|
2014-09-26 11:07:31 -07:00
|
|
|
|
2014-09-26 10:05:41 -07:00
|
|
|
if which gimli >/dev/null; then
|
2014-09-26 10:37:28 -07:00
|
|
|
echo "Building ${filename}.pdf"
|
|
|
|
pushd . >/dev/null
|
|
|
|
cd docs
|
2015-07-10 10:52:47 -07:00
|
|
|
|
2014-09-26 11:07:31 -07:00
|
|
|
rm -f ${filename}.md
|
|
|
|
for i in "${doc_files[@]}"
|
|
|
|
do
|
|
|
|
cat "$i" >> ${filename}.md
|
|
|
|
done
|
2014-09-26 10:37:28 -07:00
|
|
|
rm -f ${filename}.pdf
|
2015-07-19 12:48:53 -07:00
|
|
|
gimli -f ${filename}.md -stylesheet override.css \
|
|
|
|
-w '--toc --title "Cleanflight Manual" --footer-right "[page]" --toc-depth 1'
|
2015-07-10 10:52:47 -07:00
|
|
|
rm ${filename}.md
|
2014-09-26 10:37:28 -07:00
|
|
|
popd >/dev/null
|
2014-09-26 10:05:41 -07:00
|
|
|
else
|
2014-09-26 11:14:47 -07:00
|
|
|
echo -e "\nFAILED"
|
2014-09-26 10:05:41 -07:00
|
|
|
echo "Install Gimli to build the PDF documentation"
|
|
|
|
echo -e "https://github.com/walle/gimli\n"
|
|
|
|
exit 1
|
|
|
|
fi
|