// This file is auto-generated by alef — DO NOT EDIT. // alef:hash:4e15143f4af1ae8bafbdb1506ef057da924484c66a19483966333558ad437e75 // To regenerate: alef generate // To verify freshness: alef verify --exit-code // Issues & docs: https://github.com/kreuzberg-dev/alef package dev.kreuzberg; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; import org.jspecify.annotations.Nullable; /** * Comprehensive Djot document structure with semantic preservation. * * This type captures the full richness of Djot markup, including: * - Block-level structures (headings, lists, blockquotes, code blocks, etc.) * - Inline formatting (emphasis, strong, highlight, subscript, superscript, etc.) * - Attributes (classes, IDs, key-value pairs) * - Links, images, footnotes * - Math expressions (inline and display) * - Tables with full structure * * Available when the {@code djot} feature is enabled. */ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = DjotContent.Builder.class) public record DjotContent( /** * Plain text representation for backwards compatibility */ @JsonProperty("plain_text") String plainText, /** * Structured block-level content */ @JsonProperty("blocks") List blocks, /** * Metadata from YAML frontmatter */ @JsonProperty("metadata") Metadata metadata, /** * Extracted tables as structured data */ @JsonProperty("tables") List tables, /** * Extracted images with metadata */ @JsonProperty("images") List images, /** * Extracted links with URLs */ @JsonProperty("links") List links, /** * Footnote definitions */ @JsonProperty("footnotes") List footnotes, /** * Attributes mapped by element identifier (if present) */ @Nullable @JsonProperty("attributes") List attributes ) { public static Builder builder() { return new Builder(); } // CPD-OFF @JsonPOJOBuilder(withPrefix = "with", buildMethodName = "build") public static final class Builder { @JsonProperty("plain_text") private String plainText = ""; private List blocks = List.of(); private Metadata metadata = null; private List
tables = List.of(); private List images = List.of(); private List links = List.of(); private List footnotes = List.of(); private List attributes = null; /** Sets the plainText field. */ @JsonProperty("plain_text") public Builder withPlainText(final String value) { this.plainText = value; return this; } /** Sets the blocks field. */ @JsonProperty("blocks") public Builder withBlocks(final List value) { this.blocks = value; return this; } /** Sets the metadata field. */ @JsonProperty("metadata") public Builder withMetadata(final Metadata value) { this.metadata = value; return this; } /** Sets the tables field. */ @JsonProperty("tables") public Builder withTables(final List
value) { this.tables = value; return this; } /** Sets the images field. */ @JsonProperty("images") public Builder withImages(final List value) { this.images = value; return this; } /** Sets the links field. */ @JsonProperty("links") public Builder withLinks(final List value) { this.links = value; return this; } /** Sets the footnotes field. */ @JsonProperty("footnotes") public Builder withFootnotes(final List value) { this.footnotes = value; return this; } /** Sets the attributes field. */ @JsonProperty("attributes") public Builder withAttributes(final @Nullable List value) { this.attributes = value; return this; } /** Builds the DjotContent instance. */ public DjotContent build() { return new DjotContent( plainText, blocks, metadata, tables, images, links, footnotes, attributes ); } } // CPD-ON }