Skip to content

Commit 3160720

Browse files
committed
differences for PR #243
1 parent 85dc62b commit 3160720

6 files changed

Lines changed: 132 additions & 1116 deletions

File tree

config.yaml

Lines changed: 0 additions & 92 deletions
This file was deleted.

episodes.md

Lines changed: 110 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ exercises: 2
1414
- What syntax do you use to write links?
1515
- How do you include images?
1616
- How do you include math?
17+
- How do you include Glosario terms?
1718

1819
::::::::::::::::::::::::::::::::::::::::::::::::
1920

@@ -1082,13 +1083,120 @@ pie(
10821083

10831084
## Math
10841085

1085-
One of our episodes contains $\LaTeX$ equations when describing how to create
1086-
dynamic reports with {knitr}, so we now use mathjax to describe this:
1086+
One of our episodes contains $\LaTeX$ equations when describing how to create dynamic reports with {knitr}, so we now use mathjax to describe this:
10871087

10881088
`$\alpha = \dfrac{1}{(1 - \beta)^2}$` becomes: $\alpha = \dfrac{1}{(1 - \beta)^2}$
10891089

10901090
Cool, right?
10911091

1092+
1093+
## Glosario Terms
1094+
1095+
[Glosario](https://glosario.carpentries.org) is the Carpentries data science glossary that is developed by the international community, providing terms, definitions and translations to make lessons more accessible.
1096+
1097+
{sandpaper} can automatically generate glossary links in lessons from links to Glosario terms in lesson content markdown.
1098+
1099+
### Configuration
1100+
1101+
Firstly, to enable this behaviour, the `glosario` key needs to be added to a lesson's `config.yaml`.
1102+
1103+
For automatic retrieval of the latest `glossary.yml` from Glosario's GitHub repository, set:
1104+
1105+
```yaml
1106+
glosario: true
1107+
```
1108+
1109+
For manual retrieval from a local (e.g. working on your lesson offline) or remote location (e.g. providing a specific Glosario version), supply a string relative/absolute path or URL to the config:
1110+
1111+
```yaml
1112+
# load a glossary from a local file using an absolute path
1113+
glosario: "/path/to/your/glossary.yml"
1114+
1115+
# load a glossary from a local file using path relative to the lesson
1116+
glosario: "../glossary.yml"
1117+
1118+
# load a glossary from a remote location
1119+
glosario: "https://foo.com/glossary.yml"
1120+
```
1121+
1122+
### Lesson content
1123+
1124+
For example, the [datacarpentry/spreadsheet-ecology-lesson](https://github.com/datacarpentry/spreadsheet-ecology-lesson/blob/main/episodes/01-format-data.md) contains the following markdown:
1125+
1126+
```
1127+
The most common mistake made is treating spreadsheet programs like lab notebooks, that is, relying on context,
1128+
notes in the margin, spatial layout of data and fields to convey information. As humans, we can (usually) interpret
1129+
these things, but computers don't view information the same way, and unless we explain to the computer what
1130+
every single thing means (and that can be hard!), it will not be able to see how our data fits together.
1131+
1132+
Using the power of computers, we can manage and analyze data in much more effective and faster ways, but to
1133+
use that power, we have to set up our data for the computer to be able to understand it (and computers are very literal).
1134+
```
1135+
1136+
A lesson maintainer/contributor can add placeholders into the main content of lessons that sandpaper will subsequently process.
1137+
1138+
Sandpaper understands links to Glosario terms in two ways, either a template-style term, or a hard link to the term page, i.e.:
1139+
1140+
- `{{ glosario.<term> }}`
1141+
- `[<term>](https://glosario.carpentries.org/en/#<term>)`
1142+
1143+
:::::::::::::: callout
1144+
1145+
## Automatic language selection
1146+
1147+
When using the template-style term, sandpaper will automatically generate the URL link using the language specified in the `config.yaml` `lang` setting.
1148+
1149+
When using the markdown link style, sandpaper will automatically replace the `en/` in the link with the language specified in the `config.yaml` `lang` setting.
1150+
1151+
For example, if the `config.yaml` language is set to `lang: de`:
1152+
1153+
`[data_structure](https://glosario.carpentries.org/en/#data_structure)`
1154+
1155+
will be replaced with:
1156+
1157+
`[data_structure](https://glosario.carpentries.org/de/#data_structure)`
1158+
1159+
If the term is not available in that language, a warning will be printed when the lesson builds, and it will default back to English.
1160+
1161+
::::::::::::::::::::::
1162+
1163+
### Example output
1164+
1165+
In the first example, to add a glosario link to the term `data structure` at the URL `https://glosario.carpentries.org/en/#data_structure`, the markdown becomes:
1166+
1167+
```
1168+
The most common mistake made is treating spreadsheet programs like lab notebooks, that is, relying on context,
1169+
notes in the margin, spatial layout of data and fields to convey information. As humans, we can (usually) interpret
1170+
these things, but computers don't view information the same way, and unless we explain to the computer what
1171+
every single thing means (and that can be hard!), it will not be able to see how our data fits together. This is called
1172+
the data structure {{ glosario.data_structure }}.
1173+
```
1174+
1175+
Similarly, to add a link using the inline markdown link syntax, the markdown becomes:
1176+
1177+
```
1178+
Using the power of computers, we can manage and analyze data in much more effective and faster ways, but to
1179+
use that power, we have to set up our data for the computer to be able to understand it
1180+
(and computers are very [literal](https://glosario.carpentries.org/en/#literal)).
1181+
```
1182+
1183+
Once the lesson is built, this will produce the following output:
1184+
1185+
![Example of superscript and inline Glosario link generation](fig/glosario-link-example.png){alt='Screenshot of a lesson with a Glosario link as a superscript and an inline link.'}
1186+
1187+
In the first example, `{{ glosario.data_structure }}` adds a `data_structure` link as a superscript inline.
1188+
1189+
In the second example, a typical markdown link will be inserted.
1190+
1191+
In either case, sandpaper will find these links and add them to the global `reference.md` page in your lesson, built as `reference.html`, and linked in the top lesson menu as `Glossary`:
1192+
1193+
![Example of automatic inclusion of Glosario links in the Glossary page](fig/glosario-glossary-page.png){alt='Screenshot of a lesson with Glosario links in the Glossary reference page.'}
1194+
1195+
### Unavailable terms
1196+
1197+
Users will receive a warning when using terms that are not in the currently selected config.yaml language for the lesson:
1198+
1199+
10921200
:::::::::::::::: keypoints :::::::::::::::::::::
10931201

10941202
- Use `.Rmd` files for lessons even if you don't need to generate any code
@@ -1104,4 +1212,3 @@ Cool, right?
11041212
current working proposal is to call these "chapters".
11051213
[^worry]: Do not worry if you aren't comfortable yet, that's what we will show
11061214
you in this episode!
1107-

fig/glosario-glossary-page.png

62.6 KB
Loading

fig/glosario-link-example.png

54 KB
Loading

md5sum.txt

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
"file" "checksum" "built" "date"
2-
"CODE_OF_CONDUCT.md" "8d9e44dd5c39f241b5e8b47ecfc802d1" "site/built/CODE_OF_CONDUCT.md" "2025-07-15"
3-
"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2025-07-15"
4-
"config.yaml" "3e1f5d33d43d4398c6f6bf660c0e88d0" "site/built/config.yaml" "2025-07-15"
5-
"index.md" "4d117199b579f6901292749f1a414a00" "site/built/index.md" "2025-07-15"
6-
"links.md" "a7ea11385a9d821b8f57edb0951c83ca" "site/built/links.md" "2025-07-15"
7-
"episodes/introduction.md" "b1ca0d51bfee1538beabc08f46b389cf" "site/built/introduction.md" "2025-07-15"
8-
"episodes/episodes.Rmd" "4f9401544dcfcd6d0ba5b61dca806f04" "site/built/episodes.md" "2025-07-15"
9-
"episodes/editing.md" "8c96f675957e4af4f62aea13fb1d799e" "site/built/editing.md" "2025-07-15"
10-
"episodes/example.Rmd" "215e3c4ed500fef3410f040349fb0a73" "site/built/example.md" "2025-07-15"
11-
"episodes/deployment.md" "f15377cac190ef5435a60d074aa8aeb3" "site/built/deployment.md" "2025-07-15"
12-
"episodes/update.md" "e3939117fb9b893806c4f43e7f08594e" "site/built/update.md" "2025-07-15"
13-
"episodes/pull-request.md" "2afffbb78274f9054f55cc7756c9ee03" "site/built/pull-request.md" "2025-07-15"
14-
"instructors/instructor-notes.md" "52cc20bd20dc02bf0f9df0f583a6c2ff" "site/built/instructor-notes.md" "2025-07-15"
15-
"learners/reference.md" "3eeb20922176cd8397cbe420532fd21c" "site/built/reference.md" "2025-07-15"
16-
"learners/setup.md" "61754cdfdaa08ff73f388fea6c5c9522" "site/built/setup.md" "2025-07-15"
17-
"learners/github-pat.md" "65a2c6f46233a1335a6fc0392cb8a405" "site/built/github-pat.md" "2025-07-15"
18-
"learners/component-guide.md" "77bc5292747a4d06561e1e27861585cc" "site/built/component-guide.md" "2025-07-15"
19-
"learners/migrating-from-styles.md" "78ee8810ea993101c4e35b36625e3eb2" "site/built/migrating-from-styles.md" "2025-07-22"
20-
"learners/style.md" "137e358987522d2c971dc1d966e792d1" "site/built/style.md" "2025-07-25"
21-
"profiles/maintainer.md" "2a2b790c0aa8da5fb72e323e4fafabd9" "site/built/maintainer.md" "2025-07-15"
22-
"profiles/instructor.md" "ff8c586028a5e1c7ef0be4178b40417c" "site/built/instructor.md" "2025-07-15"
23-
"renv/profiles/lesson-requirements/renv.lock" "f0e3c6ce1b6d52ad51fa93a62a18b711" "site/built/renv.lock" "2025-07-15"
2+
"CODE_OF_CONDUCT.md" "8d9e44dd5c39f241b5e8b47ecfc802d1" "site/built/CODE_OF_CONDUCT.md" "2025-08-07"
3+
"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2025-08-07"
4+
"config.yaml" "3e1f5d33d43d4398c6f6bf660c0e88d0" "site/built/config.yaml" "2025-08-07"
5+
"index.md" "4d117199b579f6901292749f1a414a00" "site/built/index.md" "2025-08-07"
6+
"links.md" "a7ea11385a9d821b8f57edb0951c83ca" "site/built/links.md" "2025-08-07"
7+
"episodes/introduction.md" "b1ca0d51bfee1538beabc08f46b389cf" "site/built/introduction.md" "2025-08-07"
8+
"episodes/episodes.Rmd" "63b7b44f40abfc3770add07bd472fa27" "site/built/episodes.md" "2025-08-07"
9+
"episodes/editing.md" "8c96f675957e4af4f62aea13fb1d799e" "site/built/editing.md" "2025-08-07"
10+
"episodes/example.Rmd" "215e3c4ed500fef3410f040349fb0a73" "site/built/example.md" "2025-08-07"
11+
"episodes/deployment.md" "f15377cac190ef5435a60d074aa8aeb3" "site/built/deployment.md" "2025-08-07"
12+
"episodes/update.md" "e3939117fb9b893806c4f43e7f08594e" "site/built/update.md" "2025-08-07"
13+
"episodes/pull-request.md" "2afffbb78274f9054f55cc7756c9ee03" "site/built/pull-request.md" "2025-08-07"
14+
"instructors/instructor-notes.md" "52cc20bd20dc02bf0f9df0f583a6c2ff" "site/built/instructor-notes.md" "2025-08-07"
15+
"learners/reference.md" "3eeb20922176cd8397cbe420532fd21c" "site/built/reference.md" "2025-08-07"
16+
"learners/setup.md" "61754cdfdaa08ff73f388fea6c5c9522" "site/built/setup.md" "2025-08-07"
17+
"learners/github-pat.md" "65a2c6f46233a1335a6fc0392cb8a405" "site/built/github-pat.md" "2025-08-07"
18+
"learners/component-guide.md" "77bc5292747a4d06561e1e27861585cc" "site/built/component-guide.md" "2025-08-07"
19+
"learners/migrating-from-styles.md" "78ee8810ea993101c4e35b36625e3eb2" "site/built/migrating-from-styles.md" "2025-08-07"
20+
"learners/style.md" "137e358987522d2c971dc1d966e792d1" "site/built/style.md" "2025-08-07"
21+
"profiles/maintainer.md" "2a2b790c0aa8da5fb72e323e4fafabd9" "site/built/maintainer.md" "2025-08-07"
22+
"profiles/instructor.md" "ff8c586028a5e1c7ef0be4178b40417c" "site/built/instructor.md" "2025-08-07"
23+
"renv/profiles/lesson-requirements/renv.lock" "309c07a13862970a1d51a2e77bc3faa3" "site/built/renv.lock" "2025-08-07"

0 commit comments

Comments
 (0)