When adding a new approach, article or exercise, you'll have to create files with very specific names.
They also require configuration files to be added or updated.
With the create
command, configlet can do all this for you.
The create
command can be used to create the files required to add a new approach, article or exercise, as well as modify any configuration files.
configlet [global-options] create [command-options]
Options for create:
--approach <slug> The slug of the approach
--article <slug> The slug of the article
--practice-exercise <slug> The slug of the practice exercise
--concept-exercise <slug> The slug of the concept exercise
-e, --exercise <slug> Only operate on this exercise
-o, --offline Do not update the cached 'problem-specifications' data
To create a practice exercise, one has to specify its slug:
configlet create --practice-exercise collatz-conjecture
This will create the practice exercise's required files, as specified in the Practice Exercises docs. If the practice exercise is defined in the Problem Specifications repo, configlet will sync the docs and metadata from there.
Of course, this is just the first step towards creating an exercise. You'll then have to:
.meta/config.json
file:
authors
keyconfig.json
file:
practices
key (only required when the track has concept exercises)prerequisites
key (only required when the track has concept exercises)Some tracks have implemented an exercise/test generator, which is a tool that can generate the test file's contents based on the exercise's canonical-data.json
found in the Problem Specifications repo.
Make sure to read the track's documentation to see if there is a generator that you can use.
To create a concept exercise, one has to specify its slug:
configlet create --concept-exercise bird-watcher
This will create the concept exercise's required files, as specified in the Concept Exercises docs.
Of course, this is just the first step towards creating an exercise. You'll then have to:
.docs/introduction.md
.docs/instructions.md
.meta/config.json
file:
authors
keyconfig.json
file:
concepts
keyprerequisites
keyTo create an approach's files, one has to specify the slug of the approach and its exercise:
configlet create --approach recursion --exercise collatz-conjecture
This will create the approach's required files, as specified in the Approaches docs.
To create an article's files, one has to specify the slug of the article and its exercise:
configlet create --article performance --exercise collatz-conjecture
This will create the article's required files, as specified in the Articles docs.