Current section

Files

Jump to
html_to_markdown lib html_to_markdown image_metadata.ex
Raw

lib/html_to_markdown/image_metadata.ex

# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:9b6ec77d3974e7dfab61375328b55d26467e73fa760afe28c993820cf5d34eec
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
defmodule HtmlToMarkdown.ImageMetadata do
@moduledoc """
Image metadata with source and dimensions.
Captures `<img>` elements and inline `<svg>` elements with metadata
for image analysis and optimization.
# Examples
```
let img = ImageMetadata {
src: "https://example.com/image.jpg".to_string(),
alt: Some("An example image".to_string()),
title: Some("Example".to_string()),
dimensions: Some(ImageDimensions { width: 800, height: 600 }),
image_type: ImageType::External,
attributes: Default::default(),
};
assert_eq!(img.image_type, ImageType::External);
```
"""
@typedoc "Image metadata with source and dimensions."
@type t :: %__MODULE__{
src: String.t() | nil,
alt: String.t() | nil,
title: String.t() | nil,
dimensions: map() | nil,
image_type: String.t() | nil,
attributes: map()
}
defstruct src: nil,
alt: nil,
title: nil,
dimensions: nil,
image_type: :data_uri,
attributes: %{}
end