|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +lang: en |
| 4 | +title: Contributing |
| 5 | +--- |
| 6 | + |
| 7 | +# Contributing to Black Python Devs |
| 8 | + |
| 9 | +First off, thank you for considering contributing to Black Python Devs website. It's people like you that make Black Python Devs such a great community. |
| 10 | + |
| 11 | +## Code of Conduct |
| 12 | + |
| 13 | +Help us keep this project open and inclusive. Please read and follow our [Code of Conduct](https://github.com/BlackPythonDevs/.github/blob/main/CODE_OF_CONDUCT.md). |
| 14 | + |
| 15 | +## How Can I Contribute? |
| 16 | + |
| 17 | +### 1. Create an Issue (and wait to be assigned) |
| 18 | + |
| 19 | +- Click on the Issues tab in the repository. |
| 20 | + |
| 21 | +  |
| 22 | + |
| 23 | +- Click on the green button with the label **"New issue"** and you should see the image below: |
| 24 | + |
| 25 | +  |
| 26 | + |
| 27 | +- Type in the issue title in the title textbox and type in a clear explanation of the issue in the textarea. You can add images, code snippets, etc to explain your issue. |
| 28 | + |
| 29 | +- Once you are done, you can preview your issue by selecting the Preview tab. If you are satisfied with the issue presentation, you can click on the green "Submit new issue" button to create ypur issue. |
| 30 | + |
| 31 | +- Now you wait for your issue to be assigned to you by a maintainer. You should get an email notification of the issue being assigned to you or you can view the issue assignment in the issue page. It should look similar to this: |
| 32 | + |
| 33 | +  |
| 34 | + |
| 35 | +### 2. Fork the Code |
| 36 | + |
| 37 | +- To fork the repository so you have a copy of the codebase, you will click on the **"Fork"** button from the repository main page |
| 38 | + |
| 39 | +  |
| 40 | + |
| 41 | +- Clicking on the Fork button takes you to the **"Create New Fork"** page where you select the owner (your personal github account) and click on the Create fork button. |
| 42 | + |
| 43 | +  |
| 44 | + |
| 45 | +### 3. Make the changes |
| 46 | + |
| 47 | +- The easiest way to make changes and and test them is by using [](https://codespaces.new/BlackPythonDevs/blackpythondevs.github.io) |
| 48 | + |
| 49 | +- You can also access the Codespaces from the repository main page: |
| 50 | + |
| 51 | +  |
| 52 | + |
| 53 | +- The web version of VSCode should open in a new tab in your browser: |
| 54 | + |
| 55 | +  |
| 56 | + |
| 57 | +- Now that you have the code editor set up, you need to install the dependencies. To do this, you have to open the code editor's terminal and run the command `bundle install`. |
| 58 | + |
| 59 | +- The easiest way to open the terminal is to click on the 3 horizontal lines (also known as hamburger) at the top left of the code editor > Terminal > New Terminal: |
| 60 | + |
| 61 | +  |
| 62 | + |
| 63 | +- In the terminal run the command `bundle install`. |
| 64 | + |
| 65 | +  |
| 66 | + |
| 67 | +- After installing the dependencies, its time to run the application. We do this by running the command `bundle exec jekyll serve` or run the default **Build Task** <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>B</kbd>: |
| 68 | + |
| 69 | +  |
| 70 | + |
| 71 | +- The server address shows `http://127.0.0.1:4000`. This is the address for any local computer so this server will be wrong since the application is running on a remote computer so we have to get the address of that computer. We can get the address by clicking on the Ports tab next to the Terminal: |
| 72 | + |
| 73 | +  |
| 74 | + |
| 75 | +- <kbd>Ctrl</kbd> + Click on the Forwarded Address assigned to Port 4000. This will open the running application in a new tab: |
| 76 | + |
| 77 | +  |
| 78 | + |
| 79 | +- Test your changes (create new tests as needed) |
| 80 | + |
| 81 | +- Submit a Pull Request |
| 82 | + |
| 83 | +🥳 |
| 84 | + |
| 85 | +## Translations |
| 86 | + |
| 87 | +We welcome translations for the Black Python Devs website in all languages! Here's how you can contribute: |
| 88 | + |
| 89 | +The language code being used should be in the format [<ISO 639-1>](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) |
| 90 | + |
| 91 | +1. [**Fork the repository**](#2-fork-the-code): Make a copy of this project on your account. |
| 92 | + |
| 93 | +2. **Create a new branch**: Make a new branch for your translation work to keep it separate from the main project: e.g. `es` . |
| 94 | + |
| 95 | +3. **Translate**: Translate all the content in your preferred language. Please ensure that the translation is accurate and professional. |
| 96 | + |
| 97 | + - Copy `_data/locales/en.yml` to your target language file e.g. `_data/locales/es.yml` and translate all the strings. |
| 98 | + |
| 99 | + - Create a new directory in `_articles/` for your language e.g. `_articles/es/`, copy each guide from `_articles/` into that folder and translate the content in each guide. |
| 100 | + |
| 101 | + - Copy `index.html` to your target language index file e.g. [`_articles/es/index.html`](https://github.com/BlackPythonDevs/blackpythondevs.github.io/blob/HEAD/_articles/es/index.html) and update the `lang:` and add the `permalink:` fields. Example: `lang: es` and `permalink: /es/`. |
| 102 | + |
| 103 | +4. **Submit a Pull Request**: You may send a pull request before all steps above are complete: e.g., you may want to ask for help with translations, or getting tests to pass. However, your pull request will not be merged until all steps above are complete. |
| 104 | + |
| 105 | +Our maintainers will review your pull request and merge it if everything is in order. We appreciate your contribution to making Black Python Devs accessible to more people around the world! |
0 commit comments