Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Only use quarto CLI path if method is available #52

Merged
merged 3 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion _extensions/quarto-ext/shinylive/_extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: shinylive
title: Embedded Shinylive applications
author: Winston Chang
version: 0.2.0
quarto-required: ">= 1.5.32"
quarto-required: ">= 1.2.198"
contributes:
filters:
- shinylive.lua
16 changes: 11 additions & 5 deletions _extensions/quarto-ext/shinylive/shinylive.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
-- 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.
Expand Down Expand Up @@ -396,6 +393,16 @@ function getShinyliveBaseDeps(language)
return deps
end

-- Legacy quarto cli location
quarto_cli_path = "quarto"
if quarto.config ~= nil and quarto.config.cli_path ~= nil then
-- * 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.config.cli_path()` from Quarto 1.5 Lua API.
-- https://github.com/quarto-dev/quarto-cli/pull/9576
quarto_cli_path = quarto.config.cli_path()
end

return {
{
CodeBlock = function(el)
Expand All @@ -418,8 +425,7 @@ return {

-- Convert code block to JSON string in the same format as app.json.
local parsedCodeblockJson = pandoc.pipe(
-- Use quarto binary that called this extension
quarto.config.cli_path(),
quarto_cli_path,
{ "run", codeblockScript, language },
el.text
)
Expand Down
Loading