Development
Contributing
Thank you for considering contributing to An Otter Wiki! If you ran into a problem or want to request a feature, please check the existing issues in case someone else had a similar request and support their case or open a new issue. If you want to contribute code, design or documentation directly, please fork the repository on github. Please make sure all tests pass and submit your changes as a pull request.
Setting up a development environment
Install the prerequisites
- Debian / Ubuntu
apt install git build-essential python3-dev python3-venv
- RHEL8 / Fedora / Centos8 / Rocky Linux 8
yum install make python3-devel
- MacOS
brew install python3
Clone the repository (in case you've created a fork, replace the url with your repository) and enter the directory
git clone https://github.com/redimp/otterwiki.git && cd otterwiki
Create and initialize the repository where the data is stored
mkdir -p app-data/repository # initialize the empty repository git init app-data/repository
Create a minimal configuration file
echo "REPOSITORY='${PWD}/app-data/repository'" >> settings.cfg echo "SQLALCHEMY_DATABASE_URI='sqlite:///${PWD}/app-data/db.sqlite'" >> settings.cfg echo "SECRET_KEY='$(echo $RANDOM | md5sum | head -c 16)'" >> settings.cfg
Run
maketo setup a virtual environment and run a local server on port 8080make debugOpen the wiki in your browser http://127.0.0.1:8080. You can create and edit pages as anonymous user without any further configuration. Please note: This setup is not for production use!
While you edit the code, flask will automatically reload the server.
Run tests
make test
Run coverage tests
make coverageand check
coverage_html/index.htmlfor detailed information.
Writing plugins
An Otter Wiki can be extended with plugins that hook into rendering, templates and repository events. See Developing Plugins for how to write and test your own.
