mirror of https://github.com/matrix-org/go-neb.git
Browse Source
Merge pull request #109 from matrix-org/kegan/readme-to-docs
Merge pull request #109 from matrix-org/kegan/readme-to-docs
Delete API info from README and point to gh-page. Add gendoc scriptkegan/docs-services
Kegsay
8 years ago
committed by
GitHub
4 changed files with 48 additions and 64 deletions
-
2.gitignore
-
66README.md
-
10config.sample.yaml
-
34gendoc.sh
@ -0,0 +1,34 @@ |
|||
#!/bin/bash |
|||
set -u |
|||
|
|||
DOC_DIR=godoc |
|||
|
|||
# Run a godoc server which we will scrape. Clobber the GOPATH to include |
|||
# only our dependencies. |
|||
GOPATH=$(pwd):$(pwd)/vendor godoc -http=localhost:6060 & |
|||
DOC_PID=$! |
|||
|
|||
# Wait for the server to init |
|||
while : |
|||
do |
|||
curl -s "http://localhost:6060" > /dev/null |
|||
if [ $? -eq 0 ] # exit code is 0 if we connected |
|||
then |
|||
break |
|||
fi |
|||
done |
|||
|
|||
# Scrape the pkg directory for the API docs. Scrap lib for the CSS/JS. Ignore everything else. |
|||
# The output is dumped to the directory "localhost:6060". |
|||
wget -r -m -k -E -p --include-directories="/pkg,/lib" --exclude-directories="*" http://localhost:6060/pkg/github.com/matrix-org/go-neb/ |
|||
|
|||
# Stop the godoc server |
|||
kill -9 $DOC_PID |
|||
|
|||
# Delete the old directory or else mv will put the localhost dir into |
|||
# the DOC_DIR if it already exists. |
|||
rm -rf $DOC_DIR |
|||
mv localhost\:6060 $DOC_DIR |
|||
|
|||
echo "Docs can be found in $DOC_DIR" |
|||
echo "Replace /lib and /pkg in the gh-pages branch to update gh-pages" |
Write
Preview
Loading…
Cancel
Save
Reference in new issue