rewrite_documentation.sh 654 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. function rewrite {
  3. echo $1
  4. sed -i.bak -e s/_downloads/downloads/g $1
  5. sed -i.bak -e s/_static/static/g $1
  6. sed -i.bak -e s/_images/images/g $1
  7. sed -i.bak -e s/_modules/modules/g $1
  8. sed -i.bak -e s/_sources/sources/g $1
  9. rm ${1}.bak
  10. }
  11. echo `pwd`
  12. cd _build/html
  13. echo `pwd`
  14. rm -r downloads || true
  15. rm -r images || true
  16. rm -r modules || true
  17. rm -r sources || true
  18. rm -r static || true
  19. mv _downloads downloads 2> /dev/null
  20. mv _static static 2> /dev/null
  21. mv _images images 2> /dev/null
  22. mv _modules modules 2> /dev/null
  23. mv _sources sources 2> /dev/null
  24. export -f rewrite
  25. for f in `find . -type f`
  26. do
  27. rewrite $f
  28. done