search: Search

searchR Documentation

Description

Search gives you a way to quickly search for text on slides.

Usage

use_search(
  position = c("bottom-left", "bottom-right", "top-left", "top-right"),
  case_sensitive = FALSE,
  show_icon = FALSE,
  auto_search = TRUE
)

html_dependency_search(
  position = c("bottom-left", "bottom-right", "top-left", "top-right"),
  case_sensitive = FALSE,
  show_icon = FALSE,
  auto_search = TRUE
)

style_search(
  icon_fill = "rgba(128, 128, 128, 0.5)",
  input_background = "rgb(204, 204, 204)",
  input_foreground = "black",
  input_border = "1px solid rgb(249, 38, 114)",
  match_background = "rgb(38, 220, 249)",
  match_foreground = "black",
  match_current_background = "rgb(38, 249, 68)",
  match_current_foreground = "black",
  selector = ".search"
)

Arguments

position

Where to place the search box.

case_sensitive

If FALSE, ignores case of search and text.

show_icon

Show the icon to open or close the search?

auto_search

Search on each keystroke (TRUE) or on enter (FALSE)?

icon_fill

Color of search icon

input_background

Color of search input box background

input_foreground

Color of text in search input box

input_border

Border style of search input box

match_background

Color of match background (not current)

match_foreground

Color of match text (not current)

match_current_background

Color of current match background

match_current_foreground

Color of current match text

selector

CSS selector specifying which search bar to update (for advanced or unusual uses only)

Value

An htmltools::tagList() with the search dependencies, or an htmltools::htmlDependency().

Functions

  • use_search(): Adds search to your xaringan slides.

  • html_dependency_search(): Returns an htmltools::htmlDependency() with the search dependencies. Most users will want to use use_search().

  • style_search(): Style the search input.

Usage

To add search to your xaringan presentation, add the following code chunk to your slides' R Markdown file.

```{r xaringan-search, echo=FALSE}
xaringanExtra::use_search()
```

Author(s)

Original implementation by André Restivo

References

https://github.com/arestivo/remark.search

Examples

use_search()


xaringanExtra documentation built on May 29, 2024, 4:17 a.m.