diff --git a/livebook/ex_plain_playbook.livemd b/livebook/ex_plain_playbook.livemd index 6503cc9..6de4f31 100644 --- a/livebook/ex_plain_playbook.livemd +++ b/livebook/ex_plain_playbook.livemd @@ -2,45 +2,21 @@ ```elixir Mix.install([ - {:kino, "~> 0.12.0"} + {:kino, "~> 0.12.0"}, + {:ex_plain, path: "/Users/carlogilmar/Code/GitHub/ex_plain"} ]) ``` ## Execute code from other Node -### Instructions - -1. Open a Node session in your application `iex --sname ex_plain --cookie secret -S mix` -2. Open a new Notebook -3. Add a `Remote execution` smart cell. -4. Add the node and the cookie choosen, in this cell you can execute your code. -5. You can assign the data in the `assign to` input. So in this way you can work with that data. -6. You can continue using the livebook implementations with your data. - - - ```elixir -require Kino.RPC -node = :"ex_plain@MacBook-Pro-de-Carlo-Gilmar" -Node.set_cookie(node, String.to_atom(System.fetch_env!("LB_COOKIE"))) +module = %ExPlain.Reader.ModuleUnit{ + name: "UsersContext", + public_functions: ["create_user/1"], + private_functions: ["validate_changeset/2"] +} -d2_diagram = - Kino.RPC.eval_string( - node, - ~S""" - module = - %ExPlain.Reader.ModuleUnit{ - name: "UsersContext", - public_functions: ["create_user/1"], - private_functions: ["validate_changeset/2"] - } +d2_diagram = ExPlain.D2.Backbone.create_diagram(module) - d2_diagram = ExPlain.D2.Backbone.create_diagram(module) - """, - file: __ENV__.file - ) -``` - -```elixir IO.write(d2_diagram) ```