I'm working on a package that can inject author data in Quarto documents. I'd like to allow users to create a place holder to insert some data in a specific location in the document. I can easily modify the Quarto document using a function in an external script. However, I'd ideally prefer to insert the place holder directly from the IDE using a shortcut (similar to
Ctrl + Alt + I/
Cmd + Option + I to insert a code chunk in R markdown). I presume the code chunk shortcut is integrated in RStudio but is it possible to implement such snippet/shortcut in a custom package?
I'm aware of addin and
rstudioapi::insertText(). It's not really what I want though because that only executes a function via a shortcut so it can't be used to insert the place holder in an R markdown document directly.
I'm asking out of curiosity, if that's doable but hard to implement, I'll simply use a normal function.