OEP Python interactive book. This repo contains the RST sources of the book. Such sources will have to be compiled inside a proper runestone instance.
The book is published here.
This repo, as cited before, is just a part of the whole infrastructure. In order to be up and running, it is necessary to follow the following flow:
- Install runestone (from the original project, no forks involved here)
- Clone the templating repo from this organization.
- Clone this repo in the proper folder.
- Build
What follows is a dedicated guide to get up&running easily.
In order to locally test this on your dev machine you have to install runestone
and then build the rst files.
To do so, one possibility is the following:
0. Create a working folder. Let's call it libro
.
- Create a virtual environment. To do so, enter in the working folder and launch the following:
virtualenv -p python3 .venv
- Now it is necessary to activate such virtual environment.
source .venv/bin/activate
- Install the runestone software and its dependencies.
pip3 install runestone
- Now it's necessary to get the right template from the repo:
git clone https://github.com/open-education-polito/python-interactive-book-template.git
cp -r python-interactive-book-template/* .
rm -rf python-interactive-book-template
- This step requires to pull this repo inside the working folder. To do so, just typo
git clone https//github.com/open-education-polito/python-interactive-book-chapters.git _sources
- Eventually, run the build
runestone build
- To see the result, open the
runestone server
like this:
runestone serve
And to see it, browser http://localhost:8000
.
Rememeber that now you have a full working git repo inside the _sources
folder so if you want to work using the git flow you should do it inside
that folder. The build process will not touch such a folder since it is
intended to be just the sources one.
- Fork this repo
- Clone the freshly forked repo
- Work there and test
- Commit and push always on the forked repo
- When code is ready, make a PR
- When Review is done, squash the commits down to one using
git rebase -i HEAD~n
wheren
is the number of commits to squash. You may usereword
on the top one,fixup
on the other entries. - Rebase the master. To do this:
git remote add upstream https://github.com/Open-Education-Polito/oep-python-interactive-book.git
git fetch upstream/master
git rebase -i upstream/master
- Eventually fix the problems, then
git rebase --continue
- When done, push with
git push origin +master
- The code will be merged
See the AUTHORS.md
file in the root of this repo.