Skip to content

Commit

Permalink
docs: Convert website to use {pkgdown} (#902)
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy authored Feb 19, 2024
1 parent 5cfe70b commit dc772e7
Show file tree
Hide file tree
Showing 282 changed files with 195 additions and 124,667 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@
^revdep$
^CRAN-SUBMISSION$
^_dev$
^vignettes/articles$
^pkgdown$
5 changes: 2 additions & 3 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ on:
name: Package checks

jobs:
## Website is not pkgdown; Run `source("tools/docs_update.R")` on release!
# website:
# uses: rstudio/shiny-workflows/.github/workflows/website.yaml@v1
website:
uses: rstudio/shiny-workflows/.github/workflows/website.yaml@v1
routine:
uses: rstudio/shiny-workflows/.github/workflows/routine.yaml@v1
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ revdep/checks.noindex
revdep/library.noindex
revdep/data.sqlite
viztest-*
inst/doc
docs
3 changes: 3 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,15 @@ Suggests:
purrr,
R6,
RJSONIO,
rmarkdown,
s2,
sf (>= 0.9-6),
shiny,
terra,
testthat (>= 3.0.0)
Config/testthat/edition: 3
Config/Needs/website: dplyr, geojsonio, ncdf4, tidyverse/tidytemplate
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.1
VignetteBuilder: knitr
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ S3method(polygonData,matrix)
S3method(polygonData,sf)
S3method(polygonData,sfc)
S3method(polygonData,sfg)
S3method(toPaletteFunc,"function")
S3method(toPaletteFunc,character)
S3method(toPaletteFunc,matrix)
S3method(to_multipolygon,Lines)
S3method(to_multipolygon,MULTILINESTRING)
S3method(to_multipolygon,MULTIPOLYGON)
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# leaflet (development version)

* Fixed #893: Correctly call `terra::crs()` when checking the CRS of a `SpatVector` object in `pointData()` or `polygonData()` (thanks @mkoohafkan, #894).

* Replace viridis dependency by viridisLite (@olivroy, #897)
* `{leaflet}` now has a brand new pkgdown site (@olivroy, #902)
* Replace `{viridis}` dependency by `{viridisLite}` (@olivroy, #897)

* `addRasterImage` now takes `options = gridOptions()`, so that arbitrary Leaflet layer options can be controlled. (#692)

Expand Down
3 changes: 3 additions & 0 deletions R/colors.R
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ brewer_pal <- function(palette, n = NULL) {

# Strings are interpreted as color names, unless length is 1 and it's the name
# of an RColorBrewer palette that is marked as qualitative
#' @export
toPaletteFunc.character <- function(pal, alpha, nlevels) {
if (length(pal) == 1 && pal %in% row.names(RColorBrewer::brewer.pal.info)) {
paletteInfo <- RColorBrewer::brewer.pal.info[pal, ]
Expand All @@ -341,11 +342,13 @@ toPaletteFunc.character <- function(pal, alpha, nlevels) {
}

# Accept colorRamp style matrix
#' @export
toPaletteFunc.matrix <- function(pal, alpha, nlevels) {
toPaletteFunc(rgb(pal, maxColorValue = 255), alpha = alpha)
}

# If a function, just assume it's already a function over [0-1]
#' @export
toPaletteFunc.function <- function(pal, alpha, nlevels) {
pal
}
Expand Down
1 change: 0 additions & 1 deletion R/leaflet-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ NULL
release_bullets <- function() {
c(
"Update static imports: `staticimports::import()`",
"Rebuild website: `source(\"scripts/docs_update.R\")`",
'Check Super Zip example: `shiny::runGitHub("rstudio/shiny-examples", subdir = "063-superzip-example")`',
"Check licenses if bundled dependencies were updated",
'`source("scripts/viztest.R")`'
Expand Down
3 changes: 0 additions & 3 deletions docs/.gitignore

This file was deleted.

Empty file removed docs/.nojekyll
Empty file.
19 changes: 0 additions & 19 deletions docs/Makefile

This file was deleted.

11 changes: 0 additions & 11 deletions docs/_includes/after_body.html

This file was deleted.

66 changes: 0 additions & 66 deletions docs/_includes/before_body.html

This file was deleted.

10 changes: 0 additions & 10 deletions docs/_output.yaml

This file was deleted.

Loading

0 comments on commit dc772e7

Please sign in to comment.