NLdoc.Conversion.Writer.Html.SimpleForm (NLdoc.Conversion.Writer.Html v1.2.23)
View SourceModule for HTML (SimpleForm) operations
Summary
Functions
Append attributes to existing tag.
Append child to existing tag.
Append children to existing tag.
Append child to existing tag.
Append attributes to existing tag.
Put children inside existing tag.
Create a new node with tag_name, attributes and children
Functions
@spec append_attributes( node :: Floki.html_tag(), new_attributes :: [Floki.html_attribute()] ) :: Floki.html_tag()
Append attributes to existing tag.
Examples
iex> { "p", [{"class", "xyz"}], ["Some Text"]}
...> |> NLdoc.Conversion.Writer.Html.SimpleForm.append_children([{"span", [], ["Other text"]}])
{"p", [{"class", "xyz"}], ["Some Text", {"span", [], ["Other text"]}]}
@spec append_child(node :: Floki.html_tag(), new_child :: Floki.html_node()) :: Floki.html_tag()
Append child to existing tag.
Examples
iex> { "p", [{"class", "xyz"}], ["Some Text"]}
...> |> NLdoc.Conversion.Writer.Html.SimpleForm.append_child({"span", [], ["Other text"]})
{"p", [{"class", "xyz"}], ["Some Text", {"span", [], ["Other text"]}]}
@spec append_children(node :: Floki.html_tag(), new_children :: [Floki.html_node()]) :: Floki.html_tag()
Append children to existing tag.
Examples
iex> { "p", [{"class", "xyz"}], ["Some Text"]}
...> |> NLdoc.Conversion.Writer.Html.SimpleForm.append_children([{"span", [], ["Other text"]}])
{"p", [{"class", "xyz"}], ["Some Text", {"span", [], ["Other text"]}]}
@spec prepend_child(node :: Floki.html_tag(), new_child :: Floki.html_node()) :: Floki.html_tag()
Append child to existing tag.
Examples
iex> { "p", [{"class", "xyz"}], ["Some Text"]}
...> |> NLdoc.Conversion.Writer.Html.SimpleForm.append_child({"span", [], ["Other text"]})
{"p", [{"class", "xyz"}], ["Some Text", {"span", [], ["Other text"]}]}
@spec put_attributes(node :: Floki.html_tag(), attributes :: [Floki.html_attribute()]) :: Floki.html_tag()
Append attributes to existing tag.
Examples
iex> { "p", [{"class", "xyz"}], ["Some Text"]}
...> |> NLdoc.Conversion.Writer.Html.SimpleForm.append_children([{"span", [], ["Other text"]}])
{"p", [{"class", "xyz"}], ["Some Text", {"span", [], ["Other text"]}]}
@spec put_children(node :: Floki.html_tag(), children :: [Floki.html_node()]) :: Floki.html_tag()
Put children inside existing tag.
Examples
iex> { "p", [{"class", "xyz"}], ["Some Text"]}
...> |> NLdoc.Conversion.Writer.Html.SimpleForm.put_children([{"span", [], ["Other text"]}])
{"p", [{"class", "xyz"}], [{"span", [], ["Other text"]}]}
@spec reverse(Floki.html_tag()) :: Floki.html_tag()
@spec reverse(Floki.html_node()) :: Floki.html_node()
@spec reverse([Floki.html_node()]) :: Floki.html_node()
@spec tag(String.t(), [Floki.html_attribute()], [Floki.html_node()]) :: Floki.html_tag()
Create a new node with tag_name, attributes and children
Examples
iex> NLdoc.Conversion.Writer.Html.SimpleForm.tag("p", [{"class", "xyz"}], ["Some Text"])
{"p", [{"class", "xyz"}], ["Some Text"]}
iex> NLdoc.Conversion.Writer.Html.SimpleForm.tag("p", [{"class", "xyz"}])
{"p", [{"class", "xyz"}], []}
iex> NLdoc.Conversion.Writer.Html.SimpleForm.tag("p")
{"p", [], []}