xaringan:::inf_mr() detect css change.

Created on 13 Nov 2018  路  8Comments  路  Source: yihui/xaringan

I understand xaringan:::inf_mr() can detect Rmd change.
I need css work but it looks like don't detect custom css file change.
It's possible to add feature?

many thanks.

help wanted

Most helpful comment

Implemented. Please test the latest dev version here. Thanks for the suggestion!

All 8 comments

If you have the blogdown package installed, you can use the Touch File addin to change the timestamp of the Rmd and trigger inf_mr() to re-render.

We could make it work. If someone understands how this works, I can probably review a pull request (it is a good exercise):
https://github.com/yihui/xaringan/blob/5117c15f21e891633fad1c0961ef2c90896d1e6b/R/render.R#L238-L247

does ctrl+f5 work?

@tcgriffith It does, but there are problems:

  1. The slides must not be self-contained (use the default self_contained: false in xaringan::moon_reader).

  2. It only works perfectly in a real web browser, and will lose the current page in RStudio Viewer, meaning that when you refresh the slides in RStudio Viewer, you'll be brought to the first page of your slides.

  3. F5 (or Command + R on macOS) is extra work, albeit trivial.

PRed!
I added CSS files to the "watch list" (defined in YAML header) between the code mentioned above in https://github.com/yihui/xaringan/issues/185#issuecomment-438391448. .I tested it in a simple case and worked as expected.

Implemented. Please test the latest dev version here. Thanks for the suggestion!

Just a quick question, I've tested inf_mr with bookdown but the page is rendered as pure rmarkdown html instead of bookdown, but the render button will correctly knit the whole book.

How do I cast infinite moon reader on bookdown?

It is bookdown::serve_book(): https://bookdown.org/yihui/bookdown/serve-the-book.html But note that it does not respond to changes in CSS files.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rsangole picture rsangole  路  3Comments

paullemmens picture paullemmens  路  5Comments

tcgriffith picture tcgriffith  路  4Comments

ndphillips picture ndphillips  路  3Comments

burgerga picture burgerga  路  3Comments