aboutsummaryrefslogtreecommitdiff
path: root/libc/ci/dox.sh
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2017-03-26 17:07:34 -0700
committerDaniel Mueller <deso@posteo.net>2017-03-26 17:07:34 -0700
commitcb39828ecd7ea5d2eac3076ad3dd1b6ef05e10d3 (patch)
treeee9b7fb3e686a2154a95487e404b605d141b9258 /libc/ci/dox.sh
parent86415f23a86b5a44aa000d513500a9d1d0df4bba (diff)
downloadnitrocli-cb39828ecd7ea5d2eac3076ad3dd1b6ef05e10d3.tar.gz
nitrocli-cb39828ecd7ea5d2eac3076ad3dd1b6ef05e10d3.tar.bz2
Import subrepo libc/:libc at 05a2d197356ef253dfd985166576619ac9b6947f
Diffstat (limited to 'libc/ci/dox.sh')
-rw-r--r--libc/ci/dox.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/libc/ci/dox.sh b/libc/ci/dox.sh
new file mode 100644
index 0000000..85e9243
--- /dev/null
+++ b/libc/ci/dox.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# Builds documentation for all target triples that we have a registered URL for
+# in liblibc. This scrapes the list of triples to document from `src/lib.rs`
+# which has a bunch of `html_root_url` directives we pick up.
+
+set -e
+
+TARGETS=`grep html_root_url src/lib.rs | sed 's/.*".*\/\(.*\)"/\1/'`
+
+rm -rf target/doc
+mkdir -p target/doc
+
+cp ci/landing-page-head.html target/doc/index.html
+
+for target in $TARGETS; do
+ echo documenting $target
+
+ rustdoc -o target/doc/$target --target $target src/lib.rs --cfg dox \
+ --crate-name libc
+
+ echo "<li><a href="/libc/$target/libc/index.html">$target</a></li>" \
+ >> target/doc/index.html
+done
+
+cat ci/landing-page-footer.html >> target/doc/index.html
+
+# If we're on travis, not a PR, and on the right branch, publish!
+if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then
+ pip install ghp_import --install-option="--prefix=$HOME/.local"
+ $HOME/.local/bin/ghp-import -n target/doc
+ git push -qf https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
+fi