Geen omschrijving
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

generate_docs.sh 911B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. cd "$(dirname "$0")"
  3. echo "Generating plots"
  4. rm -rf src/plot
  5. ../hardware/generate_plot.sh
  6. cp -r ../hardware/plot src
  7. echo "Generating plot includes"
  8. rm -rf src/inc_dispensy_sch.md
  9. for f in src/plot/dispensy_sch.svg/*.svg; do
  10. file=`echo $f | sed 's:src/:./:g'`
  11. name=`echo $f | sed 's:src/plot/dispensy_sch.svg/::g' | sed 's:.svg::g'`
  12. echo "<h2>$name</h2>" >> src/inc_dispensy_sch.md
  13. echo "<div style=\"background-color: white;\">" >> src/inc_dispensy_sch.md
  14. echo "<a href=\"$file\">" >> src/inc_dispensy_sch.md
  15. echo "<img src=\"$file\" alt=\"Main-Board PCB layout as SVG\">" >> src/inc_dispensy_sch.md
  16. echo "</a></div>" >> src/inc_dispensy_sch.md
  17. echo >> src/inc_dispensy_sch.md
  18. done
  19. echo "Generating docs"
  20. if [ "$1" = "serve" ] ; then
  21. mdbook serve --open
  22. elif [ "$1" = "build" ] ; then
  23. mdbook build
  24. else
  25. echo "Invalid command. 'build' or 'serve'."
  26. fi