# Hacking

This is a step-by-step instruction for creating a development environment for Hatta.

### 1. Fork Hatta

Go to Bitbucked, create an account there if you don't have any yet, then go to https://bitbucket.org/thesheep/hatta and click the fork button. A copy of the Hatta repository will be made, so that you can make any changes in it.

### 2. Clone it

$hg clone ssh://hg@bitbucket.org/YOURLOGIN/hatta$ cd hatta/


### 4. Create virtualenv and activate it

$wget -nd https://raw.github.com/pypa/virtualenv/develop/virtualenv.py$ python virtualenv.py .
$. bin/activate  Your prompt should now change, with an added "(hatta)" in front of it. That means that your shell is now in the activated virtualenv, and that all python libraries you install and python programs you run will use the local python from that virtualenv, not your global, system python. Whenever you want to work in that virtualenv, you just have to go into that directory and activate it: $ cd hatta/
$. bin/activate  You can deactivate your virtualenv with the deactivate command. ### 5. Install Hatta and development tools $ pip install -e .
$pip install pygments$ pip install pytest
$hg init docs/  ### 7. Run the development server $ ./dev.py


Now point your web browser to http://127.0.0.1:8080 and you can use your wiki.

### 8. Hack, hack, hack

The development server will automatically reload when you change code.

$pytest tests/  ### 10. If the tests pass, commit $ hg commit


You will see an editor which lets you enter your commit message. Describe what you changed. The first line should be a short summary, the subsequent lines can get into details.

### 11. Push your changes to Bitbucket

\$ hg push