About Download Docs Changes


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
$ pip install lxml

6. Make page repository for testing your wiki

$ mkdir docs
$ hg init docs/

7. Run the development server

$ ./dev.py

Now point your web browser to and you can use your wiki.

8. Hack, hack, hack

The development server will automatically reload when you change code.

9. Run tests

$ 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

Once your new functionality or bugfix is ready, you can push your changes to the server.

$ hg push

12. Make a pull request

On the Bitbucket page of your repository, press the pull request button, describe your new functionality, and send the pull request to me. I will probably have some questions or suggestions for changes. You can commit those changes, and push them, and they will be added to the pull request. Once we are happy with the changes, I will merge your changes into the main Hatta repository.