quarto-dev / quarto

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

Visual editor doesn't recognize formats starting with `live-` #546

Open mine-cetinkaya-rundel opened 6 days ago

mine-cetinkaya-rundel commented 6 days ago

For using the visual editor with live-* formats (using quarto-live), the visual editor doesn't have the same features as those for the * format.

For example, inserting columns into slides:

Screenshot 2024-09-18 at 11 19 00 AM Screenshot 2024-09-18 at 11 19 15 AM
cderv commented 6 days ago

I was just curious to learn how we did detection.

https://github.com/quarto-dev/quarto/blob/3bd070a1ffabd0b2dc80c67f5d9fa9a2d8bee896/apps/lsp/src/service/quarto.ts#L118-L125

https://github.com/quarto-dev/quarto/blob/3bd070a1ffabd0b2dc80c67f5d9fa9a2d8bee896/packages/quarto-core/src/document.ts#L112-L138

Our regex will be something like ^format:\s+revealjs\s*$ so it will indeed not catch live-revealjs

Thanks for catching this !

We probably need to teach the extension about our format specification in Quarto parseFormatString() if we want to cover all the possible cases !

cscheid commented 6 days ago

We probably need to teach the extension about our format specification in Quarto parseFormatString() if we want to cover all the possible cases !

That's exactly what I was thinking. Ideally, the extension would be using the FormatDescription type here instead of a string, and using the same code.