Don't expect this package to work outside of our specific application
The bs2site package is used to build our teaching websites (biostat2.uni.lu or rworkshop.uni.lu). These websites combine different Rmarkdown formats in order to include practicals and lectures.
Our websites are built on gitlab using continuous integration (CI). bs2site
helps to:
- identify which packages are used in active documents (not starting with
_
)- tries to install missing packages from cran.
- installs packages hosted on github or bioconductor which were defined in a
package.yml
file.
- add a branding logo in the navbar header.
- save and load objects saved as
rds
files in a standardised location (i.e. used as a cache synced with git LFS). - provide an Rstudio addin to interact with the gitlab instance
- configure the access to gitlab and store the private token in the system credential store (using the
keyring
package) - deploy the website (production: manual action)
- build the website without using the CI cache (rebuild)
- configure the access to gitlab and store the private token in the system credential store (using the
- define standard box themes that are reused in the different lectures.
You can install bs2site from github with:
# install.packages("devtools")
devtools::install_github("koncina/bs2site")
The folder structure of the website source directory is the following:
├── lectures
│ ├── img
│ ├── lecture_01.Rmd
│ └── ...
├── practicals
│ ├── img
│ ├── practical_01.Rmd
│ └── ...
├── projects
│ ├── img
│ ├── project_01.Rmd
│ └── ...
├── css
│ ├── lecture.css
│ ├── practical.css
│ ├── site.css
│ └── ...
├── img
├── Makefile
├── index.Rmd
├── lectures.Rmd
├── practicals.Rmd
└── ...
Each lecture should be placed in the lectures
folder and named as lecture_xx.Rmd
where xx
is a zero padded number. The format used to render the lectures is iosp.
Each practical / project should be placed in the practicals
/ project
folder and named as practical_xx.Rmd
/ project_xx.Rmd
where xx
is a zero padded number. The format used to render practicals / projects is unilur.
All remaining pages to setup the website are placed in the root folder.
Configure the project to use the Makefile
which will render the website in the docs
output folder.