Section 6.4 Pro Tip – Test Your Exercises Locally
This is definitey an advanced topic If you are not comfortable with the command line you can definitely skip this section. But if you are at least somewhat comfortable with the command line and an editor then this can save you a bunch of time! The workflow is simple, edit your questions locally, then paste them into the interface once you have them working and debugged.
Here is a short video that demonstrates how to install the runestone command in under two minutes.
Here are the steps I go through in the video. This assumes you already have python installed on your system.
virtualenv runestone
- Creates a python virtual environment so you don't need administrator privileges to install the rest of what you need. If virtualenv is not installed you should dopip install virtualenv
(Python 2.7.x) orpython -m venv runestone
(Python > 3.5). If the pip command is not found then you should upgrade your version of Python to something newer. All modern version of Python come with pip pre-installed.. runestone/bin/activate
– this activates the virtual environment you created in the previous step.mkdir assignments
– Create an assignment to do your runestone work in.cd assignments
– Make assignments your working directory.runestone init
– Create a new project with some template directivesrunestone build
– Convert the restructuredText to htmlrunestone serve
– start a simple web server so you can access your new project in your browser athttp://localhost:8000/index.html
Once the works you can simply edit the index.rst file created by runestone init, and run runestone build
again to check your work.