Skip to content

Commit

Permalink
Merge pull request #138 from quarto-dev/rsconnect-as-suggest
Browse files Browse the repository at this point in the history
  • Loading branch information
cderv authored Jan 22, 2024
2 parents 1c8dc29 + 6199eca commit ff63ecb
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 23 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
^docs$
^pkgdown$
^\.github$
^\.vscode$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.Rproj.user
.Rhistory

.vscode

inst/doc
docs
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Package: quarto
Title: R Interface to 'Quarto' Markdown Publishing System
Version: 1.3.4
Version: 1.3.5
Authors@R: c(
person("JJ", "Allaire", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-0174-9868")),
person("Christophe", "Dervieux", , "[email protected]", role = c("aut"),
person("Christophe", "Dervieux", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0003-4474-2498"))
)
Description: Convert R Markdown documents and 'Jupyter' notebooks to a
Expand All @@ -20,12 +20,13 @@ Imports:
processx,
rlang,
rmarkdown,
rsconnect (>= 0.8.26),
rstudioapi,
utils,
yaml
Suggests:
curl,
knitr,
rsconnect (>= 0.8.26),
testthat (>= 3.1.0),
withr,
xfun
Expand Down
12 changes: 7 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# quarto (development version)

* Add `quarto_add_extension()` and `quarto_use_template()` to deal with Quarto extensions for a Quarto project. (thanks, @mcanouil, #45, @remlapmot, #42).
- **rsconnect** R package dependency has been moved to Suggest to reduce this package's overall number of dependencies. **rsconnect** package is only required for publishing using `quarto_publish_*()` functions. If not installed, users will be prompted to install (when in interactive mode).

* Add `profile` arguments to `quarto_render()` and `quarto_inspect()` (thanks, #95, @andrewheiss, #123, @salim-b).
- Add `quarto_add_extension()` and `quarto_use_template()` to deal with Quarto extensions for a Quarto project. (thanks, @mcanouil, #45, @remlapmot, #42).

* Add `metadata` and `metadata_file` to `quarto_render()` to pass modify Quarto metadata from calling render. If both are set, `metadata` will be merged over `metadata_file` content. Internally, metadata will be passed as a `--metadata-file` to `quarto render` (thanks, @mcanouil, #52, @maelle, #49).
- Add `profile` arguments to `quarto_render()` and `quarto_inspect()` (thanks, #95, @andrewheiss, #123, @salim-b).

* Added a `NEWS.md` file to track changes to the package.
- Add `metadata` and `metadata_file` to `quarto_render()` to pass modify Quarto metadata from calling render. If both are set, `metadata` will be merged over `metadata_file` content. Internally, metadata will be passed as a `--metadata-file` to `quarto render` (thanks, @mcanouil, #52, @maelle, #49).

* `execute_params` in `quarto_render()` now converts boolean value to `true/false` correctly as expected by `quarto render` (thanks, @marianklose, #124).
- Added a `NEWS.md` file to track changes to the package.

- `execute_params` in `quarto_render()` now converts boolean value to `true/false` correctly as expected by `quarto render` (thanks, @marianklose, #124).
24 changes: 10 additions & 14 deletions R/publish.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ quarto_publish_doc <- function(input,
render = c("local", "server", "none"),
metadata = list(),
...) {

validate_rsconnect()
# resolve render
render <- match.arg(render)

Expand Down Expand Up @@ -144,6 +146,9 @@ quarto_publish_app <- function(input = getwd(),
render = c("local", "server", "none"),
metadata = list(),
...) {

validate_rsconnect()

# resolve render
render <- match.arg(render)

Expand Down Expand Up @@ -196,6 +201,8 @@ quarto_publish_site <- function(input = getwd(),
metadata = list(),
...) {

validate_rsconnect()

# resolve render
render <- match.arg(render)

Expand Down Expand Up @@ -286,6 +293,7 @@ is_shiny_prerendered <- function(runtime, server = NULL) {


rpubs_publish_destination <- function(doc, server) {
validate_rsconnect()
if (identical(server, "rpubs.com")) {
deployments <- rsconnect::deployments(doc, serverFilter = "rpubs.com")
if (nrow(deployments) > 0) {
Expand All @@ -305,7 +313,6 @@ rpubs_publish_destination <- function(doc, server) {

resolve_destination <- function(server, account, allowShinyapps) {

# validate we have the right version of rsconnect
validate_rsconnect()

# check for accounts
Expand Down Expand Up @@ -380,20 +387,9 @@ resolve_destination <- function(server, account, allowShinyapps) {
}


validate_rsconnect <- function() {
validate_rsconnect <- function(reason = "for publishing using quarto R package.") {

# confirm that we have rsconnect
if (!requireNamespace("rsconnect", quietly = FALSE)) {
stop("The rsconnect package is required for publishing. ",
"Please install rsconnect with:\n remotes::install_github(\"rstudio/rsconnect\")")
}

# confirm we have a recent enough version
rsc_version <- "0.8.24"
if (utils::packageVersion("rsconnect") < rsc_version) {
stop("Version ", rsc_version, " or greater of the rsconnect package is required ",
"for publishing. Please install with:\n remotes::install_github(\"rstudio/rsconnect\")")
}
rlang::check_installed("rsconnect", version = "0.8.26", reason = reason)
}

quarto_rsc_metadata <- function(inspect) {
Expand Down
5 changes: 4 additions & 1 deletion man/quarto_publish_doc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ff63ecb

Please sign in to comment.