szcf-weiya / ESL-CN

The Elements of Statistical Learning (ESL)的中文翻译、代码实现及其习题解答。
https://esl.hohoweiya.xyz
GNU General Public License v3.0
2.39k stars 588 forks source link

workflow for Rmd notes #242

Open szcf-weiya opened 3 years ago

szcf-weiya commented 3 years ago

It has been tried to use Travis to automatically generate the index files from Rmds, as shown in d08ea63f09054b73c1c3b64f977876a76ee0fdc3 but I gave up since it took a much longer time and it is required to be careful to add the necessary packages to be installed (e92ba3cd246ba873a8cb421cd34ac6b94c024809 and 50f9fc82fce3d06e0ea9182de8a8ead86984829e). The shortcomings are also discussed in https://bookdown.org/yihui/blogdown/travis-github.html

But built locally would rewrite most files, especially when I run to generate the whole site rmarkdown::render_site(). Thus, I specify the modified (or new created) Rmds file. For example, for https://github.com/szcf-weiya/ESL-CN/commit/83df85df3104f065164b0c6f9010a77428ab21c4, I use

rmarkdown::render_site("index.Rmd")
rmarkdown::render_site("non-linear-modeling.Rmd")

but there still some files to be rewritten, possibly due to the updated version of the rmarkdown package. The general introduction of rmarkdown as a website generator refers to https://bookdown.org/yihui/rmarkdown/rmarkdown-site.html

Still thinking if there is another more automatic and simple way.