Skip to content

Commit

Permalink
Merge pull request #3 from Openscapes/files
Browse files Browse the repository at this point in the history
Add Practice section with demo files
  • Loading branch information
stefaniebutland authored May 22, 2024
2 parents 1cb5f51 + 5de0648 commit 1f29612
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 1 deletion.
5 changes: 4 additions & 1 deletion _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ website:
text: Explore
- section: workflows/index.qmd
contents:
- workflows/jupyter.qmd
- href: workflows/jupyter.qmd
- section: practice/index.qmd
contents:
- practice/demo.qmd
- href: where-to-contribute.qmd
text: Where to Contribute

Expand Down
19 changes: 19 additions & 0 deletions practice/demo.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: "`demo.ipynb`"
---

Quarto can render Jupyter notebooks represented as plain text (.qmd) or as a normal notebook file (.ipynb). One benefit of using .ipynb is that you can use JupyterLab as your editor. ([Documentation](https://quarto.org/docs/tools/jupyter-lab.html))

#| label: fig-polar
#| fig-cap: "A line plot on a polar axis"
import numpy as np
import matplotlib.pyplot as plt
r = np.arange(0, 2, 0.01)
theta = 2 * np.pi * r
fig, ax = plt.subplots(
subplot_kw = {'projection': 'polar'}
)
ax.plot(theta, r)
ax.set_rticks([0.5, 1, 1.5, 2])
ax.grid(True)
plt.show()
89 changes: 89 additions & 0 deletions practice/demo.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: "`demo.qmd`"
---

*Modify it to contain the content we want for Quarto Clinic:*

- *fix a typo*

- *python code to run*
- *R code to run*



## Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.

## Running Code

When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this:

```{r}
1 + 1
```

You can add options to executable code like this

```{python}
#| echo: false
2 * 2
```

The `echo: false` option disables the printing of code (only output is displayed).


## insert an image
with alt text, edit size - e.g. NASA Openscapes logo





# GitHub practice from the browser

Working on GitHub.com, we contribute changes through **commits**. You'll practice creating several commits by making small edits to a file, writing commit messages, and committing changes to see them posted nicely online to communicate our work. You'll practice with the file with your name on it; everyone has their own file to practice with.

## Task 1: Commit an edit from the browser

Let's edit this file by clicking the pencil icon at the top-right of the file.

Next, make an edit to the text in this file. One idea is to fix this tpyo.

Finally, we will commit these edits to GitHub. To do this, press the green "Commit Changes..." button. Committing changes has two steps: write a human-readable Commit message, and press the green button to commit changes.

Note: In the browser, GitHub will suggest "Update file.md" as the commit message. But you can be more descriptive - practice writing commit messages that help you remember detail about what you changed.

## Task 2: Practice Markdown

Now let's practice Markdown and commit another edit to this file.

This file is written in Markdown, which formats text on the web. To see the Markdown that results in the following formatting, click the pencil icon to edit, or click 'Raw' to inspect it. For example, with Markdown:

We can make words **bold** or *italic*.

### We can make headers.

We can make lists – *note that lists need an empty line before list items!*

1. bananas
2. tamales
3. cakes

We can make hyperlinks in [Markdown](https://quarto.org/docs/authoring/markdown-basics.html) using the `[]()` pattern: you put words to hyperlink in `[]` and the URL in `()`. For example:

> [This twitter thread](https://twitter.com/allison_horst/status/1287772985630191617) describes the palmerpenguins R package. Learn more on the [palmerpenguins webpage](https://allisonhorst.github.io/palmerpenguins).
We can make an indented quote block with the `>` symbol, as in the example above.

We can include an image with the same `[]()` pattern, by adding a preceding exclamation point: `![]()`. For example:

![](../horst-champions-trailhead.png)

*Note that this image lives in the folder one level above our `github-clinic` folder, and we indicate that with the two periods `..`*

Your turn! Change or add something in Markdown and make another commit: write a human-readable commit message, and press the green button to commit changes.

## NOTES

It's a lot to get familiar with markdown if you haven't used it previously!
5 changes: 5 additions & 0 deletions practice/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Practice
---

Now that we have each set up our own GitHub clone of this Quarto Clinic website in the Openscapes 2i2c JupyterHub, we can practice editing and rendering `.qmd` and `ipynb` files. These are the workflows we use to contribute to the NASA Earthdata Cloud Cookbook and other Quarto websites and books.

0 comments on commit 1f29612

Please sign in to comment.