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
cat
can print to message stream viafile
argument. - Replace
cat
with something likecli::cli_text
with appropriate escaping/interpolation of programmatically-constructed/user-input/etc. strings, if it outputs in an acceptable format.
Metadata
Metadata
Assignees
Labels
No labels