Skip to content

Commit a18cc0c

Browse files
committed
Generate URL based on the package version
1 parent d4f346f commit a18cc0c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

R/create-docs.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,19 @@ mkdir -p pkg/html
5252
pushd pkg/html
5353

5454
"$R_SCRIPT_PATH/Rscript" -e 'libDir <- "../../lib"; library(SparkR, lib.loc=libDir); knitr::knit_rd("SparkR", links = tools::findHTMLlinks(file.path(libDir, "SparkR")))'
55+
56+
57+
# Determine Spark(R) version
58+
SPARK_VERSION=$(grep -oP "(?<=Version:\ ).*" ../DESCRIPTION)
59+
60+
# Update url
61+
sed "s/{SPARK_VERSION}/$SPARK_VERSION/" ../pkgdown/_pkgdown_template.yml > ../_pkgdown.yml
62+
5563
"$R_SCRIPT_PATH/Rscript" -e 'libDir <- "../../lib"; library(SparkR, lib.loc=libDir); pkgdown::build_site("..")'
5664

65+
# Clean temporary config
66+
rm ../_pkgdown.yml
67+
5768
popd
5869

5970
popd
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616
#
1717

18-
url: ~
18+
url: https://spark.apache.org/docs/{SPARK_VERSION}/api/R/
1919

2020
template:
2121
package: preferably

0 commit comments

Comments
 (0)