https://github.com/ThinkR-open/brighter
A toolbox of functions for easier shiny development.
https://github.com/ThinkR-open/brighter
Last synced: 4 months ago
JSON representation
A toolbox of functions for easier shiny development.
- Host: GitHub
- URL: https://github.com/ThinkR-open/brighter
- Owner: ThinkR-open
- License: other
- Archived: true
- Created: 2018-09-05T11:27:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-27T16:46:45.000Z (about 6 years ago)
- Last Synced: 2024-08-13T07:15:39.577Z (8 months ago)
- Language: R
- Size: 10.7 KB
- Stars: 12
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - ThinkR-open/brighter - A toolbox of functions for easier shiny development. (R)
README
---
output: github_document
---```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# brighter
{brighter} is a toolbox of random functions for easier shiny development.
```{r}
library(brighter)
```## Installation
You can install the dev version of brighter from GitHub with:
``` r
remotes::install_github("Thinkr-open/brighter")
```## List of functions
### `with_red_star`
Adds a red star at the end of the text (for example for indicating mandatory fields).
```
with_red_star("Plop")
Plop*
```### `enurl`
Takes an url and a text and create a link:
```
enurl("https://www.thinkr.fr", "ThinkR")
ThinkR
```### `rep_br`
Repeat a `tags$br` n times
```
rep_br(times = 3)
```### `list_to_li` & `list_to_p`
Turns an R list to an HTML list or into paragraphs.
```
list_to_li(c("a","b"))
```
You can add a class to each with the class parameters.
```
list_to_p(c("One","Two"), class = "pouet")
One
Two
```
### `named_to_li`
Turn a named vector into a named html list:
```
pouet <- c("One", "two", "three")
names(pouet) <- c("a", "b", "c")
named_to_li(pouet)
a: One
b: two
c: three
```
You can also pass a class:
```
named_to_li(pouet, class = "this")
a: One
b: two
c: three
```
### `tagRemoveAttributes`
Does the opposite of tagAppendAttributes
```
a <- tags$p(src = "plop", style = "this", "pouet")
a
pouet
tagRemoveAttributes(a, "src")
pouet
tagRemoveAttributes(a, "src", "style")
pouet
```
### `display` and `undisplay`
Put and remove a div to and from a ``. Allow to dynamically show and hide content.
```
a <- shiny::tagAppendAttributes(
shiny::tags$a("pouet"),
style = "align: center;")
b <- undisplay(a)
b
pouet
display(b)
pouet
```
Please note that the 'brighter' project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms.