# [sections] utils functions
#' section
#'
#' @param class section class
#' @param icon icon to print
#' @param path path to material
#' @param file material
#'
#' @importFrom shiny div icon includeMarkdown
section <- function(class, icon, path, file) {
div(
class = class,
icon(icon),
column(
width = 12,
includeMarkdown(
path = file.path(
system.file(path, package = 'sqlnstructor'),
file
)
)
)
)
}
#' learning_section
#'
#' @seealso section()
#'
#' @param file material to learn
learning_section <- function(file) {
section(
class = "learning-section",
icon = "graduation-cap",
path = "app/www/materials/learn",
file = file
)
}
#' info_section
#'
#' @seealso section()
#'
#' @param file material to info
#' @importFrom shiny div icon includeMarkdown
info_section <- function(file) {
section(
class = "info-section",
icon = "info-circle",
path = "app/www/materials",
file = file
)
}
#' warning_section
#'
#' @seealso section()
#'
#' @param file material to info
#' @importFrom shiny div icon includeMarkdown
warning_section <- function(file) {
section(
class = "warning-section",
icon = "exclamation-circle",
path = "app/www/materials",
file = file
)
}
#' news_section
#'
#' @seealso section()
#'
#' @param file news to info
#' @importFrom shiny div icon includeMarkdown
news_section <- function(file) {
section(
class = "news-section",
icon = "",
path = "app/www/materials/news",
file = file
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.