You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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.
1087
+
1088
+
{sandpaper} can automatically generate glossary links in lessons from links to Glosario terms in lesson content markdown.
1089
+
1090
+
### Configuration
1091
+
1092
+
Firstly, to enable this behaviour, the `glosario` key needs to be added to a lesson's `config.yaml`.
1093
+
1094
+
For automatic retrieval of the latest `glossary.yml` from Glosario's GitHub repository, set:
1095
+
1096
+
```yaml
1097
+
glosario: true
1098
+
```
1099
+
1100
+
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:
1101
+
1102
+
```yaml
1103
+
# load a glossary from a local file using an absolute path
1104
+
glosario: "/path/to/your/glossary.yml"
1105
+
1106
+
# load a glossary from a local file using path relative to the lesson
1107
+
glosario: "../glossary.yml"
1108
+
1109
+
# load a glossary from a remote location
1110
+
glosario: "https://foo.com/glossary.yml"
1111
+
```
1112
+
1113
+
### Lesson content
1114
+
1115
+
A lesson maintainer/contributor can add placeholders into the main content of lessons that sandpaper will subsequently process.
1116
+
1117
+
Sandpaper understands links to Glosario terms in two ways, either a template-style term, or a hard link to the term page, i.e.:
When using the template-style term, sandpaper will automatically generate the URL link using the language specified in the `config.yaml` `lang` setting.
1127
+
1128
+
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.
1129
+
1130
+
For example, if the `config.yaml` language is set to `lang: de`:
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.
1139
+
1140
+
::::::::::::::::::::::
1141
+
1142
+
### Example output
1143
+
1144
+
To look at a specific example, the [datacarpentry/spreadsheet-ecology-lesson](https://github.com/datacarpentry/spreadsheet-ecology-lesson/blob/main/episodes/01-format-data.md) can be edited to include Glosario links.
1145
+
1146
+
To add a glosario link to the term `data structure` at the URL `https://glosario.carpentries.org/en/#data_structure`, the markdown becomes:
1147
+
1148
+
```
1149
+
The most common mistake made is treating spreadsheet programs like lab notebooks, that is, relying on context,
1150
+
notes in the margin, spatial layout of data and fields to convey information. As humans, we can (usually) interpret
1151
+
these things, but computers don't view information the same way, and unless we explain to the computer what
1152
+
every single thing means (and that can be hard!), it will not be able to see how our data fits together. This is called
1153
+
the data structure {{ glosario.data_structure }}.
1154
+
```
1155
+
1156
+
Similarly, to add a link using the inline markdown link syntax, the markdown becomes:
1157
+
1158
+
```
1159
+
Using the power of computers, we can manage and analyze data in much more effective and faster ways, but to
1160
+
use that power, we have to set up our data for the computer to be able to understand it
1161
+
(and computers are very [literal](https://glosario.carpentries.org/en/#literal)).
1162
+
```
1163
+
1164
+
Once the lesson is built, this will produce the following output:
1165
+
1166
+
{alt='Screenshot of a lesson with a Glosario link as a superscript and an inline link.'}
1167
+
1168
+
In the first example, `{{ glosario.data_structure }}` adds a `data_structure` link as a superscript inline.
1169
+
1170
+
In the second example, a typical markdown link will be inserted.
1171
+
1172
+
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`:
1173
+
1174
+
{alt='Screenshot of a lesson with Glosario links in the Glossary reference page.'}
1175
+
1176
+
### Unavailable terms
1177
+
1178
+
Users will receive a warning when using terms that are not in the currently selected config.yaml language for the lesson:
1179
+
1180
+
1083
1181
:::::::::::::::: keypoints :::::::::::::::::::::
1084
1182
1085
1183
- Use `.Rmd` files for lessons even if you don't need to generate any code
@@ -1095,4 +1193,3 @@ Cool, right?
1095
1193
current working proposal is to call these "chapters".
1096
1194
[^worry]: Do not worry if you aren't comfortable yet, that's what we will show
0 commit comments