| 1 | #!/usr/bin/env sh |
| 2 | |
| 3 | # This script makes it easy to recompile install and tryout |
| 4 | # a theme in case of any changes. It assumes the |
| 5 | # sphinx-bootstrap-theme-customizer package is in the same directory |
| 6 | # as the package, i.e one up the git toplevel. |
| 7 | |
| 8 | color5=$(tput setaf 5) |
| 9 | reset=$(tput sgr0) # reset color codes |
| 10 | |
| 11 | toplevel=$(git rev-parse --show-toplevel) |
| 12 | bootstrap=$(basename $(ls -d theme/static/bootstrap-*/)) |
| 13 | |
| 14 | # Compile theme |
| 15 | cd $toplevel/../sphinx-bootstrap-theme-customizer/ |
| 16 | ./build "$@" |
| 17 | |
| 18 | # Copy theme for sphinx to use |
| 19 | rm -rf $toplevel/doc/theme |
| 20 | cp -rf theme $toplevel/doc |
| 21 | |
| 22 | # Do a hotswap (it may be enough for us to see the results compared to |
| 23 | # regenerating the html) |
| 24 | |
| 25 | cd $toplevel |
| 26 | mkdir -p doc/_build/html/_static/$bootstrap/css |
| 27 | cp $toplevel/doc/{theme/static,_build/html/_static}/$bootstrap/css/bootstrap.min.css |
| 28 | |
| 29 | echo "${color5}success${reset}" |