From 644d4b768e516710466641726fc6972ece28d171 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Fri, 3 May 2024 18:13:25 +0200 Subject: [PATCH] Use `quarto.config.cli_path()` from Quarto 1.5.32+ to get the path to the Quarto CLI executable. Otherwise, this extension fails to call `quarto run` on environment where `quarto` is not in the PATH. Though, even if in the PATH, it could be calling another quarto CLI that the one used to run the extension --- _extensions/quarto-ext/shinylive/_extension.yml | 4 ++-- _extensions/quarto-ext/shinylive/shinylive.lua | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/_extensions/quarto-ext/shinylive/_extension.yml b/_extensions/quarto-ext/shinylive/_extension.yml index 01b4d68..182997a 100644 --- a/_extensions/quarto-ext/shinylive/_extension.yml +++ b/_extensions/quarto-ext/shinylive/_extension.yml @@ -1,8 +1,8 @@ name: shinylive title: Embedded Shinylive applications author: Winston Chang -version: 0.1.0 -quarto-required: ">=1.2.198" +version: 0.2.0 +quarto-required: ">= 1.5.32" contributes: filters: - shinylive.lua diff --git a/_extensions/quarto-ext/shinylive/shinylive.lua b/_extensions/quarto-ext/shinylive/shinylive.lua index e2828db..881ab7b 100644 --- a/_extensions/quarto-ext/shinylive/shinylive.lua +++ b/_extensions/quarto-ext/shinylive/shinylive.lua @@ -1,4 +1,7 @@ -- Notes: +-- * 2024/05/03 - Christophe: +-- `quarto run` needs to be called using the same quarto CLI that called the extension. +-- This is done by using `quarto.cli_path` from Quarto 1.5 Lua API. -- * 2023/10/04 - Barret: -- Always use `callShinyLive()` to call a shinylive extension. -- `callPythonShinyLive()` and `callRShinyLive()` should not be used directly. @@ -415,7 +418,8 @@ return { -- Convert code block to JSON string in the same format as app.json. local parsedCodeblockJson = pandoc.pipe( - "quarto", + -- Use quarto binary that called this extension + quarto.config.cli_path(), { "run", codeblockScript, language }, el.text )