Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

Commit ec609ad

Browse files
author
jennybc
committed
Forcibly rmarkdown::render() the vignettes
Required to make the rendered versions available/current on GitHub
1 parent 72e7644 commit ec609ad

12 files changed

+8644
-682
lines changed

vignettes/alternative-browser.R

Lines changed: 0 additions & 21 deletions
This file was deleted.

vignettes/alternative-browser.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
<head>
66

7-
<meta charset="utf-8">
7+
<meta charset="utf-8" />
88
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
<meta name="generator" content="pandoc" />
1010

1111
<meta name="viewport" content="width=device-width, initial-scale=1">
1212

1313
<meta name="author" content="Jennifer Bryan" />
1414

15-
<meta name="date" content="2016-07-02" />
15+
<meta name="date" content="2017-05-07" />
1616

1717
<title>Use an alternative browser</title>
1818

@@ -70,7 +70,7 @@
7070

7171
<h1 class="title toc-ignore">Use an alternative browser</h1>
7272
<h4 class="author"><em>Jennifer Bryan</em></h4>
73-
<h4 class="date"><em>2016-07-02</em></h4>
73+
<h4 class="date"><em>2017-05-07</em></h4>
7474

7575

7676

@@ -81,7 +81,7 @@ <h4 class="date"><em>2016-07-02</em></h4>
8181
## {
8282
## .Call(&quot;rs_browseURL&quot;, url)
8383
## }
84-
## &lt;environment: 0x102657358&gt;</code></pre>
84+
## &lt;environment: 0x10493db78&gt;</code></pre>
8585
<p>Two alternatives to change that temporarily for <code>gs_auth()</code>:</p>
8686
<p>Using just base R facilities.</p>
8787
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw">library</span>(googlesheets)
@@ -107,7 +107,7 @@ <h4 class="date"><em>2016-07-02</em></h4>
107107
(function () {
108108
var script = document.createElement("script");
109109
script.type = "text/javascript";
110-
script.src = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
110+
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
111111
document.getElementsByTagName("head")[0].appendChild(script);
112112
})();
113113
</script>

vignettes/alternative-browser.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Use an alternative browser
2+
Jennifer Bryan
3+
`r Sys.Date()`
4+
5+
What if you want to do auth in a non-default browser? Examples below show requests for Google Chrome or Safari on Mac OS X.
6+
7+
At runtime, the browser is given via the `browser` element of `options()`.
8+
9+
10+
```r
11+
getOption("browser")
12+
```
13+
14+
```
15+
## function (url)
16+
## {
17+
## .Call("rs_browseURL", url)
18+
## }
19+
## <environment: 0x10493db78>
20+
```
21+
22+
Two alternatives to change that temporarily for `gs_auth()`:
23+
24+
Using just base R facilities.
25+
26+
27+
```r
28+
library(googlesheets)
29+
30+
op <- options(browser = "/usr/bin/open -a '/Applications/Google Chrome.app'")
31+
#op <- options(browser = "/usr/bin/open -a '/Applications/Safari.app'")
32+
gs_auth()
33+
options(op)
34+
```
35+
36+
Using with [`withr` package](https://cran.r-project.org/package=withr).
37+
38+
39+
```r
40+
library(withr)
41+
library(googlesheets)
42+
43+
with_options(
44+
# list(browser = "/usr/bin/open -a '/Applications/Safari.app'"),
45+
list(browser = "/usr/bin/open -a '/Applications/Google Chrome.app'"),
46+
gs_auth()
47+
)
48+
```
49+

0 commit comments

Comments
 (0)