addjs.sh (385B)
1 #!/usr/bin/env bash 2 if ! command -v vim; then 3 echo "Don't know how to do this without vim yet." 4 exit 1 5 elif [ $# -ne 1 ]; then 6 echo "Need to pass the file as argument." 7 exit 1 8 fi 9 10 vim -c 'v/<head> <script/ s#<head>#<head> <script type="text/javascript" async src="https://cdn.jsdelivr.net/gh/mathjax/MathJax@2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>' -c 'wq' $1