View Source Tamnoon.Compiler (Tamnoon v1.0.0-a.4)
This module provides functions for compiling (/parsing) Tamnoon HEEx components.
Summary
Functions
Compiles the 'root.ex' component into the final file that is sent to the client.
Escapes the content so it is not rendered as HTML. Available as <%= h.(content) %>
inside components.
Takes as an argument a string containing compiled heex for a component, and returns the component as plain HTML for it to be rendered on the DOM.
Returns the compiled HTML code of the component. Takes as arguments
Utility function passed to EEx blocks in components. Calls render_component/3
with the
elements in the list as the arguments. When passing it only the first argument, it can be
passed directly without putting it in a list.
See render_component/3
for more info.
Functions
Compiles the 'root.ex' component into the final file that is sent to the client.
Escapes the content so it is not rendered as HTML. Available as <%= h.(content) %>
inside components.
Takes as an argument a string containing compiled heex for a component, and returns the component as plain HTML for it to be rendered on the DOM.
render_component(component, assigns \\ %{}, parse_tmnn_heex \\ false)
View SourceReturns the compiled HTML code of the component. Takes as arguments:
- either a component module or a file name of a heex component file inside lib/components,
- the assigns for the EEx blocks in the component,
- and a boolean for whether to parse the Tamnoon heex.
When the function is used inside a component that gets built into the root in the
build_from_root/2
function, the last argument should befalse
to avoid invokingparse_tmnn_heex/1
multiple times. Inside EEx blocks in heex components, this function can be invoked as<%= r.([args..]) %>
. Seerender_component_dyn/1
.
Utility function passed to EEx blocks in components. Calls render_component/3
with the
elements in the list as the arguments. When passing it only the first argument, it can be
passed directly without putting it in a list.
See render_component/3
for more info.