CodeStory.Formatter (CodeStory v0.2.0)

Copy Markdown View Source

Renders the call tree as a human-readable, color-coded string.

Each call renders as a compact inline signature — Mod.fun(name: value, …) => return — when the assembled line fits the :width budget (default 100), falling back to a stacked layout (name / one arg per line / return) when it does not. The decision is per-call, so a tree freely mixes inline and stacked nodes; deeper nesting has more indentation and stacks sooner. :novel's fully-expanded structs almost always exceed the budget and stack.

Summary

Functions

Formats the call tree with ANSI colors.

Formats the call tree without ANSI colors (for file output).

Types

ropts()

@type ropts() :: %{
  show_args: boolean(),
  detail: atom(),
  inspect_opts: keyword(),
  max_depth: pos_integer() | :infinity,
  width: pos_integer() | :infinity
}

Functions

format(tree, opts)

Formats the call tree with ANSI colors.

format_plain(tree, opts)

Formats the call tree without ANSI colors (for file output).