rebuild-docs.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Extract the OpenAPI specification.
  2. # 1) Check that there is only one parameter
  3. # of Wekan version number:
  4. if [ $# -ne 1 ]
  5. then
  6. echo "Syntax with Wekan version number:"
  7. echo " ./rebuild-docs.sh 5.10"
  8. exit 1
  9. fi
  10. # 2) If esprima-python directory does not exist,
  11. # install dependencies.
  12. if [ ! -d ~/python/esprima-python ]; then
  13. sudo apt-get -y install python3-pip python3-swagger-spec-validator python3-wheel python3-setuptools
  14. sudo npm install -g api2html
  15. (mkdir -p ~/python && cd ~/python && git clone --depth 1 -b master https://github.com/Kronuz/esprima-python)
  16. (cd ~/python/esprima-python && git fetch origin pull/20/head:delete_fix && git checkout delete_fix && sudo python3 setup.py install --record files.txt)
  17. #(cd ~/python/esprima-python && git fetch origin pull/20/head:delete_fix && git checkout delete_fix && sudo pip3 install .)
  18. # temporary fix until https://github.com/Kronuz/esprima-python/pull/20 gets merged
  19. # a) Generating docs works on Kubuntu 21.10 with this,
  20. # but generating Sandstorm WeKan package does not work
  21. # https://github.com/wekan/wekan/issues/4280
  22. # https://github.com/sandstorm-io/sandstorm/issues/3600
  23. # sudo pip3 install .
  24. # b) Generating docs Works on Linux Mint with this,
  25. # and also generating Sandstorm WeKan package works:
  26. # sudo python3 setup.py install --record files.txt
  27. fi
  28. # 2) Go to Wekan repo directory
  29. cd ~/repos/wekan
  30. # 3) Create api docs directory, if it does not exist
  31. if [ ! -d public/api ]; then
  32. mkdir -p public/api
  33. fi
  34. # 4) Generate docs.
  35. #python3 ./openapi/generate_openapi.py --release $(git describe --tags --abbrev=0) > ./public/api/wekan.yml
  36. python3 ./openapi/generate_openapi.py --release v$1 > ./public/api/wekan.yml
  37. api2html -c ./public/logo-header.png -o ./public/api/wekan.html ./public/api/wekan.yml
  38. # Copy docs to bundle
  39. #cp -pR ./public/api ~/repos/wekan/.build/bundle/programs/web.browser/app/