Skip to content

Commit 4286e90

Browse files
authored
Merge pull request #1568 from Cimbali/patch-1
Add the R builds script to file-scrapers reference
2 parents 6773897 + 5721ca0 commit 4286e90

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/file-scrapers.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,28 @@ curl -L https://docs.python.org/ftp/python/doc/$RELEASE/python-$RELEASE-docs-htm
181181
tar xj --strip-components=1
182182
```
183183

184+
## R
185+
```bash
186+
DEVDOCSROOT=/path/to/devdocs/docs/r
187+
RLATEST=https://cran.r-project.org/src/base/R-latest.tar.gz # or /R-${VERSION::1}/R-$VERSION.tar.gz
188+
189+
RSOURCEDIR=${TMPDIR:-/tmp}/R/latest
190+
RBUILDDIR=${TMPDIR:-/tmp}/R/build
191+
mkdir -p "$RSOURCEDIR" "$RBUILDDIR" "$DEVDOCSROOT"
192+
193+
# Download, configure, and build with static HTML pages
194+
curl "$RLATEST" | tar -C "$RSOURCEDIR" -xzf - --strip-components=1
195+
(cd "$RBUILDDIR" && "$RSOURCEDIR/configure" --enable-prebuilt-html --with-recommended-packages --disable-byte-compiled-packages --disable-shared --disable-java)
196+
make _R_HELP_LINKS_TO_TOPICS_=FALSE -C "$RBUILDDIR"
197+
198+
# Export all html documentation built − global, and per-package
199+
cp -r "$RBUILDDIR/doc" "$DEVDOCSROOT/"
200+
ls -d "$RBUILDDIR"/library/*/html | while read orig; do
201+
dest="$DEVDOCSROOT${orig#$RBUILDDIR}"
202+
mkdir -p "$dest" && cp -r "$orig"/* "$dest/"
203+
done
204+
```
205+
184206
## RDoc
185207

186208
### Nokogiri

0 commit comments

Comments
 (0)