Skip to content

Latest commit

 

History

History
149 lines (104 loc) · 3.67 KB

SETUP.md

File metadata and controls

149 lines (104 loc) · 3.67 KB

Setup Guide

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:

  1. Fork this repository and clone the fork to your local computer.
  2. Create a new branch so you can keep your master branch "clean" and update it if we make any changes.
  3. Push your local branch to your fork and open a Pull Request.

Let us know if you have any questions!

Building/viewing GitBook locally

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

Exporting GitBook to PDF

You can export the content as a PDF with the following command:

gitbook pdf ./ ./epfl-com303-labs.pdf

GitBook instructions (from scratch)

Installation instructions.

$ 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'.

Adding math

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

More info.

Converting LaTeX to Markdown

Pandoc is a great tool for this. For small sections, the online tool is generally sufficient.

Adding drop-down menu for sidebar

Add the following plug-in to your book.json file:

{
    "plugins": ["expandable-chapters"]
}

Install the plug-in by running:

$ gitbook install

More info.

Highlighted boxes (for tasks)

See here.

Adding Disqus commands

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

Adding custom favicon

See here.

Adding TOC to page

See here.