From 16f5b1bc0408af196bc20a18ea1a8aa86ae2a2de Mon Sep 17 00:00:00 2001 From: Ian Lyttle Date: Sat, 5 Apr 2025 13:03:40 -0500 Subject: [PATCH 1/4] update URL, Roxygen version --- DESCRIPTION | 4 ++-- man/bs_modal.Rd | 13 +++++++++++-- pkgdown/_pkgdown.yml | 8 +++++--- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 531b24d..a9f21a6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,6 +20,7 @@ Description: The Bootstrap framework lets you add some JavaScript functionality popovers, and an accordion sidebar framework (not described at Bootstrap site). Please note this package was designed for Bootstrap 3.3. License: MIT + file LICENSE +URL: https://ijlyttle.github.io/bsplus/ Depends: R (>= 3.3.0) Imports: htmltools, @@ -31,10 +32,9 @@ Imports: glue, jsonlite, methods -URL: https://github.com/ijlyttle/bsplus BugReports: https://github.com/ijlyttle/bsplus/issues Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.1 +RoxygenNote: 7.3.2 Encoding: UTF-8 Suggests: testthat, diff --git a/man/bs_modal.Rd b/man/bs_modal.Rd index da158de..e73f099 100644 --- a/man/bs_modal.Rd +++ b/man/bs_modal.Rd @@ -75,9 +75,18 @@ If you want to compose your own footer for the modal window, the function \code{bs_modal_closebutton()} can be useful. } \examples{ -library("htmltools") # also needs `markdown` package library("shiny") +requireNamespace("litedown", quietly = TRUE) +requireNamespace("withr", quietly = TRUE) + +example_path = system.file("markdown", "modal.md", package = "bsplus") +example_markdown = withr::with_connection( + list(con = file(example_path, open = "r")), { + readLines(con) + } +) + bs_modal(id = "modal", title = "I'm a modal", body = "Yes, I am.") bs_button("Click for modal") \%>\% bs_attach_modal(id_modal = "modal") @@ -86,7 +95,7 @@ bs_modal( id = "modal_large", title = "I'm a modal", size = "large", - body = includeMarkdown(system.file("markdown", "modal.md", package = "bsplus")) + body = litedown::mark(text = example_markdown) ) bs_button("Click for modal") \%>\% bs_attach_modal(id_modal = "modal_large") diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index e7cfd60..d9db95e 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -1,11 +1,13 @@ +url: https://ijlyttle.github.io/bsplus/ + +development: + mode: auto + template: params: bootswatch: sandstone assets: "inst/pkgdown/assets" -development: - mode: auto - navbar: components: articles: From ffb8f4f0ba5a42377cc5c0b3815194bd218ef217 Mon Sep 17 00:00:00 2001 From: Ian Lyttle Date: Sat, 5 Apr 2025 13:14:13 -0500 Subject: [PATCH 2/4] rationalize badges --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 4590d06..c63d6b4 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ [![CRAN status](https://www.r-pkg.org/badges/version/bsplus)](https://cran.r-project.org/package=bsplus) -[![R build status](https://github.com/ijlyttle/bsplus/workflows/R-CMD-check/badge.svg)](https://github.com/ijlyttle/bsplus/actions) -[![Coverage Status](https://img.shields.io/codecov/c/github/ijlyttle/bsplus/main.svg)](https://codecov.io/github/ijlyttle/bsplus?branch=main) [![R-CMD-check](https://github.com/ijlyttle/bsplus/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ijlyttle/bsplus/actions/workflows/R-CMD-check.yaml) From bd9ad2ba702112f004b9866b17c5445feba839aa Mon Sep 17 00:00:00 2001 From: Ian Lyttle Date: Sat, 5 Apr 2025 13:30:08 -0500 Subject: [PATCH 3/4] add alt text --- vignettes/bsplus.Rmd | 10 +++++----- vignettes/carousel.Rmd | 16 ++++++++-------- vignettes/shiny_help_links.Rmd | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/vignettes/bsplus.Rmd b/vignettes/bsplus.Rmd index bd8b279..99701d0 100644 --- a/vignettes/bsplus.Rmd +++ b/vignettes/bsplus.Rmd @@ -205,19 +205,19 @@ An carousel can be useful to cycle through slides with related content. There li ```{r} bs_carousel(id = "the_beatles", use_indicators = TRUE) %>% bs_append( - content = bs_carousel_image(src = image_uri("img/john.jpg")), + content = bs_carousel_image(src = image_uri("img/john.jpg"), alt = "John Lennon"), caption = bs_carousel_caption("John Lennon", "Rhythm guitar, vocals") ) %>% bs_append( - content = bs_carousel_image(src = image_uri("img/paul.jpg")), + content = bs_carousel_image(src = image_uri("img/paul.jpg"), alt = "Paul McCartney"), caption = bs_carousel_caption("Paul McCartney", "Bass guitar, vocals") ) %>% bs_append( - content = bs_carousel_image(src = image_uri("img/george.jpg")), + content = bs_carousel_image(src = image_uri("img/george.jpg"), alt = "George Harrison"), caption = bs_carousel_caption("George Harrison", "Lead guitar, vocals") ) %>% bs_append( - content = bs_carousel_image(src = image_uri("img/ringo.jpg")), + content = bs_carousel_image(src = image_uri("img/ringo.jpg"), alt = "Ringo Starr"), caption = bs_carousel_caption("Ringo Starr", "Drums, vocals") ) ``` @@ -260,7 +260,7 @@ shiny::runApp(system.file("shiny", "tooltip_popover_modal", package = "bsplus")) Here's what it looks like: -![](img/popover.png) +![](img/popover.png){alt="Demonstration of popover with information icon"} To see more of the help-link framework, including more examples and a proposed convention for icons, please read [this article](https://ijlyttle.github.io/bsplus/articles/shiny_help_links.html). diff --git a/vignettes/carousel.Rmd b/vignettes/carousel.Rmd index aa89863..fa99875 100644 --- a/vignettes/carousel.Rmd +++ b/vignettes/carousel.Rmd @@ -20,19 +20,19 @@ The `content` and `caption` arguments can be composed using the helper functions ```{r} bs_carousel(id = "the_beatles", use_indicators = TRUE) %>% bs_append( - content = bs_carousel_image(src = "img/john.jpg"), + content = bs_carousel_image(src = "img/john.jpg", alt = "John Lennon"), caption = bs_carousel_caption("John Lennon", "Rhythm guitar, vocals") ) %>% bs_append( - content = bs_carousel_image(src = "img/paul.jpg"), + content = bs_carousel_image(src = "img/paul.jpg", alt = "Paul McCartney"), caption = bs_carousel_caption("Paul McCartney", "Bass guitar, vocals") ) %>% bs_append( - content = bs_carousel_image(src = "img/george.jpg"), + content = bs_carousel_image(src = "img/george.jpg", alt = "George Harrison"), caption = bs_carousel_caption("George Harrison", "Lead guitar, vocals") ) %>% bs_append( - content = bs_carousel_image(src = "img/ringo.jpg"), + content = bs_carousel_image(src = "img/ringo.jpg", alt = "Ringo Starr"), caption = bs_carousel_caption("Ringo Starr", "Drums, vocals") ) ``` @@ -46,10 +46,10 @@ Here's another rendering of the carousel, this time: ```{r} bs_carousel(id = "with_the_beatles") %>% bs_set_data(interval = FALSE) %>% - bs_append(content = bs_carousel_image(src = "img/john.jpg")) %>% - bs_append(content = bs_carousel_image(src = "img/paul.jpg")) %>% - bs_append(content = bs_carousel_image(src = "img/george.jpg")) %>% - bs_append(content = bs_carousel_image(src = "img/ringo.jpg")) + bs_append(content = bs_carousel_image(src = "img/john.jpg", alt = "John Lennon")) %>% + bs_append(content = bs_carousel_image(src = "img/paul.jpg", alt = "Paul McCartney")) %>% + bs_append(content = bs_carousel_image(src = "img/george.jpg", alt = "George Harrison")) %>% + bs_append(content = bs_carousel_image(src = "img/ringo.jpg", alt = "Ringo Starr")) ``` ## Reference diff --git a/vignettes/shiny_help_links.Rmd b/vignettes/shiny_help_links.Rmd index 55638b1..ae82191 100644 --- a/vignettes/shiny_help_links.Rmd +++ b/vignettes/shiny_help_links.Rmd @@ -38,7 +38,7 @@ As of writing, I don't know how to include operable **shiny** inputs in an html shiny::runApp(system.file("shiny", "tooltip_popover_modal", package = "bsplus")) ``` -![](img/popover.png) +![](img/popover.png){alt="Demonstration of popover with information icon"} To promote consistency, the following convention is proposed: From 5f71bd202f285e47c594454c7c3592a65b03fd71 Mon Sep 17 00:00:00 2001 From: Ian Lyttle Date: Sat, 5 Apr 2025 14:00:09 -0500 Subject: [PATCH 4/4] update articles --- pkgdown/_pkgdown.yml | 27 ++++++++------------------- vignettes/accordion.Rmd | 3 --- vignettes/accordion_sidebar.Rmd | 3 --- vignettes/carousel.Rmd | 3 --- vignettes/collapse.Rmd | 3 --- vignettes/modal.Rmd | 3 --- vignettes/shiny_help_links.Rmd | 3 --- vignettes/tooltip_popover.Rmd | 5 +---- 8 files changed, 9 insertions(+), 41 deletions(-) diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index d9db95e..7f91a6a 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -9,26 +9,15 @@ template: assets: "inst/pkgdown/assets" navbar: + structure: + left: [setup, reference, articles, news] + right: [search, github] components: - articles: - text: Articles - menu: - - text: "Function Families" - - text: "---" - - text: "collpase" - href: articles/collapse.html - - text: "accordion" - href: articles/accordion.html - - text: "accordion_sidebar" - href: articles/accordion_sidebar.html - - text: "tooltip_popover" - href: articles/tooltip_popover.html - - text: "modal" - href: articles/modal.html - - text: "carousel" - href: articles/carousel.html - - text: "shiny_help_links" - href: articles/shiny_help_links.html + setup: + text: Get Started + href: articles/bsplus.html + + reference: - title: "Components" diff --git a/vignettes/accordion.Rmd b/vignettes/accordion.Rmd index ae24842..4a7dd57 100644 --- a/vignettes/accordion.Rmd +++ b/vignettes/accordion.Rmd @@ -1,8 +1,5 @@ --- title: "Accordion" -author: "Ian Lyttle" -date: "`r Sys.Date()`" -output: rmarkdown::html_vignette --- ```{r} diff --git a/vignettes/accordion_sidebar.Rmd b/vignettes/accordion_sidebar.Rmd index 2964b9f..08f48be 100644 --- a/vignettes/accordion_sidebar.Rmd +++ b/vignettes/accordion_sidebar.Rmd @@ -1,8 +1,5 @@ --- title: "Accordion Sidebar" -author: "Ian Lyttle" -date: "`r Sys.Date()`" -output: rmarkdown::html_vignette --- ```{r} diff --git a/vignettes/carousel.Rmd b/vignettes/carousel.Rmd index fa99875..ae77cb1 100644 --- a/vignettes/carousel.Rmd +++ b/vignettes/carousel.Rmd @@ -1,8 +1,5 @@ --- title: "Carousel" -author: "Ian Lyttle" -date: "`r Sys.Date()`" -output: rmarkdown::html_vignette --- ```{r} diff --git a/vignettes/collapse.Rmd b/vignettes/collapse.Rmd index 0eee34b..c4fed9c 100644 --- a/vignettes/collapse.Rmd +++ b/vignettes/collapse.Rmd @@ -1,8 +1,5 @@ --- title: "Collapse" -author: "Ian Lyttle" -date: "`r Sys.Date()`" -output: rmarkdown::html_vignette --- ```{r} diff --git a/vignettes/modal.Rmd b/vignettes/modal.Rmd index 1842260..d6e677c 100644 --- a/vignettes/modal.Rmd +++ b/vignettes/modal.Rmd @@ -1,8 +1,5 @@ --- title: "Modals" -author: "Ian Lyttle" -date: "`r Sys.Date()`" -output: rmarkdown::html_vignette --- ```{r} diff --git a/vignettes/shiny_help_links.Rmd b/vignettes/shiny_help_links.Rmd index ae82191..285d608 100644 --- a/vignettes/shiny_help_links.Rmd +++ b/vignettes/shiny_help_links.Rmd @@ -1,8 +1,5 @@ --- title: "Shiny-input help links" -author: "Ian Lyttle" -date: "`r Sys.Date()`" -output: rmarkdown::html_vignette --- ```{r} diff --git a/vignettes/tooltip_popover.Rmd b/vignettes/tooltip_popover.Rmd index 44e9d6b..053dff5 100644 --- a/vignettes/tooltip_popover.Rmd +++ b/vignettes/tooltip_popover.Rmd @@ -1,8 +1,5 @@ --- -title: "Tooltips and popovers" -author: "Ian Lyttle" -date: "`r Sys.Date()`" -output: rmarkdown::html_vignette +title: "Tooltips and Popovers" --- ```{r}