Skip to content

Commit e9c4cde

Browse files
authored
Merge pull request #53 from softdevteam/tag_books
Build a book for each tag version (including master)
2 parents 5c65ee2 + 349783a commit e9c4cde

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: rust
22
cache:
33
- cargo
44
install:
5-
- cargo install --list | grep mdbook || cargo install mdbook --vers "0.2.2"
5+
- cargo install --list | grep mdbook || cargo install mdbook --vers "=0.2"
66
before_script:
77
- rustup toolchain install nightly
88
- rustup component add --toolchain nightly rustfmt-preview || cargo +nightly install --force rustfmt-nightly
@@ -11,11 +11,11 @@ script:
1111
- cargo test --all
1212
- cd $TRAVIS_BUILD_DIR/cfgrammar && cargo test --features "serde"
1313
- cd $TRAVIS_BUILD_DIR/lrtable && cargo test --features "serde"
14-
- cd $TRAVIS_BUILD_DIR/doc && mdbook build
14+
- cd $TRAVIS_BUILD_DIR/doc && ./build.sh
1515
deploy:
1616
provider: pages
1717
skip-cleanup: true
1818
github-token: $GITHUB_TOKEN
19-
local-dir: doc/book
19+
local-dir: doc/release/
2020
on:
2121
branch: master

doc/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
book
2+
release

doc/build.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
# build books for each tag
4+
for tag in $(git tag)
5+
do
6+
echo "Building book for $tag"
7+
git checkout $tag
8+
mdbook build -d release/$tag/book/
9+
done
10+
11+
# build book/apidoc for master
12+
git checkout master
13+
echo "Building book for master"
14+
mdbook build -d release/master/book
15+
echo "Building docs for master"
16+
RUSTDOCFLAGS="-Z unstable-options --enable-index-page" cargo +nightly doc --no-deps
17+
mv ../target/doc release/master/api

0 commit comments

Comments
 (0)