Skip to content

Publish RFCs as mdbook to GitHub Pages. #2192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*~
book/
src/
26 changes: 26 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
language: rust
before_install:
- openssl aes-256-cbc -K $encrypted_1cc96cfefdcd_key -iv $encrypted_1cc96cfefdcd_iv -in rfcs-publish-key.enc -out ~/.ssh/rfcs-publish-key -d
- chmod u=rw,og= ~/.ssh/rfcs-publish-key
- echo "Host github.com" >> ~/.ssh/config
- echo " IdentityFile ~/.ssh/rfcs-publish-key" >> ~/.ssh/config
- git --version
script:
- rev=$(git rev-parse --short HEAD)
- (cargo install mdbook --git https://github.com/azerupi/mdBook.git --force || true)
- ./generate-book.sh
- cd book
- git init
- git config --global user.name "bors"
- git config --global user.email "[email protected]"
- git remote add upstream [email protected]:rust-lang/rfcs.git
- git fetch upstream
- git reset upstream/gh-pages
- touch .
- git add -A .
- git commit -m "Rebuild book at ${rev}"
- git push -q upstream HEAD:gh-pages > /dev/null 2>&1
branches:
only:
- master

19 changes: 19 additions & 0 deletions generate-book.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

set -e

if [ ! -d src ]; then
mkdir src
fi

echo "[Introduction](introduction.md)\n" > src/SUMMARY.md

for f in $(ls text/* | sort)
do
echo "- [$(basename $f ".md")]($(basename $f))" >> src/SUMMARY.md
cp $f src
done

cp README.md src/introduction.md

mdbook build
Binary file added rfcs-publish-key.enc
Binary file not shown.