diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-04-02 01:14:15 -0700 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-04-02 01:14:15 -0700 |
commit | 3c9d8878df3766ca66a34765ce01a59a34c3b449 (patch) | |
tree | 3dd8b59d1106fe3074957430d944b7cff3b531bf | |
parent | 03cbe7b18f392b4f7ba8d9e304793bc338e43118 (diff) | |
download | gitbook-3c9d8878df3766ca66a34765ce01a59a34c3b449.zip gitbook-3c9d8878df3766ca66a34765ce01a59a34c3b449.tar.gz gitbook-3c9d8878df3766ca66a34765ce01a59a34c3b449.tar.bz2 |
Add informations about exercises format
-rw-r--r-- | README.md | 44 |
1 files changed, 42 insertions, 2 deletions
@@ -1,7 +1,7 @@ GitBook ======= -GiBook is a command line tool (and Node.js library) for building beautiful programming books and exercises using GitHub/Git and Markdown. +GiBook is a command line tool (and Node.js library) for building beautiful programming books and exercises using GitHub/Git and Markdown. You can see an example: [Learn Javascript](http://gitbookio.github.io/javascript/). ## How to use it: @@ -35,9 +35,13 @@ Options for commands `build` and `serve` are: A book is a GitHub repository containing at least 2 files: `README.md` and `SUMMARY.md`. +#### README.md + +As usual, it should contains an introduction for your book. It will be automatically added to the final summary. + #### SUMMARY.md -The SUMMARY.md is used for getting the complete summary of the book. It should contains a list of items (deep items are allowed) with links to the different pages. +The `SUMMARY.md` is used for getting the complete summary of the book. It should contains a list of items (deep items are allowed) with links to the different pages. Example: @@ -55,3 +59,39 @@ This is the summary of my book. All the other content than the summary list will be ignored. +#### Exercises + +A book can contains interactive exercises (currently only in Javascript but Python and Ruby are coming soon ;) ). + +An exercise is defined by 3 different parts: + +* Exercise Message/Goals (in markdown/text) +* Base code to show to the user +* Solution to show to the user when he gives up +* Validation code for testing the result of the user input + +Exercises are defined in the markdown using the following format: + + +--- + +Define a variable `c` as the modulus of the decremented value of `x` by 3. + +```js +var x = 10; + +var c = +``` + +```js +var x = 10; + +var c = (x--) % 3; +``` + +```js +assert(c == 1); +``` + +--- + |