This online book is based on GitBook. The content is written in Markdown.
Any changes made to Markdown files listed in the SUMMARY.md
file (in the master
branch of this repository) will affect the content of the online book. This makes it rather convenient
for others to suggest changes, improvements, or even new content through Pull Requests!
Below you can find some information on how to set up this book for local development. If you want to suggest changes, our recommended approach is to:
- Fork this repository and clone the fork to your local computer.
- Create a new branch so you can keep your
master
branch "clean" and update it if we make any changes. - Push your local branch to your fork and open a Pull Request.
Let us know if you have any questions!
You'll need npm.
Install the gitbook
client if you haven't already:
$ npm install gitbook-cli -g
Copy the repository and run the following commands from the top directory:
$ gitbook install
$ gitbook serve
Go to: http://localhost:4000
You can export the content as a PDF with the following command:
gitbook pdf ./ ./epfl-com303-labs.pdf
$ npm install gitbook-cli -g
Create new directory
$ mkdir my-book
$ cd my-book
$ gitbook init
To preview the book and make live edits:
$ gitbook serve
To build static website:
$ gitbook build
To have separate documentation and code, create a book.json
file with the following content:
{
"root": "./docs"
}
and place all files inside a folder called 'docs'
.
Add the following line to your book.json
file:
{
"plugins": ["mathjax"]
}
If you are exporting to PDF, you will find a bug when using this version of mathjax
(as of 11 Dec 2018).
This fix consists of using a forked version of mathjax
, namely:
{
"plugins": ["mathjax@https://github.com/OrgVue/gitbook-plugin-mathjax.git#speech-fix"]
}
and installing the following package:
$ npm install svgexport -g
Install the plugin from within your gitbook directory
$ gitbook install
Pandoc is a great tool for this. For small sections, the online tool is generally sufficient.
Add the following plug-in to your book.json
file:
{
"plugins": ["expandable-chapters"]
}
Install the plug-in by running:
$ gitbook install
See here.
You'll need to make a Disqus account if you don't already have one.
Edit the book.json
file as described here.
Install the plug-in by running:
$ gitbook install
See here.
See here.