From 1bbb5107565d657f8101eed3faa262939a816c7b Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Sat, 25 Feb 2017 16:42:31 -0600 Subject: [PATCH] Add automatic build and publish script --- CONTRIBUTING.html | 123 ------------------------- CONTRIBUTING.md | 41 ++++++++- README.html | 134 ---------------------------- book/index.html | 14 --- book/pages/IO.html | 14 --- book/pages/byteorder.html | 14 --- book/pages/cli_parsing.html | 14 --- book/pages/contributing.html | 14 --- book/pages/error_handling_note.html | 14 --- book/pages/file_io.html | 14 --- book/pages/json.html | 14 --- book/pages/math.html | 14 --- book/pages/rand.html | 14 --- book/pages/serialization.html | 14 --- book/pages/table_of_contents.html | 14 --- book/pages/toml.html | 14 --- book/print.html | 14 --- build-site.sh | 30 +++++++ 18 files changed, 70 insertions(+), 454 deletions(-) delete mode 100644 CONTRIBUTING.html delete mode 100644 README.html create mode 100755 build-site.sh diff --git a/CONTRIBUTING.html b/CONTRIBUTING.html deleted file mode 100644 index 6eb5e5a..0000000 --- a/CONTRIBUTING.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - Contributing - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
-

Contributing

- -
- - - - - - - - -
- - - - - - - -
- - - - - - - - - - - - - - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 854139a..f0744bd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1 +1,40 @@ -# Contributing +# Contributing to the Rust Cookbook + +Have something useful to add to the Rust Cookbook? We'd love to have it! + +This document contains information and guidelines that you should read before +contributing to the project. If you think something in this document should change, +feel free propose a change in a pull request. + +## Table of Contents +* [Getting Started](#getting-started) +* [How to Contribute](#how-to-contribute) +* [Crates](#crates) +* [Tests](#tests) +* [Style](#style) + * [Git Commit Messages](#git-commit-messages) + * [Snippet Style](#snippet-style) + +## Getting Started +TODO: Mention Trello and how to join (if we keep using it) + +## How to Contribute +TODO: Reporting bugs +TODO: Project page suggestions +TODO: Fixing bugs +TODO: Pull requests + +## Crates +TODO: How to add new crates to project + +## Tests +TODO: Write about writing tests + +## Style +### Git Commit Messages +https://chris.beams.io/posts/git-commit/ +TODO: Possibly take relevant parts from this post or write our own + +### Snippet Style +TODO: Talk about writing good idiomatic code +TODO: Maybe provide a template? diff --git a/README.html b/README.html deleted file mode 100644 index 991c1b6..0000000 --- a/README.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - Table of Contents - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
-

Cookin' with Rust

-

A practical guide to the Rust crate ecosystem.

-

Recipes

-

Byteorder [byteorder]byteorder

-

File IO [file]file

-

Command Line Parsing [clap]clap

-

JSON [json]json

-

Contributing

-

If you'd like to make changes to the project, please see this guide.

-

License

-

MIT/Apache-2.0

- - -
- - - - - - - - -
- - - - - - - -
- - - - - - - - - - - - - - diff --git a/book/index.html b/book/index.html index 20d10c0..a3ea3db 100644 --- a/book/index.html +++ b/book/index.html @@ -116,20 +116,6 @@ - - diff --git a/book/pages/IO.html b/book/pages/IO.html index eb28edc..293f63f 100644 --- a/book/pages/IO.html +++ b/book/pages/IO.html @@ -109,20 +109,6 @@ - - diff --git a/book/pages/byteorder.html b/book/pages/byteorder.html index fd78ffe..8fb3f78 100644 --- a/book/pages/byteorder.html +++ b/book/pages/byteorder.html @@ -159,20 +159,6 @@ fn main() { run().unwrap() } - - diff --git a/book/pages/cli_parsing.html b/book/pages/cli_parsing.html index b0d3efe..a329e04 100644 --- a/book/pages/cli_parsing.html +++ b/book/pages/cli_parsing.html @@ -109,20 +109,6 @@ - - diff --git a/book/pages/contributing.html b/book/pages/contributing.html index 85abf7f..8aacd0a 100644 --- a/book/pages/contributing.html +++ b/book/pages/contributing.html @@ -137,20 +137,6 @@ TODO: Maybe provide a template?

- - diff --git a/book/pages/error_handling_note.html b/book/pages/error_handling_note.html index df21a7a..4b9ac28 100644 --- a/book/pages/error_handling_note.html +++ b/book/pages/error_handling_note.html @@ -146,20 +146,6 @@ makes the ? operator work

- - diff --git a/book/pages/file_io.html b/book/pages/file_io.html index d50d2d6..e11a2a1 100644 --- a/book/pages/file_io.html +++ b/book/pages/file_io.html @@ -109,20 +109,6 @@ - - diff --git a/book/pages/json.html b/book/pages/json.html index 7b34c22..ab4eb7a 100644 --- a/book/pages/json.html +++ b/book/pages/json.html @@ -148,20 +148,6 @@ fn main(){ - - diff --git a/book/pages/math.html b/book/pages/math.html index 2fd377a..c233fbf 100644 --- a/book/pages/math.html +++ b/book/pages/math.html @@ -110,20 +110,6 @@ - - diff --git a/book/pages/rand.html b/book/pages/rand.html index 00b472c..29dbedc 100644 --- a/book/pages/rand.html +++ b/book/pages/rand.html @@ -210,20 +210,6 @@ fn main() { - - diff --git a/book/pages/serialization.html b/book/pages/serialization.html index fbf836d..fd39592 100644 --- a/book/pages/serialization.html +++ b/book/pages/serialization.html @@ -109,20 +109,6 @@ - - diff --git a/book/pages/table_of_contents.html b/book/pages/table_of_contents.html index d6fb25e..e89665d 100644 --- a/book/pages/table_of_contents.html +++ b/book/pages/table_of_contents.html @@ -117,20 +117,6 @@ - - diff --git a/book/pages/toml.html b/book/pages/toml.html index 79ad9ac..38c6d0c 100644 --- a/book/pages/toml.html +++ b/book/pages/toml.html @@ -176,20 +176,6 @@ fn main() { - - diff --git a/book/print.html b/book/print.html index 22b15b9..39ce22e 100644 --- a/book/print.html +++ b/book/print.html @@ -440,20 +440,6 @@ TODO: Maybe provide a template?

- - diff --git a/build-site.sh b/build-site.sh new file mode 100755 index 0000000..69cd988 --- /dev/null +++ b/build-site.sh @@ -0,0 +1,30 @@ +# Returns 1 if program is installed and 0 otherwise +function program_installed { + local return_=1 + + type $1 >/dev/null 2>&1 || { local return_=0; } + + echo "$return_" +} + +function main() { + # Ensure required programs are installed + if [ $(program_installed git) == 0 ]; then + echo "Please install Git." + elif [ $(program_installed ghp-import) == 0 ]; then + echo "Please install ghp-import: pip install ghp-import." + elif [ $(program_installed mdbook) == 0 ]; then + echo "Please install mdbook: cargo install mdbook." + else + echo "Copying CONTRIBUTING.md to src/pages/contributing.md" + cp CONTRIBUTING.md src/pages/contributing.md + echo "Building site to book/" + mdbook build + echo "Committing book directory to gh-pages branch" + ghp-import -p book + # echo "" + # echo "To push changes to site, run ghp-import -p book" + fi +} + +main