| 1 | --- |
| 2 | myst: |
| 3 | html_meta: |
| 4 | "description lang=en": | |
| 5 | Documentation for contributors who wish to improve this library. |
| 6 | --- |
| 7 | |
| 8 | # Contribute |
| 9 | |
| 10 | There are various ways in which you can contribute to this library. |
| 11 | |
| 12 | ## Support this library |
| 13 | |
| 14 | Please support the development and upkeep in one of these ways: |
| 15 | |
| 16 | - [Support using GitHub Sponsors](https://github.com/sponsors/niccokunzmann) |
| 17 | - [Fund specific issues using Polar](https://polar.sh/niccokunzmann/python-recurring-ical-events) |
| 18 | - [Support using Open Collective](https://opencollective.com/open-web-calendar/) |
| 19 | - [Support using thanks.dev](https://thanks.dev) |
| 20 | |
| 21 | We accept donations to sustain our work, once or regular. |
| 22 | Consider donating money to open-source as everyone benefits. |
| 23 | |
| 24 | ## Improve the documentation |
| 25 | |
| 26 | Your help with this documentation is very welcome! |
| 27 | Please feel free to edit the pages with the "Edit on GitHub" button on the side. |
| 28 | With a GitHub account, your contribution will be guided towards a [pull request] |
| 29 | and we can have a look and use your suggestions. |
| 30 | |
| 31 | For style and formatting, please consult the [documentation reference section]. |
| 32 | |
| 33 | [documentation reference section]: ../reference/documentation |
| 34 | |
| 35 | ## Setup to develop |
| 36 | |
| 37 | This section informs you how to work on this project. |
| 38 | |
| 39 | ### Code style |
| 40 | |
| 41 | Please install [pre-commit] before git commit. |
| 42 | It will ensure that the code is formatted and linted as expected using [ruff]. |
| 43 | |
| 44 | ```sh |
| 45 | pre-commit install |
| 46 | ``` |
| 47 | |
| 48 | [pre-commit]: https://pre-commit.com/ |
| 49 | [ruff]: https://docs.astral.sh/ruff/ |
| 50 | |
| 51 | ### Testing |
| 52 | |
| 53 | This project's development is driven by tests. |
| 54 | Tests assure a consistent interface and less knowledge lost over time. |
| 55 | If you like to change the code, tests help that nothing breaks in the future. |
| 56 | They are required in that sense. |
| 57 | Example code and ics files can be transferred into tests and speed up fixing bugs. |
| 58 | |
| 59 | You can view the tests in the [test folder] |
| 60 | If you have a calendar ICS file for which this library does not |
| 61 | generate the desired output, you can add it to the `test/calendars` |
| 62 | folder and write tests for what you expect. |
| 63 | If you like, open an [issue] first, e.g. to discuss the changes and |
| 64 | how to go about it. |
| 65 | |
| 66 | To run the tests, we use `tox`. |
| 67 | `tox` tests all different Python versions which we want to be compatible to. |
| 68 | |
| 69 | ```sh |
| 70 | pip3 install tox |
| 71 | ``` |
| 72 | |
| 73 | After installing `tox`, run the tests with your current Python version: |
| 74 | |
| 75 | ```sh |
| 76 | tox -e py |
| 77 | ``` |
| 78 | |
| 79 | .. info:: |
| 80 | |
| 81 | With this, you have all the tools to develop and improve this project. |
| 82 | Please open an [pull request] as soon as you made a change. |
| 83 | This is not about being perfect, only about doing your part of the communication. |
| 84 | Your are welcome! |
| 85 | |
| 86 | [pull request]: https://github.com/niccokunzmann/python-recurring-ical-events/pull |
| 87 | |
| 88 | #### Extended Testing |
| 89 | |
| 90 | When you create a pull request, we will run the tests in all Python versions. |
| 91 | You can do that, too. |
| 92 | |
| 93 | ```sh |
| 94 | tox |
| 95 | ``` |
| 96 | |
| 97 | To run the tests in a specific Python version: |
| 98 | |
| 99 | ```sh |
| 100 | tox -e py39 |
| 101 | ``` |
| 102 | |
| 103 | ### Building the documentation |
| 104 | |
| 105 | You can build the documentation locally to see your changes. |
| 106 | To view the documentation in a web page and have it update with every edit, |
| 107 | run the following commands: |
| 108 | |
| 109 | ```sh |
| 110 | cd docs |
| 111 | make livehtml |
| 112 | ``` |
| 113 | |
| 114 | To clean the build folder, run: |
| 115 | |
| 116 | ```sh |
| 117 | make clean |
| 118 | ``` |
| 119 | |
| 120 | Commits are tested online to check if the documentation does not contain any |
| 121 | errors or warnings. |
| 122 | To run these checks and see if you can publish the changes, run: |
| 123 | |
| 124 | ```sh |
| 125 | tox -e docs |
| 126 | ``` |
| 127 | |
| 128 | [test folder]: https://github.com/niccokunzmann/python-recurring-ical-events/tree/master/test |
| 129 | [issue]: https://github.com/niccokunzmann/python-recurring-ical-events/issues |