|
2 | 2 | title: 'Contributing - Python Cheatsheet'
|
3 | 3 | description: The following is a set of guidelines for contributing to the Python cheatsheet. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document.
|
4 | 4 | date: June 09, 2018
|
5 |
| -updated: July 3, 2022 |
| 5 | +updated: August 03, 2025 |
6 | 6 | ---
|
7 | 7 |
|
8 | 8 | <base-title :title="frontmatter.title" :description="frontmatter.description">
|
9 | 9 | Contributing
|
10 | 10 | </base-title>
|
11 | 11 |
|
12 |
| -First off, thank you for taking the time to contribute! |
| 12 | +First off, thank you for considering contributing to the Python Cheatsheet! It's people like you that make this project a great resource for the Python community. |
13 | 13 |
|
14 |
| -The following is a set of guidelines for contributing to the Python cheatsheet. These are mostly guidelines, not rules. Use your best judgment, and please don't hesitate to propose changes to [this document](https://github.com/wilfredinni/python-cheatsheet/blob/master/src/pages/contributing.md). |
| 14 | +Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue, assessing changes, and helping you finalize your pull requests. |
| 15 | + |
| 16 | +The following is a set of guidelines for contributing. These are mostly guidelines, not rules. Use your best judgment, and please don't hesitate to propose changes to [this document](https://github.com/wilfredinni/python-cheatsheet/blob/master/src/pages/contributing.md). |
15 | 17 |
|
16 | 18 | ## Code of Conduct
|
17 | 19 |
|
18 | 20 | This project and everyone who participates in it is governed by the [Contributor Covenant Code of Conduct ](https://github.com/wilfredinni/python-cheatsheet/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].
|
19 | 21 |
|
20 |
| -## Running the project locally |
| 22 | +## How Can I Contribute? |
21 | 23 |
|
22 |
| -1. Install the [pnpm](https://pnpm.io/installation) package manager |
| 24 | +There are many ways to contribute, from writing code and documentation to submitting bug reports and feature requests. |
23 | 25 |
|
24 |
| - On Linux/macOS: |
| 26 | +- **Reporting Bugs:** If you find a bug, please open an [Issue](https://github.com/wilfredinni/python-cheatsheet/issues) and provide as much information as possible. |
| 27 | +- **Suggesting Enhancements:** Have an idea for a new feature or an improvement to an existing one? Open an [Issue](https://github.com/wilfredinni/python-cheatsheet/issues) to discuss it. |
| 28 | +- **Writing Content:** You can add new cheatsheet pages, blog posts, or improve existing content. |
| 29 | +- **Pull Requests:** If you're ready to contribute code or content, we welcome your [Pull Requests](https://github.com/wilfredinni/python-cheatsheet/pulls). |
| 30 | + |
| 31 | +## Getting Started: Setting Up the Project Locally |
| 32 | + |
| 33 | +Ready to start contributing? Here’s how to set up the project on your local machine. |
| 34 | + |
| 35 | +1. **Fork the Repository** |
| 36 | + |
| 37 | + Start by [forking the repository](https://github.com/wilfredinni/python-cheatsheet/fork) to your own GitHub account. |
| 38 | + |
| 39 | +2. **Clone Your Fork** |
| 40 | + |
| 41 | + Clone your forked repository to your local machine: |
| 42 | + |
| 43 | + ```bash |
| 44 | + git clone https://github.com/YOUR_USERNAME/python-cheatsheet.git |
| 45 | + cd python-cheatsheet |
| 46 | + ``` |
25 | 47 |
|
26 |
| - curl -fsSL https://get.pnpm.io/install.sh | sh - |
| 48 | +3. **Install pnpm** |
| 49 | + |
| 50 | + This project uses [pnpm](https://pnpm.io/installation) as its package manager. If you don't have it, install it: |
| 51 | +
|
| 52 | + On Linux/macOS: |
| 53 | + ```bash |
| 54 | + curl -fsSL https://get.pnpm.io/install.sh | sh - |
| 55 | + ``` |
27 | 56 |
|
28 | 57 | On Windows (PowerShell):
|
| 58 | + ```bash |
| 59 | + iwr https://get.pnpm.io/install.ps1 -useb | iex |
| 60 | + ``` |
| 61 | +
|
| 62 | +4. **Install Dependencies** |
| 63 | +
|
| 64 | + Install the project dependencies using pnpm: |
| 65 | +
|
| 66 | + ```bash |
| 67 | + pnpm install |
| 68 | + ``` |
| 69 | +
|
| 70 | +5. **Create a New Branch** |
| 71 | +
|
| 72 | + Create a descriptive branch for your changes: |
| 73 | +
|
| 74 | + ```bash |
| 75 | + git checkout -b your-branch-name |
| 76 | + ``` |
| 77 | + For example: `git checkout -b feat/add-asyncio-cheatsheet` or `git checkout -b fix/typo-in-basics`. |
| 78 | +
|
| 79 | +6. **Run the Development Server** |
| 80 | +
|
| 81 | + Start the local development server to see your changes live: |
| 82 | +
|
| 83 | + ```bash |
| 84 | + pnpm dev |
| 85 | + ``` |
| 86 | + The site will be available at `http://localhost:3333`. |
| 87 | +
|
| 88 | +## Making and Submitting Changes |
| 89 | +
|
| 90 | +### Content Contribution Guide |
| 91 | +
|
| 92 | +#### Adding a New Cheatsheet Page |
| 93 | +
|
| 94 | +1. Create a new Markdown file in `docs/cheatsheet/`. |
| 95 | +2. Add the following frontmatter and structure: |
| 96 | +
|
| 97 | + ```markdown |
| 98 | + --- |
| 99 | + title: Topic Name - Python Cheatsheet |
| 100 | + description: Brief description of the topic |
| 101 | + --- |
| 102 | +
|
| 103 | + <base-title :title="frontmatter.title" :description="frontmatter.description"> |
| 104 | + Topic Name |
| 105 | + </base-title> |
| 106 | +
|
| 107 | + ## Section 1 |
| 108 | +
|
| 109 | + Your content here... |
| 110 | + ``` |
| 111 | +
|
| 112 | +3. Add the new page to the navigation in `src/store/navigation.ts`. |
| 113 | +
|
| 114 | +#### Adding a New Blog Post |
| 115 | +
|
| 116 | +1. Create a new Markdown file in `docs/blog/`. |
| 117 | +2. Use this template for your blog post: |
| 118 | +
|
| 119 | + ```markdown |
| 120 | + --- |
| 121 | + title: Post Title - Python Cheatsheet |
| 122 | + description: Post description |
| 123 | + date: MMM DD, YYYY |
| 124 | + updated: MMM DD, YYYY |
| 125 | + tags: python, topic, level |
| 126 | + socialImage: /blog/image.jpg |
| 127 | + --- |
| 128 | +
|
| 129 | + <route lang="yaml"> |
| 130 | + meta: |
| 131 | + layout: article |
| 132 | + # You must duplicate the frontmatter here for SSG |
| 133 | + title: Post Title - Python Cheatsheet |
| 134 | + description: Post description |
| 135 | + date: MMM DD, YYYY |
| 136 | + updated: MMM DD, YYYY |
| 137 | + tags: [python, topic, level] |
| 138 | + socialImage: /blog/image.jpg |
| 139 | + </route> |
| 140 | +
|
| 141 | + <blog-title-header :frontmatter="frontmatter" title="Display Title" /> |
| 142 | +
|
| 143 | + Your blog content here... |
| 144 | + ``` |
29 | 145 |
|
30 |
| - iwr https://get.pnpm.io/install.ps1 -useb | iex |
| 146 | +### Running Linters and Type Checking |
31 | 147 |
|
32 |
| -2. Clone the project, and install the dependencies: |
| 148 | +Before submitting your changes, make sure your code adheres to the project's style and passes all checks: |
33 | 149 |
|
34 |
| - git clone https://github.com/wilfredinni/python-cheatsheet.git |
35 |
| - cd python-cheatsheet |
36 |
| - pnpm install |
| 150 | +```bash |
| 151 | +pnpm lint |
| 152 | +pnpm typecheck |
| 153 | +``` |
37 | 154 |
|
38 |
| -3. Create a new branch: |
| 155 | +### Submitting Your Changes |
39 | 156 |
|
40 |
| - git branch fix_bug |
41 |
| - git checkout fix_bug |
| 157 | +1. **Commit Your Changes** |
42 | 158 |
|
43 |
| -4. Change/upgrade/add the changes you want |
44 |
| -5. Update the `README` if needed |
45 |
| -6. `Add`, `commit` and `push` your changes to GitHub: |
| 159 | + Add and commit your changes with a clear and descriptive message: |
46 | 160 |
|
47 |
| - git add . |
48 |
| - git commit -m 'succinct explanation of what changed' |
49 |
| - git push origin fix_bug |
| 161 | + ```bash |
| 162 | + git add . |
| 163 | + git commit -m "feat: Add cheatsheet for XYZ" |
| 164 | + ``` |
50 | 165 |
|
51 |
| -7. Open a [pull request](https://github.com/wilfredinni/python-cheatsheet/pulls) |
| 166 | +2. **Push to Your Fork** |
52 | 167 |
|
53 |
| -## You can: |
| 168 | + Push your branch to your fork on GitHub: |
54 | 169 |
|
55 |
| -- Submit changes to the cheatsheet |
56 |
| -- Improve existing topics and examples |
57 |
| -- Add new topics or resources |
58 |
| -- Ask for new topics by creating an [Issue](https://github.com/wilfredinni/python-cheatsheet/issues) |
59 |
| -- Read the issues, fork the project and do a [Pull Request](https://github.com/wilfredinni/python-cheatsheet/pulls) |
60 |
| -- Report any kind of error or typo by creating an [Issue](https://github.com/wilfredinni/python-cheatsheet/issues) or fix it with a [Pull Request](https://github.com/wilfredinni/python-cheatsheet/pulls) |
| 170 | + ```bash |
| 171 | + git push origin your-branch-name |
| 172 | + ``` |
61 | 173 |
|
62 |
| -## What you need to know |
| 174 | +3. **Open a Pull Request** |
63 | 175 |
|
64 |
| -If you don't know where to start: |
| 176 | + Go to the original repository and open a [new pull request](https://github.com/wilfredinni/python-cheatsheet/pulls). Provide a clear title and description of your changes. |
65 | 177 |
|
66 |
| -- [Mastering Markdown](https://guides.github.com/features/mastering-markdown/) |
67 |
| -- [Mastering Issues](https://guides.github.com/features/issues/) |
68 |
| -- [Forking Projects](https://guides.github.com/activities/forking/) |
69 |
| -- And read the rest of the [GitHub Guides](https://guides.github.com/) |
| 178 | +Thank you for your contribution! |
0 commit comments