Added method for removing the title from a shinydashboard::box and added htmlAddBoxHelpLink function

This commit is contained in:
2026-01-28 12:51:13 +00:00
parent 6d3843a92b
commit 27bccf2b84
5 changed files with 147 additions and 2 deletions

28
man/htmlAddBoxHelpLink.Rd Normal file
View File

@@ -0,0 +1,28 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/htmlBoxManipulation.R
\name{htmlAddBoxHelpLink}
\alias{htmlAddBoxHelpLink}
\title{Adds a "help" (question mark) icon to a box tools section (right side)}
\usage{
htmlAddBoxHelpLink(box, href, title = NULL)
}
\arguments{
\item{box}{The box to add a help icon/link to}
\item{href}{The help uri to load}
\item{title}{Optional title for the help link. Defaults to box title}
}
\value{
The modified box
}
\description{
The uri to load can have a replacement marker supplied '\%box\%' which will be
substituded with a sanitized copy of the box title. Preference is given to
the slugify package, however if unavailable a warning is generated and the
fallback of URLEncode is used.
}
\examples{
x <- shinydashboard::box(title = "This is a box")
htmlAddBoxHelpLink(x, href = "http://example.com/help-guide#\%box\%")
}

23
man/htmlRemoveBoxTitle.Rd Normal file
View File

@@ -0,0 +1,23 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/htmlBoxManipulation.R
\name{htmlRemoveBoxTitle}
\alias{htmlRemoveBoxTitle}
\title{Removes title from box element (leaving an un-titled box with header if required)}
\usage{
htmlRemoveBoxTitle(box, removeHeader = FALSE)
}
\arguments{
\item{box}{The box to remove the title from}
\item{removeHeader}{Remove the header as well}
}
\value{
The modified box
}
\description{
Removes title from box element (leaving an un-titled box with header if required)
}
\examples{
x <- shinydashboard::box(title = "TBR")
htmlRemoveBoxTitle(x)
}