quarto-dev / quarto

Quarto open-source scientific and technical publishing system
https://quarto.org
GNU Affero General Public License v3.0
341 stars 28 forks source link

[Feature Request] More VS code Insert <something> helper functions #343

Closed astrowonk closed 10 months ago

astrowonk commented 10 months ago

The Quarto VS Code extension has a insert code block option but… that's it. There's no other Insert anything. I would like specifically really like Insert Callout Block, but I think it would also be good to have:

And probably others I haven't thought of yet!

II use call out blocks infrequently, so I always forget the syntax, it'd be lovely if I could just find it in the command palette. Any blocks that use the ::: syntax would be nice to have inserted by VS Code.

I could use snippets? but snippets in VS Code for QUarto don't work either, see #33

jjallaire commented 10 months ago

Snippets issue is resolved here: https://github.com/quarto-dev/quarto/commit/a038849f35a2d78cfd8ffc54e94c5961b077b885

You can get diagrams via the "Insert executable code" block snippet.

v1.110.0 release that includes this change will be released this week.

If you want to help us provide more snippets here is the source file where they are defined: https://github.com/quarto-dev/quarto/blob/main/apps/vscode/snippets/quarto.code-snippets

Note that the inline python for v1.4 might want to wait until that is formally released (as it won't work for v1.3). Insert Figure is also partly covered by the "image" snippet. v1.4 includes better support for div based figures (however again we might not want to insert those in v1.3 documents as they won't necessarily work as expected).

jjallaire commented 10 months ago

This is available in v1.110.0 of the extension (just published to the marketplace).

astrowonk commented 10 months ago

This is available in v1.110.0 of the extension (just published to the marketplace).

I'm dazzled by how quickly this was resolved. Thanks!