| 1 | #!/usr/bin/envscip-shell filesystem . . `/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=$(tputscip-shell system . . tput. setaf 5) |
| 9 | reset=$(tputscip-shell system . . tput. sgr0) # reset color codes |
| 10 | |
| 11 | toplevel=$(gitscip-shell system . . git. rev-parse --show-toplevel) |
| 12 | bootstrap=$(basenamescip-shell system . . basename. $(lsscip-shell system . . 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 | rmscip-shell system . . rm. -rf $toplevel/doc/theme |
| 20 | cpscip-shell system . . 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 | mkdirscip-shell system . . mkdir. -p doc/_build/html/_static/$bootstrap/css |
| 27 | cpscip-shell system . . cp. $toplevel/doc/{theme/static,_build/html/_static}/$bootstrap/css/bootstrap.min.css |
| 28 | |
| 29 | echoscip-shell system . . echo. "${color5}success${reset}" |