LineaUI.Docs (linea_ui v0.1.1)

Copy Markdown View Source

The installed components as data: their modules, docs, attrs and slots.

It reads what the compiler recorded (__components__/0 and the docs chunk), so it always describes the code that is running. LineaUI.Skill and documentation sites build on it.

LineaUI.Docs.components()
#=> [%{key: :accordion, module: LineaUI.Components.Accordion, summary: "...",
#      moduledoc: "...", functions: [%{name: :accordion, doc: "...", attrs: [...],
#      global: %{...}, slots: [...]}, ...]}, ...]

Summary

Functions

One component by key, or nil.

Every component with at least one public function, sorted by key.

Types

component()

@type component() :: %{
  key: atom(),
  module: module(),
  summary: String.t(),
  moduledoc: String.t(),
  functions: [function_doc()]
}

function_doc()

@type function_doc() :: %{
  name: atom(),
  doc: String.t(),
  attrs: [map()],
  global: map() | nil,
  slots: [map()]
}

Functions

component(key)

@spec component(atom()) :: component() | nil

One component by key, or nil.

components()

@spec components() :: [component()]

Every component with at least one public function, sorted by key.