Skip to content

Commit 1b29aae

Browse files
committed
Update the README
1 parent b3ca734 commit 1b29aae

File tree

2 files changed

+76
-10
lines changed

2 files changed

+76
-10
lines changed

README.md

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,15 @@ published on the repository’s website served by GitHub Pages.
7474
Inside of a webR session, you can access the built binaries by using the
7575
repository’s GitHub Pages URL, e.g.
7676

77-
https://gh-username.github.io/repo-name
77+
``` default
78+
https://gh-username.github.io/repo-name
79+
```
80+
81+
Or, using the [r-universe](https://r-universe.dev/search/):
82+
83+
``` default
84+
https://username.r-universe.dev
85+
```
7886

7987
This can be set either using `options()` or specifying the location in
8088
each `webr::install()` call.
@@ -85,22 +93,56 @@ The easiest is probably to define the location webR should search for in
8593
``` r
8694
# Run once at the start of the session
8795
options(
88-
repos = c("https://gh-username.github.io/repo-name",
89-
"https://repo.r-wasm.org/")
96+
webr_pkg_repos = c(
97+
"https://gh-username.github.io/repo-name",
98+
"https://other-gh-username.github.io/another-repo",
99+
"https://username.r-universe.dev",
100+
"https://repo.r-wasm.org/"
101+
)
90102
)
91103

92104
# Call
93105
webr::install("pkgname")
94106
```
95107

96-
Otherwise, you can specify it each time:
108+
<div>
109+
110+
> **Note**
111+
>
112+
> This is different than the `repos` option one would usually set since
113+
> webR only checks the [`webr_pkg_repos`
114+
> key](https://github.com/r-wasm/webr/blob/010223433079d1a9ef3eb9bbf73d8eccb38e6adc/packages/webr/R/install.R#L23)
115+
116+
</div>
117+
118+
Otherwise, you can specify it each time in the `webr::install()`
119+
command:
97120

98121
``` r
99-
webr::install("pkgname", "https://gh-username.github.io/repo-name")
122+
webr::install("pkgname", c(
123+
"https://gh-username.github.io/repo-name",
124+
"https://other-gh-username.github.io/another-repo",
125+
"https://username.r-universe.dev",
126+
"https://repo.r-wasm.org/"
127+
)
128+
)
100129
```
101130

102131
<div>
103132

133+
> **Note**
134+
>
135+
> We do not suggest modifying at the initialization phase the
136+
> [`repoUrl`](https://docs.r-wasm.org/webr/latest/api/js/interfaces/WebR.WebROptions.html#repourl)
137+
> option in
138+
> [`WebR({})`](https://docs.r-wasm.org/webr/latest/api/js/classes/WebR.WebR.html)
139+
> as that will limit the packages to only one repository (e.g. the
140+
> custom repository).
141+
142+
</div>
143+
144+
<div>
145+
104146
> **Important**
105147
>
106148
> Please make sure the repository’s [GitHub Pages website is available

README.qmd

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,16 @@ on the repository's website served by GitHub Pages.
6565
Inside of a webR session, you can access the built binaries by using
6666
the repository's GitHub Pages URL, e.g.
6767

68-
```
68+
```default
6969
https://gh-username.github.io/repo-name
7070
```
7171

72+
Or, using the [r-universe](https://r-universe.dev/search/):
73+
74+
```default
75+
https://username.r-universe.dev
76+
```
77+
7278
This can be set either using `options()` or specifying the location in each
7379
`webr::install()` call.
7480

@@ -78,20 +84,38 @@ The easiest is probably to define the location webR should search for in
7884
```r
7985
# Run once at the start of the session
8086
options(
81-
repos = c("https://gh-username.github.io/repo-name",
82-
"https://repo.r-wasm.org/")
87+
webr_pkg_repos = c(
88+
"https://gh-username.github.io/repo-name",
89+
"https://other-gh-username.github.io/another-repo",
90+
"https://username.r-universe.dev",
91+
"https://repo.r-wasm.org/"
92+
)
8393
)
8494

8595
# Call
8696
webr::install("pkgname")
8797
```
8898

89-
Otherwise, you can specify it each time:
99+
:::{.callout-note}
100+
This is different than the `repos` option one would usually set since webR only checks the [`webr_pkg_repos` key](https://github.com/r-wasm/webr/blob/010223433079d1a9ef3eb9bbf73d8eccb38e6adc/packages/webr/R/install.R#L23)
101+
:::
102+
103+
Otherwise, you can specify it each time in the `webr::install()` command:
90104

91105
```r
92-
webr::install("pkgname", "https://gh-username.github.io/repo-name")
106+
webr::install("pkgname", c(
107+
"https://gh-username.github.io/repo-name",
108+
"https://other-gh-username.github.io/another-repo",
109+
"https://username.r-universe.dev",
110+
"https://repo.r-wasm.org/"
111+
)
112+
)
93113
```
94114

115+
:::{.callout-note}
116+
We do not suggest modifying at the initialization phase the [`repoUrl`](https://docs.r-wasm.org/webr/latest/api/js/interfaces/WebR.WebROptions.html#repourl) option in [`WebR({})`](https://docs.r-wasm.org/webr/latest/api/js/classes/WebR.WebR.html) as that will limit the packages to only one repository (e.g. the custom repository).
117+
:::
118+
95119
:::{.callout-important}
96120
Please make sure the repository's [GitHub Pages website is available over `HTTPS`](https://docs.github.com/en/pages/getting-started-with-github-pages/securing-your-github-pages-site-with-https#enforcing-https-for-your-github-pages-site) not `HTTP` (notice the lack of an `s`).
97121
You can verify this option was selected by:

0 commit comments

Comments
 (0)