og_image/transform

Types

Takumi node type classification

pub type NodeType {
  Container
  Text
  Image
  Unsupported(tag: String)
}

Constructors

  • Container
  • Text
  • Image
  • Unsupported(tag: String)

Values

pub fn collect_image_urls(
  el: element.Element(msg),
) -> List(String)

Collect all image URLs from a Lustre element tree Returns URLs that start with http:// or https://

pub fn extract_styles(
  attrs: List(attribute.Attribute(msg)),
) -> List(#(String, String))

Extract style tuples from a list of attributes

pub fn node_type(tag: String) -> NodeType

Map HTML tag to Takumi node type

pub fn to_takumi_json(el: element.Element(msg)) -> json.Json

Transform a Lustre element to Takumi JSON format

pub fn to_takumi_json_with_root(
  el: element.Element(msg),
) -> json.Json

Transform a Lustre element to Takumi JSON format, wrapped in a root container that fills the viewport (width: 100%, height: 100%)

Search Document