Skip to content

Commit 0de6595

Browse files
Nikola HristovNikola Hristov
authored andcommitted
1 parent 51e395c commit 0de6595

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

generators/app/templates/ext-notebook-renderer/Source/client/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,19 @@ export const activate: ActivationFunction = (context) => {
2727
shadow = element.attachShadow({ mode: "open" });
2828

2929
const root = document.createElement("div");
30+
3031
root.id = "root";
32+
3133
shadow.append(root);
3234
}
35+
3336
const root = shadow.querySelector<HTMLElement>("#root")!;
37+
3438
errorOverlay.wrap(root, () => {
3539
root.innerHTML = "";
3640

3741
const node = document.createElement("div");
42+
3843
root.appendChild(node);
3944

4045
render({

generators/app/templates/ext-notebook-renderer/Source/client/render.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ import * as style from "./style.css";
77

88
interface IRenderInfo {
99
container: HTMLElement;
10+
1011
mime: string;
12+
1113
value: any;
14+
1215
context: RendererContext<unknown>;
1316
}
1417

@@ -17,11 +20,15 @@ export function render({ container, mime, value }: IRenderInfo) {
1720
// Format the JSON and insert it as <pre><code>{ ... }</code></pre>
1821
// Replace this with your custom code!
1922
const pre = document.createElement("pre");
23+
2024
pre.classList.add(style.json);
2125

2226
const code = document.createElement("code");
27+
2328
code.textContent = `mime type: ${mime}\n\n${JSON.stringify(value, null, 2)}`;
29+
2430
pre.appendChild(code);
31+
2532
container.appendChild(pre);
2633
}
2734

0 commit comments

Comments
 (0)