This manual contains instructions for how to make new teaching material and add it to the site.
The git repository can be cloned by
git clone https://github.com/smart-cities-accelerator/teaching.git
which will download all the files into the directory “teaching”
In order to compile the site, first download and install two programs:
Rstudio Desktop the free version: https://rstudio.com/products/rstudio/download/
After installing both the entire site can be compiled by running the R script in “teaching/make.R”. So open it in Rstudio and mark all with “ctrl-a” and then run the it with “ctrl-enter”.
The site is arranged such that teaching exercise files are put the following way:
Each language is in its own folder, e.g.
sv/ is for Swedish
In there a folder for each topic contains markdown files, e.g.
sv/Omraade-Energifoerluster/Ledning_GN_laerare.md contains one exercise
In order to add a new exercise:
Add a new markdown file in the topic folder, e.g.
To add it to the swedish page the open the
.Rmd file in the main directory, e.g.
sv/teachers_GN.Rmd in Rstudio:
Add a line with the link to the markdown file by copying a line with a link to the pages and change the link, as in: 'r knitr::knit_child(‘sv/Omraade-Energifoerluster/newexercise_GN_laerare.md’)`
Either simply press “knit to html” in Rstudio or run
make.R to compile the site
There are not really any technical restrictions to how the material is organized, however the following conventions should be kept to make the site compile with all working links:
Keep exercise files divided in folders of the different topics.
### Exercise title
studentwith similar name in the language and
levelwith the different level names:
exercisename_level_teacher.mdfor teachers instructions
exercisename_level_student.mdfor students instructions
Use only ASCII characters in file names (not æøå etc.)
In order to edit an exercise:
Open an exercise markdown file, e.g.
The file can be edited in any text editor. If Rstudio is used, then the markdown file can simply be compiled to pdf by pressing “Preview PDF” (ctrl-shift k)
Images can be added with markdown syntax, e.g.
!(figures/test.jpeg), or with rmarkdown syntax
Its perfectly possible to write math and code chunks, see the rmarkdown documentation