[Extension] Create a default cell with some code when a new notebook is created


Currently, I am trying to create a new extension for my workplace. In this extension, the user will need to select some settings and then, when they press a button, the extension should create a new cell of code with some JSON.

However, I am currently struggling with the part where I need to create the cell with my JSON. I am unsure of how to proceed. Do you have any ideas or suggestions? I have come across NotebookActions, which can be used to create a cell, but I have not idea on how to modify this new cell with my JSON.

Thank you.

Have you seen ipylab?

Didn’t know about this, thanks a lot!