@@ -210,20 +210,6 @@ function readTemplateFile(template)
210
210
return content
211
211
end
212
212
213
- -- Obtain the initialization template file at pyodide-init.html
214
- function initializationTemplateFile ()
215
- return readTemplateFile (" pyodide-init.html" )
216
- end
217
-
218
-
219
- -- Obtain the editor template file at pyodide-context-interactive.html
220
- function interactiveTemplateFile ()
221
- return readTemplateFile (" pyodide-context-interactive.html" )
222
- end
223
-
224
- -- Cache a copy of each public-facing templates to avoid multiple read/writes.
225
- -- interactive_template = interactiveTemplateFile()
226
-
227
213
-- Define a function that escape control sequence
228
214
function escapeControlSequences (str )
229
215
-- Perform a global replacement on the control sequence character
@@ -243,16 +229,16 @@ function initializationPyodide()
243
229
[" BASEURL" ] = baseUrl ,
244
230
[" HOMEDIR" ] = homeDir ,
245
231
[" INSTALLPYTHONPACKAGESLIST" ] = installPythonPackagesList ,
232
+ [" QPYODIDECELLDETAILS" ] = quarto .json .encode (qPyodideCapturedCodeBlocks ),
246
233
}
247
234
248
235
-- Make sure we perform a copy
249
- -- local initializationTemplate = initializationTemplateFile( )
236
+ local initializationTemplate = readTemplateFile ( " qpyodide-document-settings.js " )
250
237
251
238
-- Make the necessary substitutions
252
- -- local initializedPyodideConfiguration = substitute_in_file(initializationTemplate, substitutions)
239
+ local initializedPyodideConfiguration = substitute_in_file (initializationTemplate , substitutions )
253
240
254
- -- return initializedPyodideConfiguration
255
- return " Placeholder"
241
+ return initializedPyodideConfiguration
256
242
end
257
243
258
244
-- Setup Pyodide's pre-requisites once per document.
@@ -275,10 +261,10 @@ function ensurePyodideSetup()
275
261
-- quarto.doc.include_file("in-header", "pyodide-styling.html")
276
262
277
263
-- Insert the Pyodide initialization routine
278
- -- quarto.doc.include_text("in-header", initializedConfigurationPyodide)
264
+ quarto .doc .include_text (" in-header" , initializedConfigurationPyodide )
279
265
280
266
-- Insert the Monaco Editor initialization
281
- -- quarto.doc.include_file("before-body", "monaco-editor-init.html")
267
+ quarto .doc .include_file (" before-body" , " monaco-editor-init.html" )
282
268
283
269
end
284
270
0 commit comments