R/duckdb_explain_hook.R
duckdb_explain_hook.Rd
ChatGPT generated explanaition: this code defines a custom knitr hook (duckdb_explain) that modifies the rendering of SQL code chunks. When executed before a code chunk, it formats the SQL query explanation using HTML tags for preformatted code display. When executed after a code chunk, it reverts the rendering behavior to the default. This is useful for producing nicely formatted query explanations in knitr documents.
duckdb_explain_hook(all = NULL)
whether to set all chunks as duckdb_explain
function called for its side effects
if (FALSE) {
# Simply put this line on the setup chunk of your .Rmd file
# and then set the chunk option `duckdb_explain` to TRUE when
# you want to override standard printing of sql chunks
efun::duckdb_explain_hook()
}