Structure representing a URI extracted from a document.
Matches the Rust Uri struct.
Fields
:url- The URL string:label- Optional display label for the URI:page- Optional page number where the URI appears:kind- The kind of URI (e.g., "hyperlink", "image", "anchor")
Summary
Types
Functions
Creates a Uri struct from a map.
Examples
iex> Kreuzberg.Uri.from_map(%{
...> "url" => "https://example.com",
...> "label" => "Example",
...> "page" => 1,
...> "kind" => "hyperlink"
...> })
%Kreuzberg.Uri{
url: "https://example.com",
label: "Example",
page: 1,
kind: "hyperlink"
}
Converts a Uri struct to a map.
Examples
iex> uri = %Kreuzberg.Uri{url: "https://example.com", kind: "hyperlink"}
iex> Kreuzberg.Uri.to_map(uri)
%{
"url" => "https://example.com",
"label" => nil,
"page" => nil,
"kind" => "hyperlink"
}