Skip to content

Support for multi-line @examplesIf? #1242

@jonkeane

Description

@jonkeane

When using @examplesIf I sometimes have conditions that are longer than can naturally fit on one line. It looks like @examplesIf currently takes only the first line and then disregards the rest of the lines, which leads to a malformed condition.

A (toy) example is:

#' @examplesIf {
#'   requireNamespace("dplyr", quietly = TRUE) &&
#'   requireNamespace("duckdb", quietly = TRUE) &&
#'   packageVersion("duckdb") > "0.2.7"
#' }

Which errors with Warning: [{file path}] @examplesIf failed to parse condition of @examplesIf

Would supporting multi-line @examplesIf conditions be something useful? I'm happy to look into this and submit a PR if it is.

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