exercism / v2-configlet

Tool to assist in managing Exercism language tracks.
MIT License
16 stars 23 forks source link

Support a track-wide readme insert as a Go template #114

Open kytrinyx opened 6 years ago

kytrinyx commented 6 years ago

Right now the readme insert is the docs/EXERCISE_README_INSERT.md.

If none of the track's exercises override the readme template by sticking a template in the .meta directory, then the template is not necessary.

However, if an exercise does override the README, then we lose the ability to use template variables in the insert. We need the template variables to correctly generate the command for running the tests.

E.g.: in JavaScript

jasmine {{ .Spec.Slug }}.spec.js

In Ruby:

ruby {{ .Spec.SnakeCaseName}}_test.rb

Or, if a file is named with mixed case, we can use {{ .Spec.MixedCaseName }}.

So, in order to support readme overrides, I'd like to add support for a file config/exercise_readme_insert.tmpl.go which would be used in preference in place of docs/EXERCISE_README_INSERT.md or ./HINTS.md, both of which would be deprecated.

kytrinyx commented 6 years ago

See also the related https://github.com/exercism/configlet/issues/94