Inspect.Algebra.nest
You're seeing just the function
nest
, go back to Inspect.Algebra module for more information.
Specs
nest(t(), non_neg_integer() | :cursor | :reset, :always | :break) :: doc_nest()
Nests the given document at the given level
.
If level
is an integer, that's the indentation appended
to line breaks whenever they occur. If the level is :cursor
,
the current position of the "cursor" in the document becomes
the nesting. If the level is :reset
, it is set back to 0.
mode
can be :always
, which means nesting always happen,
or :break
, which means nesting only happens inside a group
that has been broken.
Examples
iex> doc = Inspect.Algebra.nest(Inspect.Algebra.glue("hello", "world"), 5)
iex> doc = Inspect.Algebra.group(doc)
iex> Inspect.Algebra.format(doc, 5)
["hello", "\n ", "world"]