新增解題思路、文章或練習時,你必須建立檔名有嚴格規定的檔案。這些檔案還需要一併新增或更新設定檔。有了 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
這會依文章文件的規定,建立文章所需的檔案。