R/ui_tips.R

Defines functions ui_tips

Documented in ui_tips

#' ui_tips
#'
#' @param idHlp a tag id
#' @param pkg the package where the tips are
#'
#' @import yaml
#' @import shiny
#' @import shinyBS
#' @return tagList
#' @export
ui_tips <- function(idHlp, pkg){
  alang = "en"
  afile = paste0("context_", alang, ".yaml")
  apath = file.path("tips", afile)
  ahelp = system.file(apath, package = pkg)
  actxt = yaml::yaml.load_file(ahelp)

  idLbl = paste0(idHlp, "_label")
  idLbl = actxt[[idLbl]]
  idHvr = paste0(idHlp, "_hover")
  idHvr = actxt[[idHvr]]

  tagList(
    HTML("<center><h4>"),
    div(id = idHlp, idLbl),
    HTML("</h4></center>"),
    bsTooltip(idHlp, idHvr, "bottom")
  )
}
c5sire/fbhelp documentation built on June 27, 2017, 11:54 a.m.