Alex Crichton | 24abc4f | 2015-09-16 23:54:56 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | rm -rf target/doc |
| 6 | mkdir -p target/doc |
| 7 | |
Alex Crichton | dab1ead | 2015-09-17 09:52:21 -0700 | [diff] [blame] | 8 | cp ci/landing-page-head.html target/doc/index.html |
| 9 | |
Alex Crichton | 730a17f | 2015-09-17 10:05:36 -0700 | [diff] [blame] | 10 | TARGETS=`grep html_root_url src/lib.rs | sed 's/.*".*\/\(.*\)"/\1/'` |
| 11 | |
| 12 | for target in $TARGETS; do |
| 13 | echo documenting $target |
| 14 | |
| 15 | rustdoc -o target/doc/$target --target $target src/lib.rs --cfg dox \ |
Alex Crichton | dab1ead | 2015-09-17 09:52:21 -0700 | [diff] [blame] | 16 | --crate-name libc |
| 17 | |
Alex Crichton | 730a17f | 2015-09-17 10:05:36 -0700 | [diff] [blame] | 18 | echo "<li><a href="$target/libc/index.html">$target</a></li>" \ |
Alex Crichton | dab1ead | 2015-09-17 09:52:21 -0700 | [diff] [blame] | 19 | >> target/doc/index.html |
Alex Crichton | 730a17f | 2015-09-17 10:05:36 -0700 | [diff] [blame] | 20 | done |
Alex Crichton | 24abc4f | 2015-09-16 23:54:56 -0700 | [diff] [blame] | 21 | |
Alex Crichton | dab1ead | 2015-09-17 09:52:21 -0700 | [diff] [blame] | 22 | cat ci/landing-page-footer.html >> target/doc/index.html |
Alex Crichton | 24abc4f | 2015-09-16 23:54:56 -0700 | [diff] [blame] | 23 | |
| 24 | if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "autotest" ]; then |
| 25 | pip install ghp-import --user $USER |
| 26 | $HOME/.local/bin/ghp-import -n target/doc |
Alex Crichton | 41afa80 | 2015-09-16 23:56:01 -0700 | [diff] [blame] | 27 | git push -qf https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages |
Alex Crichton | 24abc4f | 2015-09-16 23:54:56 -0700 | [diff] [blame] | 28 | fi |