GtBridge.Documentation (gt_bridge v0.17.2)

Copy Markdown View Source

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

Summary

Types

function_arity_query()

@type function_arity_query() :: {:function, module(), atom(), non_neg_integer()}

function_query()

@type function_query() :: {:function, module(), atom()}

module_query()

@type module_query() :: {:module, module()}

query()

t()

@type t() :: %GtBridge.Documentation{query: query() | nil}

type_query()

@type type_query() :: {:type, module(), atom(), non_neg_integer()}

Functions

doc_view(documentation, builder)

@spec doc_view(t(), GtBridge.Phlow.Builder) :: GtBridge.Phlow.Text.t()

for_function(module, function)

@spec for_function(module(), atom()) :: t()

for_function(module, function, arity)

@spec for_function(module(), atom(), non_neg_integer()) :: t()

for_module(module)

@spec for_module(module()) :: t()

for_type(module, name, arity)

@spec for_type(module(), atom(), non_neg_integer()) :: t()

functions_view(arg1, builder)

@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()

to_sections(documentation)

@spec to_sections(t()) :: String.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.

types_view(arg1, builder)

@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()