You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
825 B

8 years ago
  1. #!/bin/bash
  2. DOC_DIR=godoc
  3. # Run a godoc server which we will scrape. Clobber the GOPATH to include
  4. # only our dependencies.
  5. GOPATH=$(pwd):$(pwd)/vendor godoc -http=localhost:6060 &
  6. DOC_PID=$!
  7. # Wait for the server to init
  8. sleep 1
  9. # Scrape the pkg directory for the API docs. Scrap lib for the CSS/JS. Ignore everything else.
  10. # The output is dumped to the directory "localhost:6060".
  11. wget -r -m -k -E -p --include-directories="/pkg,/lib" --exclude-directories="*" http://localhost:6060/pkg/github.com/matrix-org/go-neb/
  12. # Stop the godoc server
  13. kill -9 $DOC_PID
  14. # Delete the old directory or else mv will put the localhost dir into
  15. # the DOC_DIR if it already exists.
  16. rm -rf $DOC_DIR
  17. mv localhost\:6060 $DOC_DIR
  18. echo "Docs can be found in $DOC_DIR"
  19. echo "Replace /lib and /pkg in the gh-pages branch to update gh-pages"