Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
#21514 : sage-rst2ipynb script
Browse files Browse the repository at this point in the history
  • Loading branch information
Thierry Monteil committed Nov 24, 2016
1 parent d5d5680 commit 4e3c1fd
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/bin/sage-rst2ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

fail () {
echo "ERROR: ${1}" 1>&2
exit 1
}

# tests if dependencies are available
pandoc -v > /dev/null 2>&1 || fail 'You should install pandoc on your system.'
[ $(sage-list-packages installed | grep '^rst2ipynb\.\.\.') ] || fail \
'You should install the rst2ipynb optional package.'

case "${#}" in
(1)
rst2ipynb --kernel='sagemath' ${1} ;;
(2)
rst2ipynb --kernel='sagemath' ${1} -o ${2} ;;
(*)
fail 'You should provide one or two file names.' ;;
esac

exit 0

0 comments on commit 4e3c1fd

Please sign in to comment.