-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathviewdoc
executable file
·14 lines (11 loc) · 921 Bytes
/
viewdoc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
## Call with 'source viewdoc' as browser-sync does not daemonize well, and this only works if exactly ONE terminal runs this.
# godoc is actually deprecated; the official suggestion is to use pkgsite. The documentation on this whole situation is atrocious.
# Furthermore, pkgsite is intended for static packages and even a local install does not reload on change. You actually have to restart the server to see changes!
# This requires browser-sync and nodemon (short for node-monitor, not for no-demon)
# So I follow https://mdaverde.com/posts/golang-local-docs/
# Only works in the current dir
# Used to work, but does not any longer:
# browser-sync start --proxy "localhost:8080" --startPath $PWD &
browser-sync start --proxy "localhost:8080" --startPath "github.com/GottfriedHerold/Bandersnatch" &
nodemon --signal SIGTERM --watch . --ext "go" --exec "browser-sync reload && ~/go/bin/pkgsite ."
~/go/bin/pkgsite