(app: MarimoApp, options?: ConvertMarimoAppOptions)
| 345 | * @returns Array of DeepnoteBlock objects |
| 346 | */ |
| 347 | export function convertMarimoAppToBlocks(app: MarimoApp, options?: ConvertMarimoAppOptions): DeepnoteBlock[] { |
| 348 | const idGenerator = options?.idGenerator ?? randomUUID |
| 349 | const outputs = options?.outputs |
| 350 | return app.cells.map((cell, index) => { |
| 351 | // Compute code hash of cell content to match against session cache |
| 352 | const codeHash = computeCodeHash(cell.content) |
| 353 | const cellOutputs = outputs?.get(codeHash) |
| 354 | return convertCellToBlock(cell, index, idGenerator, cellOutputs) |
| 355 | }) |
| 356 | } |
| 357 | |
| 358 | export interface ConvertMarimoAppToDeepnoteOptions { |
| 359 | /** Project name for the Deepnote file */ |
no test coverage detected