How can I display contents of bash script with syntax highlighting in iPython notebook?
My workflow usually consists of calling different bash scripts, and I would like to document the source code for these scripts in my notebook. My current solution is to make a bash cell and cat
the script to have its contents display in the cell output. However, the script is not formatted and this is a bit cumbersome as well.
Example:
Code cell:
%%bash
cat myScript.sh
Output:
#! /bin/bash
for i in {1..3}; do [ "$i" == "2" ] && echo "This is my bash script"; done
Desired output (with syntax highlighting):
#! /bin/bash
for i in {1..3}; do [ "$i" == "2" ] && echo "This is my bash script"; done