protected override async Task HandleSubmitCode( SubmitCode command, KernelInvocationContext context) { var scriptContent = new ScriptContent(command.Code); await context.DisplayAsync(scriptContent); }
public async Task HandleAsync( SubmitCode command, KernelInvocationContext context) { var scriptContent = new ScriptContent(command.Code); await context.DisplayAsync(scriptContent); }
protected override async Task HandleSubmitCode( SubmitCode command, KernelInvocationContext context) { var scriptContent = command.Code; string value = PocketViewTags.script[type : "text/javascript"](Kernel.HTML( scriptContent)) .ToString(); await context.DisplayAsync(value, "text/html"); }
public async Task HandleAsync(SubmitCode command, KernelInvocationContext context) { if (command.KernelNameDirectiveNode is null) { context.Fail(message: $"Missing required #!{Name} details."); return; } var parseResult = command.KernelNameDirectiveNode.GetDirectiveParseResult(); var name = parseResult.ValueForOption <string>("--name"); var value = command.LanguageNode.Text.Trim(); await SetVariableAsync(name, value); if (parseResult.ValueForOption("--mime-type") is string mimeType) { await context.DisplayAsync(value, mimeType); } }
public async Task HandleAsync(SubmitCode command, KernelInvocationContext context) { await context.DisplayAsync( new HtmlString(command.Code), HtmlFormatter.MimeType); }
protected override async Task HandleSubmitCode(SubmitCode command, KernelInvocationContext context) { await context.DisplayAsync( command.Code, HtmlFormatter.MimeType); }
internal static Task DisplayAnsi(KernelInvocationContext context, TextSpan span) => context.DisplayAsync(span, PlainTextFormatter.MimeType);