Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xaringan knit landing page #336

Open
issactoast opened this issue Oct 29, 2021 · 2 comments
Open

xaringan knit landing page #336

issactoast opened this issue Oct 29, 2021 · 2 comments

Comments

@issactoast
Copy link

Hi yihui,

Thank you for making all these tools. I am heavily using this xaringan in day-to-day life. :)

I just wonder how to make xaringan kniting result page to show my current working slide like if I am using inf_mr().

The reason why I asking this is that if use inf_mr() I need to turn it on and off when there is an error in my code in the slide. (that's very annoying, it becomes slow and ultimately I need to restart the RStudio every time)

All I want is to see the current slide when I knit xaringan page. Is there any option for this?

@yihui
Copy link
Owner

yihui commented Mar 17, 2022

if use inf_mr() I need to turn it on and off when there is an error in my code in the slide. (that's very annoying, it becomes slow and ultimately I need to restart the RStudio every time)

When there is an error in your code, inf_mr() should wait for you to fix the error and save the Rmd file. It shouldn't do anything else. If that is not the case, it's a bug (assuming you are using the latest versions of R packages). I don't have an idea about how it can become slow due to errors.

All I want is to see the current slide when I knit xaringan page. Is there any option for this?

Currently there isn't an option, but I guess it's possible to implement. I need to take a closer look.

@yihui
Copy link
Owner

yihui commented Mar 18, 2022

Okay, now I'm sure this is possible and relatively easy to implement. I just need someone to help me since I probably won't have time for it, but I do think this will be a useful feature.

To whomever interested in sending a PR:

First use slide_context() to get the slide number:

slide_context = function(ctx = rstudioapi::getSourceEditorContext()) {

Then insert slideshow.gotoSlide(n); in the JS here:

play_js, countdown_js, hl_pre_js), collapse = '\n')))

I hope this feature can be controlled by a global option, e.g., options(xaringan.rstudio.view_current = TRUE). Not sure if TRUE or FALSE would be a better default, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants