rebuild-docs.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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
  14. pip3 install -U setuptools wheel
  15. npm install -g api2html
  16. mkdir -p ~/python
  17. cd ~/python
  18. git clone --depth 1 -b master https://github.com/Kronuz/esprima-python
  19. cd ~/python/esprima-python
  20. # a) Generating docs works on Kubuntu 21.10 with this,
  21. # but generating Sandstorm WeKan package does not work
  22. # https://github.com/wekan/wekan/issues/4280
  23. # https://github.com/sandstorm-io/sandstorm/issues/3600
  24. # sudo pip3 install .
  25. sudo pip3 install .
  26. # b) Generating docs Works on Linux Mint with this,
  27. # and also generating Sandstorm WeKan package works:
  28. # sudo python3 setup.py install --record files.txt
  29. fi
  30. # 2) Go to Wekan repo directory
  31. cd ~/repos/wekan
  32. # 3) Create api docs directory, if it does not exist
  33. if [ ! -d public/api ]; then
  34. mkdir -p public/api
  35. fi
  36. # 4) Generate docs.
  37. #python3 ./openapi/generate_openapi.py --release $(git describe --tags --abbrev=0) > ./public/api/wekan.yml
  38. python3 ./openapi/generate_openapi.py --release v$1 > ./public/api/wekan.yml
  39. api2html -c ./public/logo-header.png -o ./public/api/wekan.html ./public/api/wekan.yml
  40. # Copy docs to bundle
  41. #cp -pR ./public/api ~/repos/wekan/.build/bundle/programs/web.browser/app/