klippy
klippy copied to clipboard
Doesn't seem to work with custom language in a bookdown document
` {r include=FALSE} knitr::knit_engines$set( pwsh = function ( options ) { f = tempfile( 'code', '.', fileext = '.ps1' ) writeLines( c(
paste0( ' ', options$code )
), f ) on.exit( unlink( f ), add = TRUE ) cmd = Sys.which( 'pwsh.exe' ) extra = if ( options$eval ) { args <- paste0( ' ', f ) message( 'running: ', cmd, args ) tryCatch( system2( cmd, args, stdout = TRUE, stderr = TRUE, env = options$engine.env ), error = function ( e ) { if ( !options$error ) stop( e ) 'Error in executing pwsh code' } ) } if ( options$results == 'hide' ) extra = NULL knitr::engine_output( options, options$code, extra ) } )
klippy::klippy('') ` I added the above and it doesn't seem to work