Skip to content

Commit

Permalink
Merge pull request #960 from WolframResearch/bugfix/cloud-code-blocks
Browse files Browse the repository at this point in the history
Bugfix: Make new code block templates work in cloud
  • Loading branch information
rhennigan authored Nov 27, 2024
2 parents 0a31dae + 0f8aa44 commit 8aacb8f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
2 changes: 1 addition & 1 deletion PacletInfo.wl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PacletObject[ <|
"Name" -> "Wolfram/Chatbook",
"PublisherID" -> "Wolfram",
"Version" -> "1.5.2.11",
"Version" -> "1.5.2.12",
"WolframVersion" -> "14.1+",
"Description" -> "Wolfram Notebooks + LLMs",
"License" -> "MIT",
Expand Down
35 changes: 0 additions & 35 deletions Source/Chatbook/Formatting.wl
Original file line number Diff line number Diff line change
Expand Up @@ -2159,48 +2159,13 @@ inlineInteractiveCodeCell // beginDefinition;

inlineInteractiveCodeCell[ display_, string_ ] /; $dynamicText := display;

(* TODO: make this switch dynamically depending on $cloudNotebooks (likely as a TemplateBox)*)
inlineInteractiveCodeCell[ display_, string_ ] :=
inlineInteractiveCodeCell[ display, string, contentLanguage @ string ];

inlineInteractiveCodeCell[ display_, string_, lang_ ] /; $cloudNotebooks :=
cloudInlineInteractiveCodeCell[ display, string, lang ];

inlineInteractiveCodeCell[ display_, string_, lang_ ] := display;

inlineInteractiveCodeCell // endDefinition;

(* ::**************************************************************************************************************:: *)
(* ::Subsubsection::Closed:: *)
(*cloudInlineInteractiveCodeCell*)
cloudInlineInteractiveCodeCell // beginDefinition;

cloudInlineInteractiveCodeCell[ display_, string_, lang_ ] :=
Module[ { padded, buttons },

padded = Pane[ display, ImageSize -> { { 100, Automatic }, { 30, Automatic } } ];

buttons = Framed[
floatingButtonGrid[ string, lang ],
Background -> White,
FrameMargins -> { { 1, 0 }, { 0, 1 } },
FrameStyle -> White,
ImageMargins -> 1,
RoundingRadius -> 3
];

Mouseover[
buttonOverlay[ padded, Invisible @ buttons ],
buttonOverlay[ padded, buttons ],
ContentPadding -> False,
FrameMargins -> 0,
ImageMargins -> 0,
ImageSize -> All
]
];

cloudInlineInteractiveCodeCell // endDefinition;

(* ::**************************************************************************************************************:: *)
(* ::Subsubsection::Closed:: *)
(*buttonOverlay*)
Expand Down

0 comments on commit 8aacb8f

Please sign in to comment.