Skip to content

Commit

Permalink
Move docs to this repo and auto build them
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Feb 8, 2015
1 parent 6866c1b commit f8ef160
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 5 deletions.
12 changes: 9 additions & 3 deletions .travis.yml
@@ -1,5 +1,11 @@
language: rust
script:
- (cd phf && cargo test)
- (cd phf && cargo test --features core)
- (cd phf_macros && cargo test --features stats)
- (cd phf && cargo test)
- (cd phf && cargo test --features core)
- (cd phf_macros && cargo test --features stats)
- ./.travis/build_docs.sh
after_success:
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && ./.travis/update_docs.sh
env:
global:
secure: H8UjXPVRBOF3peqdBwrAS1cvW4TXz9wJCwUqh5K+AP2TbFQAVt9LLkiUySVERRckR7sM/C9m8IE/nhKz7ck8+Dj7tbqd7Jef3dlienpucDF1jpbENyvsshPRvGlvd4jAQCONL9Yxs3MnRnkbr5qI3Gz/JqP7z8jzp5V5Wf7mc/I=
11 changes: 11 additions & 0 deletions .travis/build_docs.sh
@@ -0,0 +1,11 @@
#!/bin/bash

set -e

mkdir doc

for crate in $(echo phf_shared phf_macros phf); do
mkdir -p $crate/target
ln -s -t $crate/target ../../doc
(cd $crate && cargo doc --no-deps)
done
16 changes: 16 additions & 0 deletions .travis/update_docs.sh
@@ -0,0 +1,16 @@
#!/bin/bash

set -o errexit -o nounset

git clone --branch gh-pages "https://$GH_TOKEN@github.com/${TRAVIS_REPO_SLUG}.git" deploy_docs
cd deploy_docs

git config user.name "Steven Fackler"
git config user.email "sfackler@gmail.com"

rm -rf doc
mv ../doc .

git add -A .
git commit -m "rebuild pages at ${TRAVIS_COMMIT}"
git push
2 changes: 1 addition & 1 deletion phf/src/lib.rs
Expand Up @@ -2,7 +2,7 @@
//!
//! Keys can be string literals, byte string literals, byte literals, char
//! literals, or any of the fixed-size isizeegral types.
#![doc(html_root_url="https://sfackler.github.io/doc")]
#![doc(html_root_url="https://sfackler.github.io/rust-phf/doc")]
#![feature(core)]
#![warn(missing_docs)]
#![no_std]
Expand Down
2 changes: 1 addition & 1 deletion phf_macros/src/lib.rs
@@ -1,7 +1,7 @@
//! Compiler plugin for Rust-PHF
//!
//! See the documentation for the `phf` crate for more details.
#![doc(html_root_url="http://sfackler.github.io/doc")]
#![doc(html_root_url="http://sfackler.github.io/rust-phf/doc")]
#![feature(plugin_registrar, quote, rustc_private, hash, core, env)]

extern crate rand;
Expand Down
1 change: 1 addition & 0 deletions phf_shared/src/lib.rs
@@ -1,6 +1,7 @@
#![feature(hash)]
#![cfg_attr(feature = "core", feature(core))]
#![no_std]
#![doc(html_root_url="http://sfackler.github.io/rust-phf/doc")]

#[cfg(feature = "core")]
extern crate core;
Expand Down

0 comments on commit f8ef160

Please sign in to comment.