process.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. HLJS_V="9.18.1"
  3. DOJO_V="1.13.0"
  4. HLJS_DL="https://api.github.com/repos/highlightjs/highlight.js/tarball/$HLJS_V"
  5. DOJO_DL="http://download.dojotoolkit.org/release-$DOJO_V/dojo-release-$DOJO_V-src.tar.gz"
  6. curl -L $HLJS_DL --output "lib_highlight.tar.gz"
  7. curl -L $DOJO_DL --output "lib_dojo.tar.gz"
  8. rm -rf lib_dojo lib_highlight 2> /dev/null
  9. mkdir lib_dojo lib_highlight
  10. tar xzf lib_dojo.tar.gz -C lib_dojo --strip-components 1
  11. tar xzf lib_highlight.tar.gz -C lib_highlight --strip-components 1
  12. cd lib_highlight
  13. npm install
  14. node tools/build.js -t node
  15. # Translate language definitions to something Highlight.php can handle
  16. cd ..
  17. node launcher.js > languages.dat
  18. php get_language_definitions.php
  19. # Copy styles from highlight.js to our own styles directory
  20. rm -r ../styles/ 2> /dev/null
  21. mkdir -p ../styles/
  22. cp -a lib_highlight/src/styles/ ../styles/
  23. php get_styles_colors.php
  24. # Copy unit tests
  25. rm -r ../test/detect/ 2> /dev/null
  26. rm -r ../test/markup/ 2> /dev/null
  27. mkdir -p ../test/{detect,markup}/
  28. cp -a lib_highlight/test/detect/ ../test/detect/
  29. cp -a lib_highlight/test/markup/ ../test/markup/
  30. rm ../test/{detect,markup}/index.js 2> /dev/null