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

How to close the live preview app? #37

Closed
TimTaylor opened this issue Oct 17, 2024 · 5 comments
Closed

How to close the live preview app? #37

TimTaylor opened this issue Oct 17, 2024 · 5 comments

Comments

@TimTaylor
Copy link
Contributor

Apologies if I have missed something obvious but is there a way to close the live preview app without closing the R session?

@yihui
Copy link
Owner

yihui commented Oct 17, 2024

If you are in RStudio Viewer, use the broom button to clear the page. If you are in a web browser, close the browser page.

@TimTaylor
Copy link
Contributor Author

If you are in a web browser, close the browser page.

AFAICT - this doesn't stop the app running (i.e. I can revisit the same address and still get the live updates).

@yihui
Copy link
Owner

yihui commented Oct 17, 2024

You are right. When the app doesn't have any active client connecting to it, it won't do anything and is harmless. Technically it is just a function registered in a special environment. If you do want to clean up that function, I can certainly provide a way to do it.

@TimTaylor
Copy link
Contributor Author

TimTaylor commented Oct 17, 2024

If you do want to clean up that function, I can certainly provide a way to do it.

That would be good. Even if I may not utilise the clean-up often, it does feel like something I should be able to do.

BTW - I really like litedown::roam(). This is will be awesome for navigating notes / presentations etc!

@yihui
Copy link
Owner

yihui commented Oct 23, 2024

I just provided an internal function xfun:::stop_app() to close the app. I didn't export it because I don't think it will be used often, but it will be nice if it's possible anyway.

clrpackages pushed a commit to clearlinux-pkgs/R-xfun that referenced this issue Nov 18, 2024
Michael Chirico (1):
      Remove unused function (#93)

Yihui Xie (16):
      start the next version
      add argument use_block = FALSE to protect_math()
      no need to escape " by default in html_escape()
      add a `start` argument to make_fence()
      ignore $ $ as inline math if backticks appear after opening $ or before closing $
      fix yihui/litedown#34: allow () around math expressions (outside dollar signs)
      only check `^<pre>` and `</pre>$`
      read_all()'s `before` and `after` functions can take the file content as the second argument
      tried an implementation of prose_index() via commonmark but it's too slow; leave the code here for future reference
      stop early if graphics device failed to open, e.g. png(type = 'cairo') can fail on macOS without xquartz, but it doesn't throw an error, so we have to check if dev.list() really has a new device
      fix yihui/litedown#38: for `name` and `call` values (typically from quote(), but could be from as.name() or call(), too), use do.call(quote = TRUE) in reocrd()
      forgot to suggest commonmark in aa75d8fb04d0637dbfccca0d3b6aa0c1e5108799
      try dev version of litedown
      close yihui/litedown#37: provide a helper function to clean up apps registered in tools:::.httpd.handlers.env
      amend 6b98bb6b05f8ff7c586057174ee093e2b2ea5231: knitr has tests that expect `"` to be converted to `&quot;`
      CRAN release v0.49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants