Compare commits

...

5 Commits

Author SHA1 Message Date
wch
f06a2ec9ee devtools::document() (GitHub Actions) 2022-06-10 15:00:23 +00:00
Winston Chang
26f032d7f8 Code formatting 2022-06-10 09:55:07 -05:00
Joe Cheng
864d0112cb Update NEWS 2022-06-10 09:55:07 -05:00
Joe Cheng
0813478276 Tweak docs, rebuild Rd files 2022-06-10 09:55:07 -05:00
Neutron3529
3aa13401b5 make mathjax configurable
Provide two option, `MathJax_url` and `MathJax_config`, to enable the modification of the default mathjax.js.
Since the response of `mathjax.rstudio.com` could be slower in some regions, it is better to provide a default value and a configure technique to enable the modification of the default mathjax url.

change the names of the two newly added options

update the doc of newly added shiny.mathjax.*
2022-06-10 09:55:07 -05:00
5 changed files with 19 additions and 5 deletions

View File

@@ -17,6 +17,8 @@ shiny development
* The auto-reload feature (`options(shiny.autoreload=TRUE)`) was not being activated by `devmode(TRUE)`, despite a console message asserting that it was. (#3620)
* Add `shiny.mathjax.url` and `shiny.mathjax.config` options for configuring the MathJax URL used by `withMathJax`. Thanks, @Neutron3529! (#3639)
### Bug fixes
* Closed tidyverse/dplyr#5552: Compatibility of dplyr 1.0 (and rlang chained errors in general) with `req()`, `validate()`, and friends.

View File

@@ -94,6 +94,10 @@ getShinyOption <- function(name, default = NULL) {
#' numbers to JSON format to send to the client web browser.}
#' \item{shiny.launch.browser (defaults to `interactive()`)}{A boolean which controls the default behavior
#' when an app is run. See [runApp()] for more information.}
#' \item{shiny.mathjax.url (defaults to `"https://mathjax.rstudio.com/latest/MathJax.js"`)}{
#' The URL that should be used to load MathJax, via [withMathJax()].}
#' \item{shiny.mathjax.config (defaults to `"config=TeX-AMS-MML_HTMLorMML"`)}{The querystring
#' used to load MathJax, via [withMathJax()].}
#' \item{shiny.maxRequestSize (defaults to 5MB)}{This is a number which specifies the maximum
#' web request size, which serves as a size limit for file uploads.}
#' \item{shiny.minified (defaults to `TRUE`)}{By default

View File

@@ -14,7 +14,11 @@ NULL
#' # now we can just write "static" content without withMathJax()
#' div("more math here $$\\sqrt{2}$$")
withMathJax <- function(...) {
path <- 'https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
path <- paste0(
getOption("shiny.mathjax.url", "https://mathjax.rstudio.com/latest/MathJax.js"),
"?",
getOption("shiny.mathjax.config", "config=TeX-AMS-MML_HTMLorMML")
)
tagList(
tags$head(
singleton(tags$script(src = path, type = 'text/javascript'))

View File

@@ -4,7 +4,7 @@
\alias{downloadHandler}
\title{File Downloads}
\usage{
downloadHandler(filename, content, contentType = NA, outputArgs = list())
downloadHandler(filename, content, contentType = NULL, outputArgs = list())
}
\arguments{
\item{filename}{A string of the filename, including extension, that the
@@ -19,9 +19,9 @@ function.)}
\item{contentType}{A string of the download's
\href{https://en.wikipedia.org/wiki/Internet_media_type}{content type}, for
example \code{"text/csv"} or \code{"image/png"}. If \code{NULL} or
\code{NA}, the content type will be guessed based on the filename
extension, or \code{application/octet-stream} if the extension is unknown.}
example \code{"text/csv"} or \code{"image/png"}. If \code{NULL}, the content type
will be guessed based on the filename extension, or
\code{application/octet-stream} if the extension is unknown.}
\item{outputArgs}{A list of arguments to be passed through to the implicit
call to \code{\link[=downloadButton]{downloadButton()}} when \code{downloadHandler} is used

View File

@@ -73,6 +73,10 @@ then jQuery 3.6.0 is used.}
numbers to JSON format to send to the client web browser.}
\item{shiny.launch.browser (defaults to \code{interactive()})}{A boolean which controls the default behavior
when an app is run. See \code{\link[=runApp]{runApp()}} for more information.}
\item{shiny.mathjax.url (defaults to \code{"https://mathjax.rstudio.com/latest/MathJax.js"})}{
The URL that should be used to load MathJax, via \code{\link[=withMathJax]{withMathJax()}}.}
\item{shiny.mathjax.config (defaults to \code{"config=TeX-AMS-MML_HTMLorMML"})}{The querystring
used to load MathJax, via \code{\link[=withMathJax]{withMathJax()}}.}
\item{shiny.maxRequestSize (defaults to 5MB)}{This is a number which specifies the maximum
web request size, which serves as a size limit for file uploads.}
\item{shiny.minified (defaults to \code{TRUE})}{By default