-
Notifications
You must be signed in to change notification settings - Fork 12
Closed
Description
E.g., mixing cat (printing to output stream) and {cli} functions ([issuing messages that knitr intercepts or] printing to message stream) in print.epi_recipe and print.frosting leads to some trouble with knitting documents.
E.g., trying to rebuild forecast-framework.qmd in delphi-tooling book has this in a chunk with #| collapse: true earlier in the document for printing an epi_recipe:
#> ── Operations
#> 1.
#> Lagging: case_rate by 0, 7, 14 | Trained
#> 2.
#> Lagging: death_rate by 0, 7, 14 | Trained
#> 3.
#> Leading: death_rate by 7 | Trained
#> 4.
#> • Removing rows with NA values in: lag_0_case_rate, ... | Trained
#> 5.
#> • Removing rows with NA values in: ahead_7_death_rate | Trained
#> 6.
#> • # of recent observations per key limited to:: Inf | Trained
or, when printing a frosting with some other set of options:
It also messes with capture.output, which only captures one stream at a time (ordering is lost).
Potential fixes:
- See if
catcan print to message stream viafileargument. - Replace
catwith something likecli::cli_textwith appropriate escaping/interpolation of programmatically-constructed/user-input/etc. strings, if it outputs in an acceptable format. - See if
cat(cli::format_message(.....))works to avoid issuing messages. - See if
cli::cat_{line,print}work to avoid non-message printing. [no]
Metadata
Metadata
Assignees
Labels
No labels
