Hi Jon,
I would do the following.
Create some small request context element with interface:
public interface IRecipeContext
{
List<string> Steps {get; set;}
{
public class RecipeContext : IRecipeContext
{
List<string> Steps {get; set;}
public RecipeContext()
{
Steps = new List<string>();
}
}
Register it with your favourite IoC container with per-request lifetime:
builder.RegisterType<RecipeContext>()
.AsImplementedInterfaces()
.InstancePerRequest();
So that you can access this context from you widget via dependency injection and write something in this context (in your example it will be some step data).
Then, you can also inject this context into your template controller and pass into view. But make sure rendering of your structured data goes after editable area. Otherwise this context will be empty.