MCPcopy Create free account
hub / github.com/datalayer/jupyter-ui / parseConfigFromScript

Function parseConfigFromScript

packages/embed/src/bootstrap.ts:88–103  ·  view source on GitHub ↗

* Parse configuration from script tag

()

Source from the content-addressed store, hash-verified

86 document.querySelector('script[data-jupyter-server]');
87
88 if (!script) return null;
89
90 return {
91 serverUrl: script.getAttribute('data-jupyter-server') || '',
92 token: script.getAttribute('data-jupyter-token') || '',
93 cdnBase:
94 script.getAttribute('data-cdn-base') || getCdnBaseFromScript(script),
95 autoStartKernel: script.getAttribute('data-auto-start-kernel') !== 'false',
96 defaultKernel: script.getAttribute('data-default-kernel') || 'python',
97 };
98}
99
100/**
101 * Get CDN base URL from script src
102 */
103function getCdnBaseFromScript(script: Element): string {
104 const src = script.getAttribute('src');
105 if (!src) return '';
106

Callers 1

initJupyterEmbedsFunction · 0.70

Calls 1

getCdnBaseFromScriptFunction · 0.85

Tested by

no test coverage detected