convert_nb 625 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env bash
  2. # Converts all found jupyter notebooks to html and places them in the specified
  3. # output directory. This is so they can be incorportated into the doxygen docs
  4. # of the project.
  5. set -e
  6. if [ $# -lt 2 ]
  7. then
  8. echo "Usage: $0 [nbconvert-exe] [output_directory] (--update)"
  9. exit 0
  10. fi
  11. if [ "$#" -eq 3 ] && [ "$3" == "--update" ]
  12. then
  13. exec_opt="--ExecutePreprocessor.enabled=True"
  14. else
  15. exec_opt=""
  16. fi
  17. for nb_file in `find . -type f -name "*.ipynb" ! -path "*/.ipynb_checkpoints/*"`
  18. do
  19. echo "Converting file: $nb_file"
  20. $1 --to html --template full $exec_opt --output-dir $2 $nb_file
  21. done