From 0b571a3acf8fd90e82dfb2637b67b25286a4a03a Mon Sep 17 00:00:00 2001 From: Kamil Zyla Date: Wed, 15 Jun 2022 11:01:11 +0200 Subject: [PATCH 1/2] docs: Reorganize HTML elements docs --- R/components.R | 10 +++++- inst/examples/components/HTMLTable.R | 19 +++++++++++ inst/examples/components/html_elements.R | 15 +-------- man/HTMLTable.Rd | 41 ++++++++++++++++++++++++ man/Label.Rd | 6 ++++ man/html_elements.Rd | 24 ++++---------- 6 files changed, 83 insertions(+), 32 deletions(-) create mode 100644 inst/examples/components/HTMLTable.R create mode 100644 man/HTMLTable.Rd diff --git a/R/components.R b/R/components.R index 3c6f50d..814a31e 100644 --- a/R/components.R +++ b/R/components.R @@ -139,6 +139,7 @@ EditableText.shinyInput <- input("EditableText", "") # nolint #' #' Documentation: #' +#' @family HTML elements #' @example inst/examples/components/html_elements.R #' @inherit template params #' @name html_elements @@ -190,7 +191,13 @@ OL <- component("OL") #' @export UL <- component("UL") -#' @rdname html_elements +#' HTML table +#' +#' Documentation: +#' +#' @family HTML elements +#' @example inst/examples/components/HTMLTable.R +#' @inherit template params #' @export HTMLTable <- component("HTMLTable") @@ -363,6 +370,7 @@ ControlGroup <- component("ControlGroup") #' #' Documentation: #' +#' @family HTML elements #' @example inst/examples/components/Label.R #' @inherit template params #' @export diff --git a/inst/examples/components/HTMLTable.R b/inst/examples/components/HTMLTable.R new file mode 100644 index 0000000..ad3ea16 --- /dev/null +++ b/inst/examples/components/HTMLTable.R @@ -0,0 +1,19 @@ +library(shiny) +library(appsilon.blueprint) + +if (interactive()) shinyApp( + ui = HTMLTable( + tags$thead( + tags$tr(tags$th("Project"), tags$th("Stack"), tags$th("Contributors")) + ), + tags$tbody( + tags$tr(tags$td("Blueprint"), tags$td("JS React"), tags$td("268")), + tags$tr(tags$td("TS"), tags$td("JSX"), tags$td("68")), + tags$tr(tags$td("appsilon.blueprint"), tags$td("R JS"), tags$td("2")) + ), + tags$tfoot( + tags$tr(tags$td("Total", colspan = 2), tags$td("1508")) + ) + ), + server = function(input, output) {} +) diff --git a/inst/examples/components/html_elements.R b/inst/examples/components/html_elements.R index dfde3f6..d5eb97e 100644 --- a/inst/examples/components/html_elements.R +++ b/inst/examples/components/html_elements.R @@ -14,20 +14,7 @@ if (interactive()) shinyApp( Label("Label"), Pre("Pre"), OL(tags$li("OL")), - UL(tags$li("UL")), - HTMLTable( - tags$thead( - tags$tr(tags$th("Project"), tags$th("Stack"), tags$th("Contributors")) - ), - tags$tbody( - tags$tr(tags$td("Blueprint"), tags$td("JS React"), tags$td("268")), - tags$tr(tags$td("TS"), tags$td("JSX"), tags$td("68")), - tags$tr(tags$td("appsilon.blueprint"), tags$td("R JS"), tags$td("2")) - ), - tags$tfoot( - tags$tr(tags$td("Total", colspan = 2), tags$td("1508")) - ) - ) + UL(tags$li("UL")) ), server = function(input, output) {} ) diff --git a/man/HTMLTable.Rd b/man/HTMLTable.Rd new file mode 100644 index 0000000..66736f0 --- /dev/null +++ b/man/HTMLTable.Rd @@ -0,0 +1,41 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/components.R +\name{HTMLTable} +\alias{HTMLTable} +\title{HTML table} +\usage{ +HTMLTable(...) +} +\arguments{ +\item{...}{Component props and children. See the official Blueprint docs for details.} +} +\description{ +Documentation: \url{https://blueprintjs.com/docs/#core/components/html-table} +} +\examples{ +library(shiny) +library(appsilon.blueprint) + +if (interactive()) shinyApp( + ui = HTMLTable( + tags$thead( + tags$tr(tags$th("Project"), tags$th("Stack"), tags$th("Contributors")) + ), + tags$tbody( + tags$tr(tags$td("Blueprint"), tags$td("JS React"), tags$td("268")), + tags$tr(tags$td("TS"), tags$td("JSX"), tags$td("68")), + tags$tr(tags$td("appsilon.blueprint"), tags$td("R JS"), tags$td("2")) + ), + tags$tfoot( + tags$tr(tags$td("Total", colspan = 2), tags$td("1508")) + ) + ), + server = function(input, output) {} +) +} +\seealso{ +Other HTML elements: +\code{\link{Label}()}, +\code{\link{html_elements}} +} +\concept{HTML elements} diff --git a/man/Label.Rd b/man/Label.Rd index 3f793c2..09d35d3 100644 --- a/man/Label.Rd +++ b/man/Label.Rd @@ -24,3 +24,9 @@ if (interactive()) shinyApp( server = function(input, output) {} ) } +\seealso{ +Other HTML elements: +\code{\link{HTMLTable}()}, +\code{\link{html_elements}} +} +\concept{HTML elements} diff --git a/man/html_elements.Rd b/man/html_elements.Rd index 8459fe7..2707b34 100644 --- a/man/html_elements.Rd +++ b/man/html_elements.Rd @@ -13,7 +13,6 @@ \alias{Pre} \alias{OL} \alias{UL} -\alias{HTMLTable} \title{HTML elements} \usage{ H1(...) @@ -37,8 +36,6 @@ Pre(...) OL(...) UL(...) - -HTMLTable(...) } \arguments{ \item{...}{Component props and children. See the official Blueprint docs for details.} @@ -63,21 +60,14 @@ if (interactive()) shinyApp( Label("Label"), Pre("Pre"), OL(tags$li("OL")), - UL(tags$li("UL")), - HTMLTable( - tags$thead( - tags$tr(tags$th("Project"), tags$th("Stack"), tags$th("Contributors")) - ), - tags$tbody( - tags$tr(tags$td("Blueprint"), tags$td("JS React"), tags$td("268")), - tags$tr(tags$td("TS"), tags$td("JSX"), tags$td("68")), - tags$tr(tags$td("appsilon.blueprint"), tags$td("R JS"), tags$td("2")) - ), - tags$tfoot( - tags$tr(tags$td("Total", colspan = 2), tags$td("1508")) - ) - ) + UL(tags$li("UL")) ), server = function(input, output) {} ) } +\seealso{ +Other HTML elements: +\code{\link{HTMLTable}()}, +\code{\link{Label}()} +} +\concept{HTML elements} From f0171fd65c2ef22a26f51d5d4671c752e6882af0 Mon Sep 17 00:00:00 2001 From: Kamil Zyla Date: Wed, 15 Jun 2022 11:05:28 +0200 Subject: [PATCH 2/2] refactor: Use camelCase for filenames too --- R/components.R | 26 +++++++++--------- .../{html_elements.R => htmlElements.R} | 0 .../.gitignore | 0 .../{mbaza_dashboard => mbazaDashboard}/app.R | 0 .../home.R | 0 .../navbar.R | 0 .../sidebar.R | 0 .../style.scss | 0 .../www/appsilon-logo.png | Bin man/HTMLTable.Rd | 2 +- man/Label.Rd | 2 +- man/{html_elements.Rd => htmlElements.Rd} | 4 +-- 12 files changed, 17 insertions(+), 17 deletions(-) rename inst/examples/components/{html_elements.R => htmlElements.R} (100%) rename inst/examples/{mbaza_dashboard => mbazaDashboard}/.gitignore (100%) rename inst/examples/{mbaza_dashboard => mbazaDashboard}/app.R (100%) rename inst/examples/{mbaza_dashboard => mbazaDashboard}/home.R (100%) rename inst/examples/{mbaza_dashboard => mbazaDashboard}/navbar.R (100%) rename inst/examples/{mbaza_dashboard => mbazaDashboard}/sidebar.R (100%) rename inst/examples/{mbaza_dashboard => mbazaDashboard}/style.scss (100%) rename inst/examples/{mbaza_dashboard => mbazaDashboard}/www/appsilon-logo.png (100%) rename man/{html_elements.Rd => htmlElements.Rd} (95%) diff --git a/R/components.R b/R/components.R index 814a31e..afb8acb 100644 --- a/R/components.R +++ b/R/components.R @@ -140,54 +140,54 @@ EditableText.shinyInput <- input("EditableText", "") # nolint #' Documentation: #' #' @family HTML elements -#' @example inst/examples/components/html_elements.R +#' @example inst/examples/components/htmlElements.R #' @inherit template params -#' @name html_elements +#' @name htmlElements NULL -#' @rdname html_elements +#' @rdname htmlElements #' @export H1 <- component("H1") -#' @rdname html_elements +#' @rdname htmlElements #' @export H2 <- component("H2") -#' @rdname html_elements +#' @rdname htmlElements #' @export H3 <- component("H3") -#' @rdname html_elements +#' @rdname htmlElements #' @export H4 <- component("H4") -#' @rdname html_elements +#' @rdname htmlElements #' @export H5 <- component("H5") -#' @rdname html_elements +#' @rdname htmlElements #' @export H6 <- component("H6") -#' @rdname html_elements +#' @rdname htmlElements #' @export Blockquote <- component("Blockquote") -#' @rdname html_elements +#' @rdname htmlElements #' @export Code <- component("Code") # Label has its own documentation page. -#' @rdname html_elements +#' @rdname htmlElements #' @export Pre <- component("Pre") -#' @rdname html_elements +#' @rdname htmlElements #' @export OL <- component("OL") -#' @rdname html_elements +#' @rdname htmlElements #' @export UL <- component("UL") diff --git a/inst/examples/components/html_elements.R b/inst/examples/components/htmlElements.R similarity index 100% rename from inst/examples/components/html_elements.R rename to inst/examples/components/htmlElements.R diff --git a/inst/examples/mbaza_dashboard/.gitignore b/inst/examples/mbazaDashboard/.gitignore similarity index 100% rename from inst/examples/mbaza_dashboard/.gitignore rename to inst/examples/mbazaDashboard/.gitignore diff --git a/inst/examples/mbaza_dashboard/app.R b/inst/examples/mbazaDashboard/app.R similarity index 100% rename from inst/examples/mbaza_dashboard/app.R rename to inst/examples/mbazaDashboard/app.R diff --git a/inst/examples/mbaza_dashboard/home.R b/inst/examples/mbazaDashboard/home.R similarity index 100% rename from inst/examples/mbaza_dashboard/home.R rename to inst/examples/mbazaDashboard/home.R diff --git a/inst/examples/mbaza_dashboard/navbar.R b/inst/examples/mbazaDashboard/navbar.R similarity index 100% rename from inst/examples/mbaza_dashboard/navbar.R rename to inst/examples/mbazaDashboard/navbar.R diff --git a/inst/examples/mbaza_dashboard/sidebar.R b/inst/examples/mbazaDashboard/sidebar.R similarity index 100% rename from inst/examples/mbaza_dashboard/sidebar.R rename to inst/examples/mbazaDashboard/sidebar.R diff --git a/inst/examples/mbaza_dashboard/style.scss b/inst/examples/mbazaDashboard/style.scss similarity index 100% rename from inst/examples/mbaza_dashboard/style.scss rename to inst/examples/mbazaDashboard/style.scss diff --git a/inst/examples/mbaza_dashboard/www/appsilon-logo.png b/inst/examples/mbazaDashboard/www/appsilon-logo.png similarity index 100% rename from inst/examples/mbaza_dashboard/www/appsilon-logo.png rename to inst/examples/mbazaDashboard/www/appsilon-logo.png diff --git a/man/HTMLTable.Rd b/man/HTMLTable.Rd index 66736f0..f84279a 100644 --- a/man/HTMLTable.Rd +++ b/man/HTMLTable.Rd @@ -36,6 +36,6 @@ if (interactive()) shinyApp( \seealso{ Other HTML elements: \code{\link{Label}()}, -\code{\link{html_elements}} +\code{\link{htmlElements}} } \concept{HTML elements} diff --git a/man/Label.Rd b/man/Label.Rd index 09d35d3..8c283dd 100644 --- a/man/Label.Rd +++ b/man/Label.Rd @@ -27,6 +27,6 @@ if (interactive()) shinyApp( \seealso{ Other HTML elements: \code{\link{HTMLTable}()}, -\code{\link{html_elements}} +\code{\link{htmlElements}} } \concept{HTML elements} diff --git a/man/html_elements.Rd b/man/htmlElements.Rd similarity index 95% rename from man/html_elements.Rd rename to man/htmlElements.Rd index 2707b34..f2bb94e 100644 --- a/man/html_elements.Rd +++ b/man/htmlElements.Rd @@ -1,7 +1,7 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/components.R -\name{html_elements} -\alias{html_elements} +\name{htmlElements} +\alias{htmlElements} \alias{H1} \alias{H2} \alias{H3}