Skip to content

Is a .qmd using parameters ? #245

@cderv

Description

@cderv
has_parameters <- function(input) {
  res <- quarto::quarto_inspect(input)
  if (res$engines == "jupyter") {
    return(
      "parameters" %in% res$fileInformation[[input]]$codeCells$metadata$tags
    )
  } else if (res$engines == "knitr") {
    return(
      "params" %in% names(res$fileInformation[[input]]$metadata)
    )
  } else {
    return(FALSE)
  }
}

The logic is to help find the information in the inspect result.

  • knitr documents having a params metadata are usually meant to be parameterised reports
  • jupyter documents having a cell will tag parameters are meant to be parameterised reports

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions