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:22a216bb5460cecba0c02917fbef30850c98f53205899c9311ba0473bc817ff7
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
# Issues & docs: https://github.com/kreuzberg-dev/alef
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((800, 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: [non_neg_integer()] | nil,
image_type: String.t() | nil,
attributes: map()
}
defstruct src: nil,
alt: nil,
title: nil,
dimensions: nil,
image_type: :data_uri,
attributes: %{}
end