diff --git a/lib/livebook/notebook/explore/elixir_and_livebook.livemd b/lib/livebook/notebook/explore/elixir_and_livebook.livemd index 98759d804..a8a7a3cc1 100644 --- a/lib/livebook/notebook/explore/elixir_and_livebook.livemd +++ b/lib/livebook/notebook/explore/elixir_and_livebook.livemd @@ -41,6 +41,16 @@ return the Elixir version. Note you can also press tab to cycle across the completion alternatives. +## Getting the current directory + +You can access the location of the current `.livemd` file and +its current directory using `__ENV__` and `__DIR__` variables: + +```elixir +IO.puts(__ENV__.file) +IO.puts(__DIR__) +``` + ## Runtimes Livebook has a concept of **runtime**, which in practice is an Elixir node responsible