-
Notifications
You must be signed in to change notification settings - Fork 163
Update concept introductions spec #2767
Comments
Will you also provide tooling to make sure that the introduction.md is always in sync with the source files? |
Do you mean checking if regenerating the |
Yes |
I think that's a totally reasonable feature! |
(cc @exercism/track-maintainers) |
I like this idea in principle, but I hope that we can resolve one long-standing wart of existing tooling: when markdown files get included, they're copied as-is. This means that the concept exercise introductions would have to use Instead, when including a markdown file, it should be edited in passing to add It may be worth renaming |
The new |
In the evolving spec issue, we proposed a change to the exercise's
introduction.md
files, namely that each concept that an exercise unlocks should have a section in the exercise'sintroduction.md
file, with its heading matching the concept slug. The goal of this is to display this introductory text when a student views the concept's page without having unlocked the concept (unlocking the concept would result in the concept'sabout.md
file being shown). The introduction text is thus presented outside the context of an exercise.Since then, as people have started to implement this, there has been some resistance. Specifically the following have frustrated people:
We are therefore suggesting some changes to the spec. For those who have already done the work, we will script these changes based on what you've done, so your work so far has not been in vain. The core change is to add an
introduction.md
document in the concept's documents directory (concepts/<concept>
) that already containsabout.md
andlinks.json
files:The goal of this
introduction.md
document is to be presented stand-alone, without the context of an exercise, and to give a brief introduction to the concept.Besides solving the above mentioned issues, this approach has the following benefits:
introduction.md
document is not necessarily tied to an exercise, it could be subtly different from the exercise-specific introduction, for example by "selling" the concept a bit more.While the concept description in the exercise's introduction.md may be different to this introduction in the concept directory, we do have to account for the fact that people might just want to include a concept's
introduction.md
text contents as is in the exercise'sintroduction.md
document. In fact, for today, that is the likely situation for most tracks who don't have time for the extra work. For that it was suggested to use some cross-linking Markdown feature, like the one discussed in this issue. Theintroduction.md
would then look something like this (exact format to be determined):Basically, we'd have placeholders referring to concepts that would be replaced with the concept's introduction text. Putting these placeholders in the exercise's
introduction.md
itself does have one big disadvantage: it becomes much harder to see what text is presented to the student. As a maintainer, you'd very likely want to carefully consider the exact text that is presented to the student, so the above is not ideal. To work around this, we're suggesting that exercises that want to refer to concept documentation can use a template file (introduction.tpl.md
) that would contain the markdown above, and which we then use to generate the actualintroduction.md
which also sits in the repository (like how theREADME.md
file of v2 exercises is generated). We'd provide tooling to generate theintroduction.md
based on the template. This allows you to see the whole file before committing, but also use templating syntax.The benefit of the above approach are:
introduction.md
document still contains the full contents that is displayed to the studentTo summarise:
If the above approach is approved, we'll write a script to automatically generate the concept introduction documents. Each track can indicate if they want to use the templating approach or not, which the script will accommodate. This does depend on the concept headings PR's being merged (7 are still open) and a decision being made on the templating format.
The text was updated successfully, but these errors were encountered: