PhoenixKitWeb.Live.Modules.Blogging.PageBuilder (phoenix_kit v1.6.16)
View SourceRendering pipeline for .phk (PhoenixKit) page files.
Processes component-based page definitions through:
- Read .phk file
- Parse XML to AST
- Inject dynamic data ({{variable}} placeholders)
- Resolve components (map to actual component modules)
- Apply theme/variants
- Render to HTML
Summary
Types
@type assigns() :: map()
@type ast() :: map()
@type render_result() :: {:ok, Phoenix.LiveView.Rendered.t()} | {:error, term()}
Functions
@spec render_content(String.t(), assigns()) :: render_result()
Renders .phk content directly (without file path).
@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}