@@ -191,15 +191,26 @@ can be used in the following way to create a generic display method for webio:
191191 ```
192192The above example enables display code & webio code that doesn't rely on any
193193provider dependencies.
194+ If you want to host the bundle + websocket script somewhere else, you can also call:
195+ ```example
196+ function Base.display(d::MyWebDisplay, m::MIME"application/webio", app)
197+ println(d.io, "outer html")
198+ show(io, m, app, bundle_url, websocket_url)
199+ println(d.io, "close outer html")
200+ end
201+ ```
194202"""
195- function Base. show (io:: IO , :: MIME"application/webio" , app:: Union{Scope, Node} )
196- # Make sure we run a server
197- c = global_server_config ()
198- WebIOServer (routing_callback[], baseurl = c. url, http_port = c. http_port)
199-
203+ function Base. show (io:: IO , m:: MIME"application/webio" , app:: Union{Scope, Node} )
200204 webio_script = wio_asseturl (" /webio/dist/bundle.js" )
201205 ws_script = wio_asseturl (" /providers/websocket_connection.js" )
206+ show (io, m, app, webio_script, ws_script)
207+ return
208+ end
202209
210+ function Base. show (io:: IO , :: MIME"application/webio" , app:: Union{Scope, Node} , webio_script, ws_script)
211+ # Make sure we run a server
212+ c = global_server_config ()
213+ WebIOServer (routing_callback[], baseurl = c. url, http_port = c. http_port)
203214 println (io, " <script> var websocket_url = $(repr (c. ws_url)) </script>" )
204215 println (io, " <script src=$(repr (webio_script)) ></script>" )
205216 println (io, " <script src=$(repr (ws_script)) ></script>" )
0 commit comments