rebuild-docs.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. sudo pip3 install -U setuptools wheel
  15. sudo 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. sudo python3 setup.py install --record files.txt
  21. fi
  22. # 2) Go to Wekan repo directory
  23. cd ~/repos/wekan
  24. # 3) Create api docs directory, if it does not exist
  25. if [ ! -d public/api ]; then
  26. mkdir -p public/api
  27. fi
  28. # 4) Generate docs.
  29. #python3 ./openapi/generate_openapi.py --release $(git describe --tags --abbrev=0) > ./public/api/wekan.yml
  30. python3 ./openapi/generate_openapi.py --release v$1 > ./public/api/wekan.yml
  31. api2html -c ./public/logo-header.png -o ./public/api/wekan.html ./public/api/wekan.yml
  32. # Copy docs to bundle
  33. #cp -pR ./public/api ~/repos/wekan/.build/bundle/programs/web.browser/app/