-
Notifications
You must be signed in to change notification settings - Fork 10
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
Integration into Jupyter notebook #2
Comments
Using napkin in notebook will be great especially if there is already some supports for PlantUML. Actually, I am not using notebook after I tried that quite long time ago. I might try notebook again soon. |
@pinetr2e This might help to get you going in case you're using Debian platforms: Or try it in a Docker container… |
Related to this issue, for the Emacs users, Org babel integration is now supported. |
I have Not much joy. It would be great to get a sample working on Colab! |
You can do it like this: import napkin
from IPython.display import Image
@napkin.seq_diagram()
def distributed_control(c):
user = c.object("User")
order = c.object("Order")
orderLine = c.object("OrderLine")
product = c.object("Product")
customer = c.object("Customer")
with user:
with order.calculatePrice():
with orderLine.calculatePrice():
product.getPrice("quantity:number")
with customer.getDiscountedValue(order):
order.getBaseValue().ret("value")
c.ret("discountedValue")
napkin.generate(output_format="plantuml_png", output_dir="/tmp")
Image(filename="/tmp/distributed_control.png") It would definitely be nicer if |
Has anyone tried napkin in a notebook?
Not sure if it needs special integration code, or maybe some convenience additions…
The text was updated successfully, but these errors were encountered: