This guide shows you how to contribute to the Black Python Developers website using a development containers. A dev container is a Docker container that provides a full-featured development environment for your project. By using a dev container, you can avoid installing and configuring software on your local machine, and you can ensure that your development environment is consistent and reproducible.
This guide assumes that you have:
- Visual Studio Code.
- The Remote Development Extension Pack.
- Dev Containers extension.
- Git.
- Docker
You also need a GitHub account and a fork of the Black Python Developers repository.
To contribute to the website using a dev container, follow these steps:
- Open the forked repository in Visual Studio Code.
- Click the "Reopen in Container" button in the notification that appears, or use the command "Dev Containers: Reopen in Container" from the Command Palette (F1).
- Wait for the container to build and start.
- Run the website locally and make changes to the code:
You can now work on the website code inside the dev container. The container has the tools that are available such as Python, Ruby, Jekyll, and VS Code extensions. You can also install additional software or extensions if you need to. To run the website locally, follow these steps:
Open a new terminal (Terminal > New Terminal) and enter the command bundle exec jekyll serve
or run the default Build Task (Ctrl+Shift+B). This will start a local web server that hosts the website. You can access the website from your browser by going to http://localhost:4000.
- Commit and push your changes to GitHub. You can use Git to commit and push your changes to GitHub. You can also use the GitHub Pull Requests and Issues extension to manage pull requests and issues from VS Code.
To commit and push your changes using the Source Control view, follow these steps:
- Open the Source Control view (Ctrl+Shift+G) and select the changes that you want to commit.
- Enter a commit message and click the "Commit" button.
- Click the "Synchronize Changes" button to push your changes to GitHub.
To commit and push your changes using the terminal, follow these steps:
- Open a terminal and enter the command
git status
to see the changes that you have made. - Enter the command
git add .
to stage all the changes, orgit add <file>
to stage a specific file. - Enter the command
git commit -m "<message>"
to commit the changes, where is your commit message. - Enter the command
git push
to push your changes to GitHub. - Create a pull request from your forked repository to the original repository.