gadenbuie / xaringanExtra

:ferris_wheel: A playground of enhancements and extensions for xaringan slides.
https://pkg.garrickadenbuie.com/xaringanExtra
Other
448 stars 36 forks source link

Search is not working #140

Closed drfurtado closed 2 years ago

drfurtado commented 2 years ago

I am getting an error when adding a search option to my slides.

xaringanExtra::use_search(show_icon = TRUE)

The error is Error: 'use_search' is not an exported object from 'namespace:xaringanExtra'

Any help is greatly appreciated.

gadenbuie commented 2 years ago

Can you confirm that you're using the latest version of xaringanExtra? use_search() was added in 0.2.6.

# install from my r-universe repo
install.packages("xaringanExtra", repos = c("https://gadenbuie.r-universe.dev", getOption("repos")))

# or from github
remotes::install_github("gadenbuie/xaringanExtra")
drfurtado commented 2 years ago

My apologies. Indeed, I was using an old version.

gadenbuie commented 2 years ago

No worries, glad it's working for you now!

drfurtado commented 2 years ago

If you do not mind, I would like to ask a related question, now related to embed-xaringan.

I am getting the following error when running the embed chunk: /chunk_output/s/3094A366/cbdj6quzf4tem/mct.html not found

mct.Rmd has the slides and the following:

---
title: "Chapter 04 - Measures of Central Tendency"
subtitle: "⚔<br/>Introduction to Statistics for Kinesiology Students"
author: "Furtado JR., O"
institute: "Cal State Northridge"
date: "updated: `r Sys.Date()`"
output:
  xaringan::moon_reader:
    lib_dir: libs
    nature:
      highlightStyle: github
      highlightLines: true
      countIncrementalSlides: true
---

```{r style-share-again, echo=FALSE}
xaringanExtra::style_share_again(
  share_buttons = c("twitter", "linkedin")
)

isk-mct.embed.Rmd has the following:

---
title: "ISK-Measures of Central Tendency"
author: "Furtado Jr., O."
date: "9/22/2021"
output: html_document
---

```{r embed-xaringan, echo=FALSE}
xaringanExtra::embed_xaringan(url = "mct.html", ratio = "4:3")
gadenbuie commented 2 years ago

There are two things that are (probably) going on there:

  1. The url for embed_xaringan() needs to be a public URL to slides that are hosted online. If you're only ever embedding the slides locally you could use url = paste0("file://", normalizePath("mct.html")) but the slides won't be embedded if you share the .html file where they're embedded or put that file online.

  2. The other thing that's happening is that html_document sets self_contained: true by default, which results in pandoc trying to in-line the mct.html file. For now you can add self_contained: false to the html_document options in the frontmatter. I'll open a separate issue to remind myself to make this unnecessary.