|
| 1 | +--- |
| 2 | +title: "Contributing" |
| 3 | +--- |
| 4 | + |
| 5 | +# Ways to Contribute |
| 6 | + |
| 7 | +We welcome contributions of all kinds! Your help makes the Cookbook stronger and more useful for the community. There are several ways to get involved, you can: |
| 8 | + |
| 9 | +- 🪲 **Identify a bug or error** |
| 10 | +- 💡 **Suggest a change or improvement** |
| 11 | +- 📘 **Propose a new tutorial or example** |
| 12 | +- 🗣️ **Join a discussion or share an idea** |
| 13 | +- 🚀 **Do some work and make a Pull Request (PR)** |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## For most contributions, the first step is to create an "issue" or "discussion" on GitHub. |
| 18 | + |
| 19 | +You can find the cookbook's current lists of [issues](https://github.com/nsidc/NSIDC-Data-Cookbook/issues) and [discussions](https://github.com/nsidc/NSIDC-Data-Cookbook/discussions) by following the links. |
| 20 | + |
| 21 | +Both are excellent tools for communicating with the Cookbook maintainers, but they each fill slightly different purposes: |
| 22 | + |
| 23 | +| Use this | When you ... | Examples | |
| 24 | +|-------|------------------|---------------------| |
| 25 | +|**Issue** | Need to report a bug, detect missing info, run into a reproducibility problem... in general, find something that is not working! | - “Example X does not work.”<br> - “Can I use `rasterio` rather than `xarray` to open SMAP data?”<br>- "I found a bunch of typos / broken links in one of your notebooks." |
| 26 | +|**Discussion** | Want to share ideas (new tutorials?), ask broad questions (future directions?), or brainstorm approaches (ways we can expand our offerings and reach?)... things that would warrant some back and forth chatting. | - “Do we need a more in-depth description of the WGS84 datum?”<br>- "I have a great idea for a tutorial that answers a specific science question..."<br>- "I wrote some code using NSIDC data that I think could be a great add to the cookbook! Can we talk about it?" |
| 27 | + |
| 28 | + |
| 29 | +## You want to work on the cookbook directly and share your changes! What now? |
| 30 | + |
| 31 | +Once you’ve made updates or created new content, you’ll want to share those changes with the rest of the team. You do this on GitHub through a **Pull Request (PR)**. |
| 32 | + |
| 33 | +A PR is a request to *pull* your changes from your copy of the repository (your *branch* or *fork*) into the main repository. |
| 34 | +It lets others: |
| 35 | + |
| 36 | +- Review and test your work before it becomes part of the Cookbook |
| 37 | +- Discuss possible improvements or adjustments |
| 38 | +- Keep the project organized and version-controlled |
| 39 | + |
| 40 | +In short: a PR is how you propose changes and collaborate safely with others. |
| 41 | + |
| 42 | +### The PR Workflow |
| 43 | + |
| 44 | +This section walks you through the full process of contributing to the Cookbook — from getting your own copy of the repository to submitting a PR for review. |
| 45 | + |
| 46 | + |
| 47 | +#### 1. Get a Copy of the Repository |
| 48 | + |
| 49 | +Have a GitHub account and start by **forking** the repository. A fork is your own copy of the project under your GitHub account where you can freely make changes. |
| 50 | + |
| 51 | +1. Go to the Cookbook’s GitHub page. |
| 52 | +2. Click **Fork** in the upper-right corner. |
| 53 | +3. Choose where to create your fork (your account) and confirm. |
| 54 | + |
| 55 | +Once forked, clone it to your local machine so you can edit files: |
| 56 | + |
| 57 | +```bash |
| 58 | +git clone https://github.com/YOUR-USERNAME/NSIDC-Data-Cookbook.git |
| 59 | +cd NSIDC-Data-Cookbook |
| 60 | +``` |
| 61 | +::: {.callout-tip} |
| 62 | +## Tip |
| 63 | +We know that working with git and repositories can be confusing at first! If you want more details or step-by-step guides, we also recommend these resources: |
| 64 | +[Project Pythia's Github Foundations](https://foundations.projectpythia.org/foundations/github/github-cloning-forking/) and the [NASA Earthdata Cloud Contributing Workflows](https://nasa-openscapes.github.io/earthdata-cloud-cookbook/contributing/workflow.html). |
| 65 | +::: |
| 66 | + |
| 67 | +#### 2. Work on Your Edits Locally |
| 68 | + |
| 69 | +Now that you have your clone, you can make changes freely using your preferred text editor. |
| 70 | + |
| 71 | +First, create a new **branch** for your edits. This keeps your main branch clean and makes it easier to submit your changes later. |
| 72 | + |
| 73 | +```bash |
| 74 | +git checkout -b your-branch-name |
| 75 | +``` |
| 76 | + |
| 77 | +::: {.callout-note} |
| 78 | +## What’s a Branch? |
| 79 | +A **branch** is like a separate workspace within your project. You can make edits on your branch without affecting the main version (`main` or `master`). When you’re done, you can merge your branch back into the main project through a pull request. |
| 80 | +::: |
| 81 | + |
| 82 | +Next, make your changes, whatever they may be. Then, save your edits and preview your changes locally using Quarto to ensure everything looks as expected. |
| 83 | + |
| 84 | +```bash |
| 85 | +quarto preview |
| 86 | +``` |
| 87 | +Everything looks good? Great! |
| 88 | + |
| 89 | +#### 3. Commit and Push Your Changes |
| 90 | + |
| 91 | +Once you’re happy with your edits, commit them and push your branch to your fork on GitHub. Be sure to have your commit message clearly explain your changes to help the maintainers understand your work. |
| 92 | + |
| 93 | +```bash |
| 94 | +git add . |
| 95 | +git commit -m "Brief description of what you changed" |
| 96 | +git push origin your-branch-name |
| 97 | +``` |
| 98 | + |
| 99 | +Almost there! Right now your work is still only in your spaces, though. |
| 100 | + |
| 101 | +#### 4. Open a Pull Request |
| 102 | + |
| 103 | +These next steps will share your work with the Cookbook team. |
| 104 | + |
| 105 | +1. Go to your fork on GitHub. |
| 106 | +2. You’ll see a button that says **Compare & pull request** — click it. |
| 107 | +3. Add a short title and description summarizing your changes. |
| 108 | +4. Submit the pull request (PR) to the main Cookbook repository. |
| 109 | + |
| 110 | +Your changes are now out in the world for anyone interested in the Cookbook to see! |
| 111 | + |
| 112 | +After you open a pull request: |
| 113 | + |
| 114 | +- The Cookbook maintainers will review your changes and may request small edits or have questions. |
| 115 | +- You can continue committing changes to the same branch and they’ll automatically appear in your PR. |
| 116 | +- Once everything looks good, your PR will be approved and merged into the main project. |
| 117 | + |
| 118 | +#### Congratulations! You’ve officially contributed and helped make the Cookbook a better place! 🎉 |
0 commit comments