-
Notifications
You must be signed in to change notification settings - Fork 22
Add CONTRIBUTING.md #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
| # Contributing to GRASS tutorials | ||
|
|
||
| We welcome various contributions — fixing a typo, improving clarity, or adding a new tutorial. | ||
| Not sure where to begin? [Open an issue](https://github.com/OSGeo/grass-tutorials/issues) to start a conversation. | ||
|
|
||
| --- | ||
|
|
||
| ## Getting started | ||
|
|
||
| 1. **Fork and clone** the repository. Then follow the | ||
| [GitHub guide](https://grass.osgeo.org/grass-devel/manuals/github_guide.html) for the GRASS repository and adjust the workflow for this repository. | ||
|
|
||
| 2. **Install Quarto** (if you haven’t already), see <https://quarto.org/docs/get-started/> | ||
|
|
||
| 3. **Preview the site locally:** | ||
|
|
||
| ```sh | ||
| quarto preview | ||
| ``` | ||
|
|
||
| This launches a local server and opens a live preview in your browser. | ||
|
|
||
| 4. **Create or edit tutorials:** | ||
|
|
||
| Tutorials are written in Markdown (.qmd) with YAML front matter. | ||
|
|
||
| Add your tutorial to the appropriate section (e.g., ./content/tutorials/mytutorials). | ||
|
|
||
| ## Writing a tutorial | ||
|
|
||
| Give your audience some context, for example include what topics does | ||
| the tutorial cover, what are the prerequisites, and so on. | ||
|
|
||
| Use Quarto's [guide](https://quarto.org/docs/guide/) to learn how to write | ||
| Quarto documents and learn [Markdown syntax](https://quarto.org/docs/authoring/markdown-basics.html). | ||
|
|
||
| For example, include GRASS commands in fenced code blocks: | ||
|
|
||
| ```` markdown | ||
| ```{python} | ||
| gs.run_command("g.region", raster="elevation") | ||
| ``` | ||
| ```` | ||
|
|
||
| You can use [tabsets](https://quarto.org/docs/output-formats/html-basics.html#tabsets) | ||
| to show how to run GRASS commands in command line and in Python: | ||
|
|
||
| ```` markdown | ||
| ::: {.panel-tabset group="language"} | ||
|
|
||
| ## Command line | ||
|
|
||
| ```{bash} | ||
| g.region raster=elevation | ||
| ``` | ||
|
|
||
| ## Python | ||
|
|
||
| ```{python} | ||
| gs.run_command("g.region", raster="elevation") | ||
| ``` | ||
|
|
||
| ::: | ||
| ```` | ||
|
|
||
| Display notes: | ||
|
|
||
| ``` markdown | ||
| ::: {.callout-note title="Setup"} | ||
| To run this tutorial locally ... | ||
| ::: | ||
| ``` | ||
|
|
||
| ## YAML metadata example | ||
|
|
||
| Each tutorial must begin with YAML metadata like this: | ||
|
|
||
| ```` yaml | ||
| --- | ||
| title: "Computing slope from elevation data in Python" | ||
| author: "Your Name" | ||
| date: "2025-05-15" | ||
| description: "Learn how to derive slope from elevation data in GRASS in a Jupyter Notebook." | ||
| categories: ["beginner", "geomorphometry", Python] | ||
| thumbnail: slope_thumbnail.webp | ||
| format: | ||
| ipynb: default | ||
| html: | ||
| toc: true | ||
| code-tools: true | ||
| code-copy: true | ||
| code-fold: false | ||
| engine: jupyter | ||
| execute: | ||
| eval: false | ||
| jupyter: python3 | ||
| --- | ||
|
|
||
| ```` | ||
|
|
||
| Notes: | ||
|
|
||
| - Use appropriate categories (tags), include whether the tutorial is for *beginner*, *intermediate*, or *advanced* users. | ||
|
|
||
| - Use `eval: false` so that Quarto doesn't run the code during building of the website. | ||
|
|
||
| - Specifying format `ipynb: default` will create a Jupyter notebook during the build process and link it from the tutorial page. | ||
|
|
||
| ## Images | ||
|
|
||
| Beautiful images and graphics make tutorials stand out! | ||
| Make sure the images have *sufficient resolution*. | ||
| At the same time, their size should not be too big to load quickly, try to keep it under 200 KB or so. We recommend using *webp* format. | ||
|
|
||
| ``` markdown | ||
|  | ||
| ``` | ||
|
|
||
| Each tutorial needs to have at least one image that can be used on the main page as a thumbnail. | ||
| You can either specify it in the YAML header (`thumbnail: image.webp`) or add `{.preview-image}` to the image. | ||
|
|
||
| ``` markdown | ||
| {.preview-image} | ||
| ``` | ||
|
|
||
| ## Submitting your contribution | ||
|
|
||
| Check your markdown with a [linter](https://dlaa.me/markdownlint/) and fix as many issues as you can. This will help keeping the tutorials consistent. | ||
|
|
||
| Follow the [GitHub guide](https://grass.osgeo.org/grass-devel/manuals/github_guide.html) | ||
| (adapt it to this repo) to submit your tutorial. | ||
| You should **only commit the .qmd file and images**. | ||
| Once you sumbmit a PR, the CI pipeline will build your | ||
| tutorial, so you and a reviewer can check if everything is ok. | ||
| When a reviewer approves, your PR will be merged soon. | ||
|
|
||
| --- | ||
| Thanks for helping us build better educational resources for the GRASS community! | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.