# [exercices] utils functions
#' exercice
#'
#' @param title id and title of the exercice
#' @param info path to markdown to introduce exercice
#' @param data data to practice
#'
#' @importFrom shiny tagList icon uiOutput
#' @importFrom DT DTOutput
exercice <- function(title, info, data) {
div(
id = paste0(title, " exercice"),
class = "exercice",
tags$div(
class = "main-title",
h1(title),
a("data-card" = title, span())
),
info_section(file = info),
div(
class = "title",
icon('search'),
h5("Discover data")
),
DTOutput(data)
#lapply(names(data), function(table) show_data(data[[table]], table))
)
}
show_data <- function(outputId, name) {
div(
class = "data",
div(
class = "title",
icon("table"),
h6(name)
),
DTOutput(outputId)
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.