From d2897c96f7b280f8101477757294f604d0462982 Mon Sep 17 00:00:00 2001 From: Franklin Koch Date: Fri, 10 May 2024 00:51:07 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AE=20Look=20to=20remoteBaseUrl=20inst?= =?UTF-8?q?ead=20of=20location=20for=20disabling=20jupyter=20computation?= =?UTF-8?q?=20(#382)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/giant-bugs-rest.md | 2 +- packages/jupyter/src/decoration.tsx | 10 +++++----- packages/jupyter/src/embed.tsx | 2 +- packages/jupyter/src/figure.tsx | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.changeset/giant-bugs-rest.md b/.changeset/giant-bugs-rest.md index f624cf7a6..8ae312c31 100644 --- a/.changeset/giant-bugs-rest.md +++ b/.changeset/giant-bugs-rest.md @@ -2,4 +2,4 @@ '@myst-theme/jupyter': patch --- -Require location on node source to enable jupyter computation +Disable jupyter computation on nodes if remoteBaseUrl is present diff --git a/packages/jupyter/src/decoration.tsx b/packages/jupyter/src/decoration.tsx index 9b6765f9e..a215a28b4 100644 --- a/packages/jupyter/src/decoration.tsx +++ b/packages/jupyter/src/decoration.tsx @@ -32,14 +32,14 @@ export function OutputDecoration({ children, title = 'Jupyter Notebook', url, - location, + remoteBaseUrl, }: { outputId: string; placeholder?: GenericNode; children?: React.ReactNode; title?: string; url?: string; - location?: string; + remoteBaseUrl?: string; }) { const { kind } = useCellExecution(outputId); const compute = useComputeOptions(); @@ -50,7 +50,7 @@ export function OutputDecoration({ compute?.enabled && compute?.features.figureCompute && kind === SourceFileKind.Article && - location; + !remoteBaseUrl; if (showComputeControls) { return ( @@ -65,7 +65,7 @@ export function OutputDecoration({ Source: {url && ( {title} @@ -92,7 +92,7 @@ export function OutputDecoration({
Source:
{url && ( {title} diff --git a/packages/jupyter/src/embed.tsx b/packages/jupyter/src/embed.tsx index e7b2006e8..367801bb9 100644 --- a/packages/jupyter/src/embed.tsx +++ b/packages/jupyter/src/embed.tsx @@ -11,7 +11,7 @@ export function Embed({ node }: { node: GenericNode }) { outputId={output.id} title={node.source?.title} url={node.source?.url} - location={node.source?.location} + remoteBaseUrl={node.source?.remoteBaseUrl} > diff --git a/packages/jupyter/src/figure.tsx b/packages/jupyter/src/figure.tsx index 59c4f02b5..e523e2742 100644 --- a/packages/jupyter/src/figure.tsx +++ b/packages/jupyter/src/figure.tsx @@ -22,7 +22,7 @@ export function Figure({ node }: { node: GenericNode }) { placeholder={placeholder} title={node.source?.title} url={node.source?.url} - location={node.source?.location} + remoteBaseUrl={node.source?.remoteBaseUrl} >