r-wasm / quarto-drop

Drop down an interactive R or Python console, code editor, and plotting window from the top of your Quarto slides.
https://r-wasm.github.io/quarto-drop/
MIT License
158 stars 4 forks source link

Pre-populate quarto-drop with R code #13

Open rasanderson opened 1 month ago

rasanderson commented 1 month ago

Hello This is a really useful extension. Just wondering if there is a way to pre-populate the Quarto Drop editor with some example R code to show during the presentation, rather than copy-and-paste. I've tried changing the YAML to

format: 
  revealjs:
    revealjs-plugins: 
      - drop
    drop:
      engine: webr
      webr:
        init:
          - "init.R"
        packages:
          - ggplot2

But any code in init.R isn't being detected and displayed in the drop-down.

georgestagg commented 1 week ago

Not currently, but I think it's a good idea and something that we should support in a future version.