Skip to content

Commit 1f29612

Browse files
Merge pull request #3 from Openscapes/files
Add Practice section with demo files
2 parents 1cb5f51 + 5de0648 commit 1f29612

File tree

4 files changed

+117
-1
lines changed

4 files changed

+117
-1
lines changed

_quarto.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ website:
3838
text: Explore
3939
- section: workflows/index.qmd
4040
contents:
41-
- workflows/jupyter.qmd
41+
- href: workflows/jupyter.qmd
42+
- section: practice/index.qmd
43+
contents:
44+
- practice/demo.qmd
4245
- href: where-to-contribute.qmd
4346
text: Where to Contribute
4447

practice/demo.ipynb

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
title: "`demo.ipynb`"
3+
---
4+
5+
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))
6+
7+
#| label: fig-polar
8+
#| fig-cap: "A line plot on a polar axis"
9+
import numpy as np
10+
import matplotlib.pyplot as plt
11+
r = np.arange(0, 2, 0.01)
12+
theta = 2 * np.pi * r
13+
fig, ax = plt.subplots(
14+
subplot_kw = {'projection': 'polar'}
15+
)
16+
ax.plot(theta, r)
17+
ax.set_rticks([0.5, 1, 1.5, 2])
18+
ax.grid(True)
19+
plt.show()

practice/demo.qmd

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
title: "`demo.qmd`"
3+
---
4+
5+
*Modify it to contain the content we want for Quarto Clinic:*
6+
7+
- *fix a typo*
8+
9+
- *python code to run*
10+
- *R code to run*
11+
12+
13+
14+
## Quarto
15+
16+
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.
17+
18+
## Running Code
19+
20+
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:
21+
22+
```{r}
23+
1 + 1
24+
```
25+
26+
You can add options to executable code like this
27+
28+
```{python}
29+
#| echo: false
30+
2 * 2
31+
```
32+
33+
The `echo: false` option disables the printing of code (only output is displayed).
34+
35+
36+
## insert an image
37+
with alt text, edit size - e.g. NASA Openscapes logo
38+
39+
40+
41+
42+
43+
# GitHub practice from the browser
44+
45+
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.
46+
47+
## Task 1: Commit an edit from the browser
48+
49+
Let's edit this file by clicking the pencil icon at the top-right of the file.
50+
51+
Next, make an edit to the text in this file. One idea is to fix this tpyo.
52+
53+
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.
54+
55+
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.
56+
57+
## Task 2: Practice Markdown
58+
59+
Now let's practice Markdown and commit another edit to this file.
60+
61+
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:
62+
63+
We can make words **bold** or *italic*.
64+
65+
### We can make headers.
66+
67+
We can make lists – *note that lists need an empty line before list items!*
68+
69+
1. bananas
70+
2. tamales
71+
3. cakes
72+
73+
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:
74+
75+
> [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).
76+
77+
We can make an indented quote block with the `>` symbol, as in the example above.
78+
79+
We can include an image with the same `[]()` pattern, by adding a preceding exclamation point: `![]()`. For example:
80+
81+
![](../horst-champions-trailhead.png)
82+
83+
*Note that this image lives in the folder one level above our `github-clinic` folder, and we indicate that with the two periods `..`*
84+
85+
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.
86+
87+
## NOTES
88+
89+
It's a lot to get familiar with markdown if you haven't used it previously!

practice/index.qmd

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Practice
3+
---
4+
5+
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 commit comments

Comments
 (0)