bookdown
bookdown copied to clipboard
Copy button should only copy code
- Need to update tooltip
- Probably just regexp to strip out lines starting with
#>
Maybe adding a hook that gives a certain class to the output (as downlit::evaluate_and_highlight()
would have done) -- then some xml2 tweaking as in https://github.com/r-lib/pkgdown/pull/1706/
This should probably wait until after we change how pkgdown/bookdown generates the divs within a code chunk.
But wouldn't changing these divs require adding a knitr hook? Or is this a downlit thing?
Right — currently I always set collapse = TRUE
which destroys all the divs within a chunk. I now see a way to get the styling I want while preserving those internal chunks.
I now see a way to get the styling I want while preserving those internal chunks.
Do you mean a change should happen in downlit?
This issue is to be tackled after https://github.com/r-lib/pkgdown/pull/1706 (since the logic should be the same).