-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
serving outside of jupyter/nteract #96
Comments
@Casyfill I wrote https://github.com/rmorshea/idom to do just this - let me know what you think. note: there are some slight differences in the event spec that I hope to get merged here soon. |
Thanks! It looks pretty cool (btw the mybynder example does not work ,raising
on any interactive execution. But I was looking for the exact use of vdom package - is it possible? |
@Casyfill That error is curious, I don’t seem to see that when I run it. Maybe a concurrency problem? Can you post an issue with the stack trace? And unfortunately vdom is pretty basic and relies on the notebook for rendering. However I wrote idom in such a way that it would be compatible with vdom’s model specification (with the exception of event handlers, for now). As a result, you should be able to use vdom with idom, so long as you dont use event handlers from the vdom package (though I haven’t tested this recently). EDIT: You are able to turn VDOM objects into static HTML via |
You can serialize vdom to html using In [1]: from vdom import div, h1, p, a
In [2]: layout = div(
...: h1("Example"),
...: p("Hello ", a("world", href="http://example.com"), "!")
...: )
In [4]: layout.to_html()
Out[4]: '<div><h1>Example</h1><p>Hello <a href="http://example.com">world</a>!</p></div>' I can't recall if that's only on master or if we've shipped with that. |
@rgbkrk it's in the latest release. @Casyfill it probably goes without saying, but If you do want event handlers you should be able to use @idom.element
async def MyComponent(self):
return vdom.p("hello world") |
is there any way right now to serve the vdom outside of the notebook? Can't find that in the docs
The text was updated successfully, but these errors were encountered: