How do you add a cell programatically in a Polyglot notebook? (add cell immediately below, not at the end)

62 Views Asked by At

I know the way to run a cell that would add another cell to the notebook programatically (but it does so at the end).

using Microsoft.DotNet.Interactive;
using Microsoft.DotNet.Interactive.Commands;

var command = new SendEditableCode(
    "csharp", 
    "Console.WriteLine(\"Hello!\");");

var input = await Kernel.Root.SendAsync(command);

But is there a way to get the cell added immediately below?

0

There are 0 best solutions below