## ----setup, include=FALSE-----------------------------------------------------
knitr::opts_chunk$set(
    collapse = TRUE,
    comment = "#>"
)
isAnVILWS <- function() {
    GCPtools::gcloud_exists() &&
    identical(AnVILBase::avplatform_namespace(), "AnVILGCP")
}

## ----install, eval = FALSE----------------------------------------------------
# if (!require("BiocManager", quietly = TRUE))
#     install.packages("BiocManager")
# 
# BiocManager::install("AnVILPublish")

## ----load,include=TRUE,results="hide",message=FALSE,warning=FALSE-------------
library(AnVILPublish)

## ----checkGCP-----------------------------------------------------------------
library(GCPtools)
gcloud_exists()

## ----gcloudsettings, eval = isAnVILWS()---------------------------------------
# gcloud_account()
# gcloud_project()

## ----checkQuarto--------------------------------------------------------------
system2("quarto", "--version", stdout = TRUE, stderr = TRUE)

## ----as_workspace, eval = FALSE-----------------------------------------------
# as_workspace(
#     "path/to/directory",          # directory containing DESCRIPTION file
#     "bioconductor-rpci-anvil",    # i.e., billing account
#     create = TRUE,                # use update = TRUE for an existing workspace
#     dry.run = TRUE                # set to FALSE to apply changes
# )

## ----as_notebook--------------------------------------------------------------
exampleRmd <- system.file(
    "extdata", "example.Rmd",
    package = "AnVILPublish",
    mustWork = TRUE
)

as_notebook(
    rmd_paths = exampleRmd,
    "bioconductor-rpci-anvil",     # i.e., billing account
    "Bioconductor-Package-Foo",    # Workspace name
    update = FALSE,                # make notebooks, but do not update workspace
    dry.run = TRUE                 # set to FALSE to apply changes
)

## ----add_access---------------------------------------------------------------
add_access(
    "bioconductor-rpci-anvil",
    "Bioconductor-Package-Foo",
    dry.run = TRUE                 # set to FALSE to apply changes
)

## ----sessionInfo--------------------------------------------------------------
sessionInfo()

