This is a repository hosting Gispo's training materials.
The course materials are written and edited in R Markdown (.rmd) files which are then automatically rendered to HTML using Bookdown. The materials are in the 'src' folder in which each course is in its own folder named after its course code. English and Swedish translations of courses have a suffix, '_eng', or '_sv' respectively. Editing or adding new rmd files or image files in the course's folder will trigger a workflow which will render the course to HTML and either add or modify the corresponding course folder in the 'docs' folder. The docs folder is published using GitHub pages.
Using RStudio to edit the rmd files is recommended. You can install the bookdown package and preview the HTML document using RStudio. If you have Docker installed, you can also render locally using the render.sh (render.ps1 on Windows) script.
For Windows, you may need to enable script support first.
Open Powershell as an administrator and run the command Set-ExecutionPolicy RemoteSigned
.
The HTML is rendered using custom HTML and CSS templates defined in the index.Rmd YAML header. Some extra functionality (f.e. copying the contents of a code box) is added with javascript (.js) files. These can be found and added to the 'js' folder. They also might have to be added to the end of the HTML template.
If you wish to edit the assets, for example change the style of the pages or add functionality with javascript you can edit the files in the assets folder. When you make changes to the assets folder a workflow is triggered which updates the assets automatically to each course folder in 'src'.
The index.Rmd file is a special file that always gets rendered first
Other Rmd files get rendered in alphabetic order to separate pages.
Use the YAML header section (separated by ---
) of index.Rmd to define a author, title, and abstract for the materials.