Skip to content

Commit 8bd9c6e

Browse files
authored
Merge pull request #11803 from PumasAI/jk/engine-commands
Add `call engine julia` commands
2 parents 31380d6 + 39ae1c4 commit 8bd9c6e

File tree

12 files changed

+591
-96
lines changed

12 files changed

+591
-96
lines changed

news/changelog-1.7.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ All changes included in 1.7:
8888

8989
- ([#12121](https://github.com/quarto-dev/quarto-cli/pull/12121)): Update QuartoNotebookRunner to 0.14.0. Support for evaluating Python cells via [PythonCall.jl](https://github.com/JuliaPy/PythonCall.jl) added. Support for notebook caching via `execute.cache` added.
9090
- ([#12151](https://github.com/quarto-dev/quarto-cli/pull/12151)): Basic YAML validation is now active for document using Julia engine.
91+
- ([#11803](https://github.com/quarto-dev/quarto-cli/pull/11803)): Added subcommands `status`, `kill`, `close [--force]` and `log` under the new CLI command `quarto call engine julia`.
9192

9293
### `jupyter`
9394

@@ -105,3 +106,4 @@ All changes included in 1.7:
105106
- ([#11951](https://github.com/quarto-dev/quarto-cli/issues/11951)): Raw LaTeX table without `tbl-` prefix label for using Quarto crossref are now correctly passed through unmodified.
106107
- ([#12117](https://github.com/quarto-dev/quarto-cli/issues/12117)): Color output to stdout and stderr is now correctly rendered for `html` format in the Jupyter and Julia engines.
107108
- ([#12264](https://github.com/quarto-dev/quarto-cli/issues/12264)): Upgrade `dart-sass` to 1.85.1.
109+
- ([#11803](https://github.com/quarto-dev/quarto-cli/pull/11803)): Added a new CLI command `quarto call`. First users of this interface are the new `quarto call engine julia ...` subcommands.

src/command/call/cmd.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Command } from "cliffy/command/mod.ts";
2+
import { engineCommand } from "../../execute/engine.ts";
3+
4+
export const callCommand = new Command()
5+
.name("call")
6+
.description("Access functions of Quarto subsystems such as its rendering engines.")
7+
.action(() => {
8+
callCommand.showHelp();
9+
Deno.exit(1);
10+
}).command("engine", engineCommand);

src/command/command.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { addCommand } from "./add/cmd.ts";
2929
import { uninstallCommand } from "./uninstall/cmd.ts";
3030
import { createCommand } from "./create/cmd.ts";
3131
import { editorSupportCommand } from "./editor-support/cmd.ts";
32+
import { callCommand } from "./call/cmd.ts";
3233

3334
// deno-lint-ignore no-explicit-any
3435
export function commands(): Command<any>[] {
@@ -57,5 +58,6 @@ export function commands(): Command<any>[] {
5758
checkCommand,
5859
buildJsCommand,
5960
editorSupportCommand,
61+
callCommand,
6062
];
6163
}

src/execute/engine.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { pandocBuiltInFormats } from "../core/pandoc/pandoc-formats.ts";
3131
import { gitignoreEntries } from "../project/project-gitignore.ts";
3232
import { juliaEngine } from "./julia.ts";
3333
import { ensureFileInformationCache } from "../project/project-shared.ts";
34+
import { Command } from "cliffy/command/mod.ts";
3435

3536
const kEngines: Map<string, ExecutionEngine> = new Map();
3637

@@ -276,3 +277,30 @@ export function projectIgnoreGlobs(dir: string) {
276277
gitignoreEntries(dir).map((ignore) => `**/${ignore}**`),
277278
);
278279
}
280+
281+
export const engineCommand = new Command()
282+
.name("engine")
283+
.description(
284+
`Access functionality specific to quarto's different rendering engines.`,
285+
)
286+
.action(() => {
287+
engineCommand.showHelp();
288+
Deno.exit(1);
289+
});
290+
291+
kEngines.forEach((engine, name) => {
292+
if (engine.populateCommand) {
293+
const engineSubcommand = new Command();
294+
// fill in some default behavior for each engine command
295+
engineSubcommand
296+
.description(
297+
`Access functionality specific to the ${name} rendering engine.`,
298+
)
299+
.action(() => {
300+
engineSubcommand.showHelp();
301+
Deno.exit(1);
302+
});
303+
engine.populateCommand(engineSubcommand);
304+
engineCommand.command(name, engineSubcommand);
305+
}
306+
});

0 commit comments

Comments
 (0)