PhoenixKitWeb.Live.Modules.Blogging.PageBuilder (phoenix_kit v1.6.16)

View Source

Rendering pipeline for .phk (PhoenixKit) page files.

Processes component-based page definitions through:

  1. Read .phk file
  2. Parse XML to AST
  3. Inject dynamic data ({{variable}} placeholders)
  4. Resolve components (map to actual component modules)
  5. Apply theme/variants
  6. Render to HTML

Summary

Functions

Renders .phk content directly (without file path).

Renders a .phk page file to HTML.

Types

assigns()

@type assigns() :: map()

ast()

@type ast() :: map()

render_result()

@type render_result() :: {:ok, Phoenix.LiveView.Rendered.t()} | {:error, term()}

Functions

render_content(content, assigns \\ %{})

@spec render_content(String.t(), assigns()) :: render_result()

Renders .phk content directly (without file path).

render_page(page_path, assigns \\ %{})

@spec render_page(String.t(), assigns()) :: render_result()

Renders a .phk page file to HTML.

Examples

iex> PageBuilder.render_page("/path/to/page.phk", %{user: %{name: "Alice"}})
{:ok, rendered_html}