From 847cf4639558cf0310c2350ca0c9e3ae59594699 Mon Sep 17 00:00:00 2001 From: mingrammer Date: Wed, 26 Feb 2020 00:26:27 +0900 Subject: [PATCH] docs: add guide for jupyter notebook --- docs/guides/diagram.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/guides/diagram.md b/docs/guides/diagram.md index 4d865713a..cc36490fd 100644 --- a/docs/guides/diagram.md +++ b/docs/guides/diagram.md @@ -27,6 +27,19 @@ $ python diagram.py It will generate an image file with single `EC2` node drawn as `simple_diagram.png` on your working directory, and open that created image file immediately. +## Jupyter Notebooks + +Diagrams can be also rendered directly inside the notebook as like this: + +```python +from diagrams import Diagram +from diagrams.aws.compute import EC2 + +with Diagram("Simple Diagram") as diag: + EC2("web") +diag +``` + ## Options You can specify the output file format with `outformat` parameter. Default is **png**.