Course | R Documentation |
The class generates a web-site based on the Rmd files in the directory 'site'. The directory has a flat structure and contains several categories of files:
This file in YAML format describing the structure and the look of the site with menues and sub-menus.
This file contains information about the course (see details).
These files contain the course material on a specific topic.
These Rmd files can be re-used and are called from inside other Rmd files. They do not have a html counterpart in the _site directory.
These directories are copied into _site directory
Footer content for all pages.
This is needed if the individual Rmd files need to be generated inside RStudio using the 'knit' button.
Stylesheet file for the appearance
The files prefixed with _ will not be rendered and are for internal use.
An R6Class
generator object
The schedule file has the following structure:
course: title: <course-title> start: <start-date> end: <end-date> exam: date: <exam-date> time: <time-time> venue: <venue> slots: <slot-id>: title: <session-title> subtitle: <session-subtitle> goal: <goals/description> date: <session-date> time: <session-time> venue: <venue> tasks : "yes | no" <slot-id>: ...
load_config()
Load config.yml file.
Course$load_config(path, config_file)
path
...
config_file
...
path_
course directory path.
config()
Access config.yml file. Given 'id' return value otherwise the complete list.
Course$config(id = NULL)
new()
Builds a TheCourse instance based on the 'config.yml' file in the path 'dir'
Course$new(path, config_file = "config.yml", site = "docs")
config
config-file name.
src()
Path to site's directory containing all Rmd files.
Course$src()
clear_nocode_html()
clear generated nocode html file
Course$clear_nocode_html()
render_off()
Render the site only for modified Rmd's.
Course$render_off(clean = FALSE, ...)
clean
If true the clean the site first.
...
arguments to rmarkdown::render_site
render()
Render the site ( todo: only for modified Rmd's).
Course$render(out_dir = ".docs")
publish
...
site()
Course$site()
url()
Return the path to site's index.html
Course$url()
view()
View the site in the browser.
Course$view(publish = FALSE)
publish
If TRUE then show the published build (docs) otherwise the development version (.docs).
schedule()
Course schedule from schedule.yml. #' @description Edit '_schedule.yml'. Render the pages by render() to enforce the changes. schedule = function() file.edit(file.path(self$src(),"_schedule.yml")) ,
Course$schedule()
slots()
Returns the list of course slots. The data is taken from '_schedule.yml'.
Course$slots()
next_slot()
given the base name of the slot return the basename of the next slot from '_schedule.yml'.
Course$next_slot(base_name)
base_name
the RMD file basename.
prev_slot()
given the base name of the slot return the basename of the previous slot from '_schedule.yml'.
Course$prev_slot(base_name)
base_name
the RMD file basename.
related()
given the base name of the slot return the related slots from '_schedule.yml'.
Course$related(base_name)
base_name
the RMD file basename.
lstmod()
Returns the list of modified files.
Course$lstmod()
listing()
Returns the list of files for zip archive.
Course$listing(set = "archive")
set
archive, data
zip()
Create a zip archive.
Course$zip(filename = "archive.zip", what = "arvhive")
filename
name of zip archive.
what
archive, data
push()
clear generted files, i.e. site/
Course$push(slot, server = "shark", server_dir = "/bam-export/crip")
publish()
publish _site to remote site with rsync
Course$publish( remote = NULL, remote_dir = "/bam-export", server = "shark", group = "5-A-SHARK_BioCentEXP" )
clean()
clear generted files, i.e. site/
Course$clean()
clone()
The objects of this class are cloneable with this method.
Course$clone(deep = FALSE)
deep
Whether to make a deep clone.
rcourse <- Course$new()
rcourse$view()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.