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:2c49ac946ea672c41dde9e798b56a448c135dec7ce5e86b0112d3a0bbf9f32b9
# 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