英文:
How to make `learnr` tutorials appear in a certain order?
问题
When authoring an R package with learnr
tutorials, is there a way to make them appear in an order that is not alphabetical, but user defined?
在使用learnr
教程制作R包时,是否有一种方法可以使它们按照用户定义的顺序而不是按字母顺序显示?
I am looking for an option, like swirl
s MANIFEST file, which specifies the order.
Only if there is no such option I would resort to renaming the files.
我正在寻找一种选项,类似于swirl
的MANIFEST文件,可以指定顺序。只有在没有这样的选项的情况下,我才会考虑重命名文件。
英文:
When authoring an R package with learnr
tutorials, is there a way to make them appear in an order that is not alphabetical, but user defined?
See the following example: The hello
tutorial is most basic and should appear first. But the tutorials are alphabetically sorted by their name.
learnr::available_tutorials("learnr")
Available tutorials:
* learnr
- ex-data-basics : "Data basics"
- ex-data-filter : "Filter observations"
- ex-data-mutate : "Create new variables"
- ex-data-summarise : "Summarise Tables"
- ex-setup-r : "Set Up"
- hello : "Hello, Tutorial!"
- polyglot : "Multi-language exercises"
- quiz_question : "Tutorial Quiz Questions in `learnr`"
- setup-chunks : "Chained setup chunks"
- slidy : "Slidy demo"
- sql-exercise : "Interactive SQL Exercises"
I am looking for an option, like swirl
s MANIFEST file, which specifies the order.
Only if there is no such option I would resort to renaming the files.
答案1
得分: 1
没有办法改变顺序,除非你改变名称。 learnr
代码通过在包文件夹上运行 list.dirs 来查找教程。根据 ?list.dirs
帮助页面的说明,“如果 full.names = TRUE,则按照完整路径按字母顺序排序文件。” 目前没有办法指定清单。你需要向包的作者请求一个新的功能。
英文:
There's no way to change the order unless you change the names. The code for learnr
finds tutorials by running list.dirs on the package folder And according to the ?list.dirs
help page "the files are sorted in alphabetical order, on the full path if full.names = TRUE." There's no current way to specify a manifest. You'd have to request a new feature from the package authors.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论