I provide structured access to Elixir module and function documentation.
I extract docs via Code.fetch_docs/1 and format them for rendering
in GT's inspector — either as Phlow views (proxy inspection) or as a
section-delimited string that GT splits into a LePage.
Public API
for_module/1— documentation struct for a modulefor_function/2— documentation for all arities of a functionfor_function/3— documentation for a specific arityfor_type/3— documentation for a specific typeto_sections/1— section-delimited string for GT LePage rendering
Summary
Functions
I return a single string with __SECTION__ delimiters between snippets.
Types
@type function_arity_query() :: {:function, module(), atom(), non_neg_integer()}
@type module_query() :: {:module, module()}
@type query() :: module_query() | function_query() | function_arity_query() | type_query()
@type t() :: %GtBridge.Documentation{query: query() | nil}
@type type_query() :: {:type, module(), atom(), non_neg_integer()}
Functions
@spec doc_view(t(), GtBridge.Phlow.Builder) :: GtBridge.Phlow.Text.t()
@spec for_function(module(), atom(), non_neg_integer()) :: t()
@spec for_type(module(), atom(), non_neg_integer()) :: t()
@spec functions_view(t(), GtBridge.Phlow.Builder) :: GtBridge.Phlow.ColumnedList.t() | GtBridge.Phlow.Empty.t()
@spec functions_view(t(), GtBridge.Phlow.Builder) :: GtBridge.Phlow.Empty.t()
I return a single string with __SECTION__ delimiters between snippets.
GT splits on this delimiter and builds a LePage with one
LeTextSnippet per section.
@spec types_view(t(), GtBridge.Phlow.Builder) :: GtBridge.Phlow.ColumnedList.t() | GtBridge.Phlow.Empty.t()
@spec types_view(t(), GtBridge.Phlow.Builder) :: GtBridge.Phlow.Empty.t()