Fix colors in deploy script + Fix link to API docs
This commit is contained in:
parent
77413e4699
commit
fd57d03992
|
@ -1,6 +1,6 @@
|
||||||
# Rust Library
|
# Rust Library
|
||||||
|
|
||||||
Check here for the [API docs](mdbook/index.html) generated by rustdoc
|
Check here for the [API docs](../mdbook/index.html) generated by rustdoc
|
||||||
mdBook is not only a command line tool, it can be used as a crate. You can extend it,
|
mdBook is not only a command line tool, it can be used as a crate. You can extend it,
|
||||||
integrate it in current projects. Here is a short example:
|
integrate it in current projects. Here is a short example:
|
||||||
|
|
||||||
|
|
18
deploy.sh
18
deploy.sh
|
@ -3,27 +3,27 @@
|
||||||
# Exit on error or variable unset
|
# Exit on error or variable unset
|
||||||
set -o errexit -o nounset
|
set -o errexit -o nounset
|
||||||
|
|
||||||
NC='\e[39m'
|
NC='\033[39m'
|
||||||
CYAN='\e[36m'
|
CYAN='\033[36m'
|
||||||
GREEN='\e[32m'
|
GREEN='\033[32m'
|
||||||
|
|
||||||
rev=$(git rev-parse --short HEAD)
|
rev=$(git rev-parse --short HEAD)
|
||||||
|
|
||||||
echo "${CYAN}Running cargo doc${NC}"
|
echo -e "${CYAN}Running cargo doc${NC}"
|
||||||
# Run cargo doc
|
# Run cargo doc
|
||||||
cargo doc
|
cargo doc
|
||||||
|
|
||||||
echo "${CYAN}Running mdbook build${NC}"
|
echo -e "${CYAN}Running mdbook build${NC}"
|
||||||
# Run mdbook to generate the book
|
# Run mdbook to generate the book
|
||||||
target/debug/mdbook build book-example/
|
target/debug/mdbook build book-example/
|
||||||
|
|
||||||
echo "${CYAN}Copying book to target/doc${NC}"
|
echo -e "${CYAN}Copying book to target/doc${NC}"
|
||||||
# Copy files from rendered book to doc root
|
# Copy files from rendered book to doc root
|
||||||
cp -R book-example/book/* target/doc/
|
cp -R book-example/book/* target/doc/
|
||||||
|
|
||||||
cd target/doc
|
cd target/doc
|
||||||
|
|
||||||
echo "${CYAN}Initializing Git${NC}"
|
echo -e "${CYAN}Initializing Git${NC}"
|
||||||
git init
|
git init
|
||||||
git config user.name "Mathieu David"
|
git config user.name "Mathieu David"
|
||||||
git config user.email "mathieudavid@mathieudavid.org"
|
git config user.email "mathieudavid@mathieudavid.org"
|
||||||
|
@ -34,9 +34,9 @@ git reset upstream/gh-pages
|
||||||
|
|
||||||
touch .
|
touch .
|
||||||
|
|
||||||
echo "${CYAN}Pushing changes to gh-pages${NC}"
|
echo -e "${CYAN}Pushing changes to gh-pages${NC}"
|
||||||
git add -A .
|
git add -A .
|
||||||
git commit -m "rebuild pages at ${rev}"
|
git commit -m "rebuild pages at ${rev}"
|
||||||
git push -q upstream HEAD:gh-pages
|
git push -q upstream HEAD:gh-pages
|
||||||
|
|
||||||
echo "${GREEN}Deployement done${NC}"
|
echo -e "${GREEN}Deployement done${NC}"
|
||||||
|
|
Loading…
Reference in New Issue