添加新的解题思路、文章或练习时,你需要创建一些名称有严格规定的文件,同时还要添加或更新相应的配置文件。有了create命令,configlet 就能帮你完成这一切。
create命令可以用来创建添加新解题思路、文章或练习所需的文件,也可以修改相关的配置文件。
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
添加实践练习的文档详细说明了如何添加一个实践练习。
要创建概念练习,需要指定它的 slug:
configlet create --concept-exercise bird-watcher
这会按照概念练习文档中的规定,创建概念练习所需的文件。
当然,这只是创建一个练习的第一步。接下来你还需要:
.docs/introduction.md中编写简介.docs/instructions.md中编写说明.meta/config.json文件中:
authors键中config.json文件中:
concepts键中prerequisites键中要创建解题思路的文件,需要指定解题思路及其练习的 slug:
configlet create --approach recursion --exercise collatz-conjecture
这会按照解题思路文档中的规定,创建解题思路所需的文件。
要创建文章的文件,需要指定文章及其练习的 slug:
configlet create --article performance --exercise collatz-conjecture
这会按照文章文档中的规定,创建文章所需的文件。