Module: Magik::Render

Defined in:
lib/magik/render.rb

Overview

The UI DSL. Compiles components and screens to server-rendered HTML plus htmx attributes. There is no SPA framework and there never will be.

Implements: Phase 2 — Rendering & Actions of docs/idea/00-build-spec.md.

Planned DSL surface, copied from the spec:

  • component :Name do prop; body do ... end end
  • screen :Name do state/body end
  • layout :Name do sidebar / topbar / content / responsive end — the shell
  • kit: button, form, field, data_table, modal, toast, card, list, grid, tabs, stat, chart, sidebar, topbar, nav_item, breadcrumbs, account_menu, dashboard_grid
  • theme system: design tokens, light/dark mode via CSS vars

Every kit component is responsive by construction; data_table on a narrow screen becomes a card list, never a horizontal scroll.

Status: Not implemented — spec only. Every entry point below raises NotImplementedError. Nothing here reads config, touches a database or emits a byte of HTML.

See Also:

Constant Summary collapse

SPEC_PHASE =

The build-spec phase this subsystem implements.

Returns:

  • (String)
"Phase 2 — Rendering & Actions"
DSL_SURFACE =

The DSL this subsystem will expose, verbatim from the spec.

Returns:

  • (Array<String>)
[
  "component :Name do prop; body do ... end end",
  "screen :Name do state/body end",
  "layout :Name do sidebar / topbar / content / responsive end",
  "kit: button, form, field, data_table, modal, toast, card, list, grid, tabs, stat, chart, " \
  "sidebar, topbar, nav_item, breadcrumbs, account_menu, dashboard_grid",
  "theme system: design tokens, light/dark mode via CSS vars"
].freeze
STATUS =

Implementation status of this subsystem.

Returns:

  • (String)
"Not implemented — spec only"

Class Method Summary collapse

Class Method Details

.define(*_args, **_options) ⇒ void

This method returns an undefined value.

Entry point for the Render DSL.

Parameters:

  • _args (Array) —

    ignored

  • _options (Hash) —

    ignored

Raises:

  • (NotImplementedError) —

    always, until Phase 2 lands



53
54
55
# File 'lib/magik/render.rb', line 53

def self.define(*_args, **_options)
  raise NotImplementedError, "Magik::Render is spec-only; see docs/idea/00-build-spec.md"
end