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.

20 lines
683 B

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