html_dsl/types/attribute

Types

Similar to a pair, but uniquely named

pub opaque type Attribute

Functions

pub fn add(
  root: Option(Attribute),
  key: String,
  value: String,
) -> Option(Attribute)

Adds an attribute to an attribute

  • @param root: The root attribute
  • @param key: The key of the attribute
  • @param value: The value of the attribute
  • @returns: An Attribute
pub fn attribute_to_string(
  attribute: Option(Attribute),
) -> String

This function is used to convert an attribute to a string

  • @param attribute: The attribute to convert
  • @returns: String
pub fn class(
  root: Option(Attribute),
  classes: String,
) -> Option(Attribute)

Shortcut for creating a class attribute

  • @param root: The root attribute
  • @param classes: The classes to add
  • @returns: An Attribute
pub fn id(
  root: Option(Attribute),
  id: String,
) -> Option(Attribute)

Shortcut for creating a id attribute

  • @param root: The root attribute
  • @param id: The id to add
  • @returns: An Attribute
pub fn new() -> Option(Attribute)

This function is used to create an attribute

  • @returns: An Attribute
Search Document