History

Merge pull request #1568 from Cimbali/patch-1

Add the R builds script to file-scrapers reference

Bryan Hernández committed 5 years ago

Commit 4286e902 parents 6773897 5721ca01 file · +22 −0Browse files

Unified · Split

docs/file-scrapers.md+22−0
@@ -181,6 +181,28 @@ curl -L https://docs.python.org/ftp/python/doc/$RELEASE/python-$RELEASE-docs-htm · 180 unmodified lines
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