Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Dash.NET.Interactive/Library.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
open Microsoft.DotNet.Interactive
open Microsoft.DotNet.Interactive.Formatting
open Dash.NET.Suave
open System
open System.Threading
open System.Net
open System.IO
Expand Down Expand Up @@ -38,13 +39,12 @@ module Util =
let html = new HtmlString(str) :> IHtmlContent
html.WriteTo(writer, HtmlEncoder.Default)


type DashInteractiveExtension () =

interface IKernelExtension with
member x.OnLoadAsync(kernel:Kernel) : Task =
Formatter.Register<DashApp>(Util.formatter, HtmlFormatter.MimeType)
member _.OnLoadAsync _ =

Formatter.Register<DashApp>(Action<_, _>(Util.formatter), "text/html")

let ctx = KernelInvocationContext.Current
if ctx <> null then
ctx.Display("Dash extension has been loaded. Enjoy!","text/html") |> ignore;
Task.CompletedTask
Task.CompletedTask