[WIP] Automated processing and page generation of glosario links in lessons #612
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.
Implementation description
This PR is a work in progress to implement a core part of the Mellon Foundation grant to the Carpentries to automatically generate glossary pages in lessons from links to Glosario terms.
Configuration
Firstly, to enable this behaviour, the following line needs to be added to a lesson's config.yaml:
glosario: true
Lesson content
For example, the spreadsheet-ecology-lesson contains the following markdown:
Secondly, a lesson maintainer/contributor will add placeholders into the main content of lessons that sandpaper will subsequently process. Sandpaper understands links to Glosario terms in two ways, either a template-style term, or a hard link to the term page, i.e.:
{{ glosario.<term>}}
[<term>](https://glosario.carpentries.org/en/#<term>)
Example output
In the first example, to add a glosario link to the term
data structure
at the URLhttps://glosario.carpentries.org/en/#data_structure
, the markdown becomes:Similarly, to add a link using the second example:
Once the lesson is built with
sandpaper::serve()
, this will produce the following output:In the first example,
{{ glosario.data_structure }}
adds adata_structure
link as a superscript inline. In the second example, it looks more like a typical markdown link.In either case, sandpaper will find these links and add them to a global page in your lesson called
glossary.html
:Things left to do
reference.md#glossary
implementation, or add the glosario links to the same page?literal
in the example above