// 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 kreuzberg provides Go bindings for the kreuzberg library. package kreuzberg /* #cgo CFLAGS: -I${SRCDIR}/include #cgo darwin,arm64 LDFLAGS: -L${SRCDIR}/.lib/macos-arm64 -Wl,-rpath,${SRCDIR}/.lib/macos-arm64 -lkreuzberg_ffi #cgo darwin,amd64 LDFLAGS: -L${SRCDIR}/.lib/macos-amd64 -Wl,-rpath,${SRCDIR}/.lib/macos-amd64 -lkreuzberg_ffi #cgo linux,amd64 LDFLAGS: -L${SRCDIR}/.lib/linux-amd64 -Wl,-rpath,${SRCDIR}/.lib/linux-amd64 -lkreuzberg_ffi #cgo linux,arm64 LDFLAGS: -L${SRCDIR}/.lib/linux-arm64 -Wl,-rpath,${SRCDIR}/.lib/linux-arm64 -lkreuzberg_ffi #cgo windows,amd64 LDFLAGS: -L${SRCDIR}/.lib/windows-amd64 -lkreuzberg_ffi #include "kreuzberg.h" */ import "C" import ( "encoding/json" "errors" "fmt" "runtime" "unsafe" ) // lastError retrieves the last error from the FFI layer. func lastError() error { code := int32(C.kreuzberg_last_error_code()) if code == 0 { return nil } ctx := C.kreuzberg_last_error_context() if ctx == nil { return fmt.Errorf("[%d] native error", code) } message := C.GoString(ctx) return fmt.Errorf("[%d] %s", code, message) } // unmarshalBytes copies a C byte buffer into a Go []byte. // // The pointer is treated as a NUL-terminated C string; binary payloads // that may contain interior NULs should be exposed by the FFI with an // explicit length out-parameter instead. func unmarshalBytes(ptr *C.uint8_t) []byte { if ptr == nil { return nil } return []byte(C.GoString((*C.char)(unsafe.Pointer(ptr)))) } // Ptr returns a pointer to the given value. // // Used by data DTOs to construct pointers for optional fields without the // functional-options pattern boilerplate. For example: // // &MyStruct{Field: Ptr("value"), OtherField: Ptr(42)} func Ptr[T any](v T) *T { return &v } var ( // ErrIo is returned when IO error. ErrIo = errors.New("IO error") // ErrParsing is returned when parsing error. ErrParsing = errors.New("parsing error") // ErrOcr is returned when OCR error. ErrOcr = errors.New("OCR error") // ErrValidation is returned when validation error. ErrValidation = errors.New("validation error") // ErrCache is returned when cache error. ErrCache = errors.New("cache error") // ErrImageProcessing is returned when image processing error. ErrImageProcessing = errors.New("image processing error") // ErrSerialization is returned when serialization error. ErrSerialization = errors.New("serialization error") // ErrMissingDependency is returned when missing dependency. ErrMissingDependency = errors.New("missing dependency") // ErrPlugin is returned when plugin error in. ErrPlugin = errors.New("plugin error in") // ErrLockPoisoned is returned when lock poisoned. ErrLockPoisoned = errors.New("lock poisoned") // ErrUnsupportedFormat is returned when unsupported format. ErrUnsupportedFormat = errors.New("unsupported format") // ErrEmbedding is returned when embedding error. ErrEmbedding = errors.New("embedding error") // ErrTimeout is returned when extraction timed out after ms (limit: ms). ErrTimeout = errors.New("extraction timed out after ms (limit: ms)") // ErrCancelled is returned when extraction cancelled. ErrCancelled = errors.New("extraction cancelled") // ErrSecurity is returned when security violation. ErrSecurity = errors.New("security violation") // ErrOther is returned when other. ErrOther = errors.New("other") ) // Error is a structured error type. type Error struct { Code string Message string } func (e Error) Error() string { return e.Message } // ExecutionProviderType is an enumeration type. type ExecutionProviderType string const ( // ExecutionProviderTypeAuto ExecutionProviderTypeAuto auto-select: CoreML on macOS, CUDA on Linux, CPU elsewhere. ExecutionProviderTypeAuto ExecutionProviderType = "auto" // ExecutionProviderTypeCPU ExecutionProviderTypeCPU cPU execution provider (always available). ExecutionProviderTypeCPU ExecutionProviderType = "cpu" // ExecutionProviderTypeCoreMl ExecutionProviderTypeCoreMl apple CoreML (macOS/iOS Neural Engine + GPU). ExecutionProviderTypeCoreMl ExecutionProviderType = "core_ml" // ExecutionProviderTypeCuda ExecutionProviderTypeCuda nVIDIA CUDA GPU acceleration. ExecutionProviderTypeCuda ExecutionProviderType = "cuda" // ExecutionProviderTypeTensorRt ExecutionProviderTypeTensorRt nVIDIA TensorRT (optimized CUDA inference). ExecutionProviderTypeTensorRt ExecutionProviderType = "tensor_rt" ) // OutputFormat output format for extraction results. // // Controls the format of the `content` field in `ExtractionResult`. // When set to `Markdown`, `Djot`, or `Html`, the output uses that format. // `Plain` returns the raw extracted text. // `Structured` returns JSON with full OCR element data including bounding // boxes and confidence scores. type OutputFormat string const ( // OutputFormatPlain plain text content only (default) OutputFormatPlain OutputFormat = "plain" // OutputFormatMarkdown markdown format OutputFormatMarkdown OutputFormat = "markdown" // OutputFormatDjot djot markup format OutputFormatDjot OutputFormat = "djot" // OutputFormatHTML hTML format OutputFormatHTML OutputFormat = "html" // OutputFormatJSON jSON tree format with heading-driven sections. OutputFormatJSON OutputFormat = "json" // OutputFormatStructured structured JSON format with full OCR element metadata. OutputFormatStructured OutputFormat = "structured" ) // HTMLTheme is an enumeration type. type HTMLTheme string const ( // HTMLThemeDefault HTMLThemeDefault sensible defaults: system font stack, neutral colours, readable line // measure. CSS custom properties (`--kb-*`) are all defined so user CSS // can override individual values. HTMLThemeDefault HTMLTheme = "default" // HTMLThemeGitHub HTMLThemeGitHub gitHub Markdown-inspired palette and spacing. HTMLThemeGitHub HTMLTheme = "git_hub" // HTMLThemeDark HTMLThemeDark dark background, light text. HTMLThemeDark HTMLTheme = "dark" // HTMLThemeLight HTMLThemeLight minimal light theme with generous whitespace. HTMLThemeLight HTMLTheme = "light" // HTMLThemeUnstyled HTMLThemeUnstyled no built-in stylesheet emitted. CSS custom properties are still defined // on `:root` so user stylesheets can reference `var(--kb-*)` tokens. HTMLThemeUnstyled HTMLTheme = "unstyled" ) // TableModel is an enumeration type. type TableModel string const ( // TableModelTatr TableModelTatr tATR (Table Transformer) -- default, 30MB, DETR-based row/column detection. TableModelTatr TableModel = "tatr" // TableModelSlanetWired TableModelSlanetWired sLANeXT wired variant -- 365MB, optimized for bordered tables. TableModelSlanetWired TableModel = "slanet_wired" // TableModelSlanetWireless TableModelSlanetWireless sLANeXT wireless variant -- 365MB, optimized for borderless tables. TableModelSlanetWireless TableModel = "slanet_wireless" // TableModelSlanetPlus TableModelSlanetPlus sLANet-plus -- 7.78MB, lightweight general-purpose. TableModelSlanetPlus TableModel = "slanet_plus" // TableModelSlanetAuto TableModelSlanetAuto classifier-routed SLANeXT: auto-select wired/wireless per table. // Uses PP-LCNet classifier (6.78MB) + both SLANeXT variants (730MB total). TableModelSlanetAuto TableModel = "slanet_auto" // TableModelDisabled TableModelDisabled disable table structure model inference entirely; use heuristic path only. TableModelDisabled TableModel = "disabled" ) // ChunkerType is an enumeration type. type ChunkerType string const ( // ChunkerTypeText ChunkerTypeText is the Text variant of ChunkerType. ChunkerTypeText ChunkerType = "text" // ChunkerTypeMarkdown ChunkerTypeMarkdown is the Markdown variant of ChunkerType. ChunkerTypeMarkdown ChunkerType = "markdown" // ChunkerTypeYaml ChunkerTypeYaml is the Yaml variant of ChunkerType. ChunkerTypeYaml ChunkerType = "yaml" // ChunkerTypeSemantic ChunkerTypeSemantic is the Semantic variant of ChunkerType. ChunkerTypeSemantic ChunkerType = "semantic" ) // ChunkSizing how chunk size is measured. // // Defaults to `Characters` (Unicode character count). When using token-based sizing, // chunks are sized by token count according to the specified tokenizer. // // Token-based sizing uses HuggingFace tokenizers loaded at runtime. Any tokenizer // available on HuggingFace Hub can be used, including OpenAI-compatible tokenizers // (e.g., `Xenova/gpt-4o`, `Xenova/cl100k_base`). // Variants: Characters, Tokenizer // Sealed interface — use one of ChunkSizingCharacters, ChunkSizingTokenizer. type ChunkSizing interface { isChunkSizing() Type() string } // ChunkSizingCharacters size measured in Unicode characters (default). type ChunkSizingCharacters struct { } func (ChunkSizingCharacters) isChunkSizing() {} func (ChunkSizingCharacters) Type() string { return "characters" } func (v ChunkSizingCharacters) MarshalJSON() ([]byte, error) { type aux struct { Type string `json:"type"` } return json.Marshal(aux{ Type: v.Type(), }) } // ChunkSizingTokenizer size measured in tokens from a HuggingFace tokenizer. type ChunkSizingTokenizer struct { // HuggingFace model ID or path, e.g. "Xenova/gpt-4o", "bert-base-uncased". Model string `json:"model"` // Optional cache directory override for tokenizer files. // Defaults to hf-hub's standard cache (`~/.cache/huggingface/`). // Can also be set via `KREUZBERG_TOKENIZER_CACHE_DIR` environment variable. CacheDir *string `json:"cache_dir,omitempty"` } func (ChunkSizingTokenizer) isChunkSizing() {} func (ChunkSizingTokenizer) Type() string { return "tokenizer" } func (v ChunkSizingTokenizer) MarshalJSON() ([]byte, error) { type aux struct { Type string `json:"type"` Model string `json:"model"` CacheDir *string `json:"cache_dir,omitempty"` } return json.Marshal(aux{ Type: v.Type(), Model: v.Model, CacheDir: v.CacheDir, }) } // UnmarshalChunkSizing decodes JSON data into the appropriate concrete ChunkSizing variant. func UnmarshalChunkSizing(data []byte) (ChunkSizing, error) { var wire struct { Type string `json:"type"` } if err := json.Unmarshal(data, &wire); err != nil { return nil, err } switch wire.Type { case "characters": var v ChunkSizingCharacters if err := json.Unmarshal(data, &v); err != nil { return nil, err } return v, nil case "tokenizer": var v ChunkSizingTokenizer if err := json.Unmarshal(data, &v); err != nil { return nil, err } return v, nil } return nil, fmt.Errorf("unknown ChunkSizing type: %q", wire.Type) } // EmbeddingModelType embedding model types supported by Kreuzberg. // Variants: Preset, Custom, Llm, Plugin // Sealed interface — use one of EmbeddingModelTypePreset, EmbeddingModelTypeCustom. type EmbeddingModelType interface { isEmbeddingModelType() Type() string } // EmbeddingModelTypePreset use a preset model configuration (recommended) type EmbeddingModelTypePreset struct { Name string `json:"name"` } func (EmbeddingModelTypePreset) isEmbeddingModelType() {} func (EmbeddingModelTypePreset) Type() string { return "preset" } func (v EmbeddingModelTypePreset) MarshalJSON() ([]byte, error) { type aux struct { Type string `json:"type"` Name string `json:"name"` } return json.Marshal(aux{ Type: v.Type(), Name: v.Name, }) } // EmbeddingModelTypeCustom use a custom ONNX model from HuggingFace type EmbeddingModelTypeCustom struct { ModelID string `json:"model_id"` Dimensions uint `json:"dimensions"` } func (EmbeddingModelTypeCustom) isEmbeddingModelType() {} func (EmbeddingModelTypeCustom) Type() string { return "custom" } func (v EmbeddingModelTypeCustom) MarshalJSON() ([]byte, error) { type aux struct { Type string `json:"type"` ModelID string `json:"model_id"` Dimensions uint `json:"dimensions"` } return json.Marshal(aux{ Type: v.Type(), ModelID: v.ModelID, Dimensions: v.Dimensions, }) } // EmbeddingModelTypeLlm provider-hosted embedding model via liter-llm. // // Uses the model specified in the nested `LlmConfig` (e.g., // `"openai/text-embedding-3-small"`). type EmbeddingModelTypeLlm struct { Llm LlmConfig `json:"llm"` } func (EmbeddingModelTypeLlm) isEmbeddingModelType() {} func (EmbeddingModelTypeLlm) Type() string { return "llm" } func (v EmbeddingModelTypeLlm) MarshalJSON() ([]byte, error) { type aux struct { Type string `json:"type"` Llm LlmConfig `json:"llm"` } return json.Marshal(aux{ Type: v.Type(), Llm: v.Llm, }) } // EmbeddingModelTypePlugin in-process embedding backend registered via the plugin system. // // The caller registers an [`EmbeddingBackend`](crate::plugins::EmbeddingBackend) once // (e.g. a wrapper around an already-loaded `llama-cpp-python`, `sentence-transformers`, // or tuned ONNX model), then references it by name in config. Kreuzberg calls back // into the registered backend during chunking and standalone embed requests — // no HuggingFace download, no ONNX Runtime requirement, no HTTP sidecar. // // When this variant is selected, only the following [`EmbeddingConfig`] fields // apply: `normalize` (post-call L2 normalization) and `max_embed_duration_secs` // (dispatcher timeout). Model-loading fields (`batch_size`, `cache_dir`, // `show_download_progress`, `acceleration`) are ignored — the host owns the // model lifecycle. // // Semantic chunking falls back to [`ChunkingConfig::max_characters`] when this variant // is used, since there is no preset to look a chunk-size ceiling up against — size your // context window via `max_characters` directly. // // See `register_embedding_backend`. type EmbeddingModelTypePlugin struct { Name string `json:"name"` } func (EmbeddingModelTypePlugin) isEmbeddingModelType() {} func (EmbeddingModelTypePlugin) Type() string { return "plugin" } func (v EmbeddingModelTypePlugin) MarshalJSON() ([]byte, error) { type aux struct { Type string `json:"type"` Name string `json:"name"` } return json.Marshal(aux{ Type: v.Type(), Name: v.Name, }) } // UnmarshalEmbeddingModelType decodes JSON data into the appropriate concrete EmbeddingModelType variant. func UnmarshalEmbeddingModelType(data []byte) (EmbeddingModelType, error) { var wire struct { Type string `json:"type"` } if err := json.Unmarshal(data, &wire); err != nil { return nil, err } switch wire.Type { case "preset": var v EmbeddingModelTypePreset if err := json.Unmarshal(data, &v); err != nil { return nil, err } return v, nil case "custom": var v EmbeddingModelTypeCustom if err := json.Unmarshal(data, &v); err != nil { return nil, err } return v, nil case "llm": var v EmbeddingModelTypeLlm if err := json.Unmarshal(data, &v); err != nil { return nil, err } return v, nil case "plugin": var v EmbeddingModelTypePlugin if err := json.Unmarshal(data, &v); err != nil { return nil, err } return v, nil } return nil, fmt.Errorf("unknown EmbeddingModelType type: %q", wire.Type) } // CodeContentMode is an enumeration type. type CodeContentMode string const ( // CodeContentModeChunks CodeContentModeChunks use TSLP semantic chunks as content (default). CodeContentModeChunks CodeContentMode = "chunks" // CodeContentModeRaw CodeContentModeRaw use raw source code as content. CodeContentModeRaw CodeContentMode = "raw" // CodeContentModeStructure CodeContentModeStructure emit function/class headings + docstrings (no code bodies). CodeContentModeStructure CodeContentMode = "structure" ) // ListType is an enumeration type. type ListType string const ( // ListTypeBullet ListTypeBullet bullet points (-, *, •, etc.) ListTypeBullet ListType = "bullet" // ListTypeNumbered ListTypeNumbered numbered lists (1., 2., etc.) ListTypeNumbered ListType = "numbered" // ListTypeLettered ListTypeLettered lettered lists (a., b., A., B., etc.) ListTypeLettered ListType = "lettered" // ListTypeIndented ListTypeIndented indented items ListTypeIndented ListType = "indented" ) // OcrBackendType is an enumeration type. type OcrBackendType string const ( // OcrBackendTypeTesseract OcrBackendTypeTesseract tesseract OCR (native Rust binding) OcrBackendTypeTesseract OcrBackendType = "tesseract" // OcrBackendTypeEasyOcr OcrBackendTypeEasyOcr easyOCR (Python-based, via FFI) OcrBackendTypeEasyOcr OcrBackendType = "easy_ocr" // OcrBackendTypePaddleOcr OcrBackendTypePaddleOcr paddleOCR (Python-based, via FFI) OcrBackendTypePaddleOcr OcrBackendType = "paddle_ocr" // OcrBackendTypeCustom OcrBackendTypeCustom custom/third-party OCR backend OcrBackendTypeCustom OcrBackendType = "custom" ) // ProcessingStage is an enumeration type. type ProcessingStage string const ( // ProcessingStageEarly ProcessingStageEarly early stage - foundational processing. // // Use for: // - Language detection // - Character encoding normalization // - Entity extraction (NER) // - Text quality scoring ProcessingStageEarly ProcessingStage = "early" // ProcessingStageMiddle ProcessingStageMiddle middle stage - content transformation. // // Use for: // - Keyword extraction // - Token reduction // - Text summarization // - Semantic analysis ProcessingStageMiddle ProcessingStage = "middle" // ProcessingStageLate ProcessingStageLate late stage - final enrichment. // // Use for: // - Custom user hooks // - Analytics/logging // - Final validation // - Output formatting ProcessingStageLate ProcessingStage = "late" ) // ReductionLevel is an enumeration type. type ReductionLevel string const ( // ReductionLevelOff ReductionLevelOff is the Off variant of ReductionLevel. ReductionLevelOff ReductionLevel = "off" // ReductionLevelLight ReductionLevelLight is the Light variant of ReductionLevel. ReductionLevelLight ReductionLevel = "light" // ReductionLevelModerate ReductionLevelModerate is the Moderate variant of ReductionLevel. ReductionLevelModerate ReductionLevel = "moderate" // ReductionLevelAggressive ReductionLevelAggressive is the Aggressive variant of ReductionLevel. ReductionLevelAggressive ReductionLevel = "aggressive" // ReductionLevelMaximum ReductionLevelMaximum is the Maximum variant of ReductionLevel. ReductionLevelMaximum ReductionLevel = "maximum" ) // PdfAnnotationType is an enumeration type. type PdfAnnotationType string const ( // PdfAnnotationTypeText PdfAnnotationTypeText sticky note / text annotation PdfAnnotationTypeText PdfAnnotationType = "text" // PdfAnnotationTypeHighlight PdfAnnotationTypeHighlight highlighted text region PdfAnnotationTypeHighlight PdfAnnotationType = "highlight" // PdfAnnotationTypeLink PdfAnnotationTypeLink hyperlink annotation PdfAnnotationTypeLink PdfAnnotationType = "link" // PdfAnnotationTypeStamp PdfAnnotationTypeStamp rubber stamp annotation PdfAnnotationTypeStamp PdfAnnotationType = "stamp" // PdfAnnotationTypeUnderline PdfAnnotationTypeUnderline underline text markup PdfAnnotationTypeUnderline PdfAnnotationType = "underline" // PdfAnnotationTypeStrikeOut PdfAnnotationTypeStrikeOut strikeout text markup PdfAnnotationTypeStrikeOut PdfAnnotationType = "strike_out" // PdfAnnotationTypeOther PdfAnnotationTypeOther any other annotation type PdfAnnotationTypeOther PdfAnnotationType = "other" ) // BlockType is an enumeration type. type BlockType string const ( // BlockTypeParagraph BlockTypeParagraph is the Paragraph variant of BlockType. BlockTypeParagraph BlockType = "paragraph" // BlockTypeHeading BlockTypeHeading is the Heading variant of BlockType. BlockTypeHeading BlockType = "heading" // BlockTypeBlockquote BlockTypeBlockquote is the Blockquote variant of BlockType. BlockTypeBlockquote BlockType = "blockquote" // BlockTypeCodeBlock BlockTypeCodeBlock is the CodeBlock variant of BlockType. BlockTypeCodeBlock BlockType = "code_block" // BlockTypeListItem BlockTypeListItem is the ListItem variant of BlockType. BlockTypeListItem BlockType = "list_item" // BlockTypeOrderedList BlockTypeOrderedList is the OrderedList variant of BlockType. BlockTypeOrderedList BlockType = "ordered_list" // BlockTypeBulletList BlockTypeBulletList is the BulletList variant of BlockType. BlockTypeBulletList BlockType = "bullet_list" // BlockTypeTaskList BlockTypeTaskList is the TaskList variant of BlockType. BlockTypeTaskList BlockType = "task_list" // BlockTypeDefinitionList BlockTypeDefinitionList is the DefinitionList variant of BlockType. BlockTypeDefinitionList BlockType = "definition_list" // BlockTypeDefinitionTerm BlockTypeDefinitionTerm is the DefinitionTerm variant of BlockType. BlockTypeDefinitionTerm BlockType = "definition_term" // BlockTypeDefinitionDescription BlockTypeDefinitionDescription is the DefinitionDescription variant of BlockType. BlockTypeDefinitionDescription BlockType = "definition_description" // BlockTypeDiv BlockTypeDiv is the Div variant of BlockType. BlockTypeDiv BlockType = "div" // BlockTypeSection BlockTypeSection is the Section variant of BlockType. BlockTypeSection BlockType = "section" // BlockTypeThematicBreak BlockTypeThematicBreak is the ThematicBreak variant of BlockType. BlockTypeThematicBreak BlockType = "thematic_break" // BlockTypeRawBlock BlockTypeRawBlock is the RawBlock variant of BlockType. BlockTypeRawBlock BlockType = "raw_block" // BlockTypeMathDisplay BlockTypeMathDisplay is the MathDisplay variant of BlockType. BlockTypeMathDisplay BlockType = "math_display" ) // InlineType is an enumeration type. type InlineType string const ( // InlineTypeText InlineTypeText is the Text variant of InlineType. InlineTypeText InlineType = "text" // InlineTypeStrong InlineTypeStrong is the Strong variant of InlineType. InlineTypeStrong InlineType = "strong" // InlineTypeEmphasis InlineTypeEmphasis is the Emphasis variant of InlineType. InlineTypeEmphasis InlineType = "emphasis" // InlineTypeHighlight InlineTypeHighlight is the Highlight variant of InlineType. InlineTypeHighlight InlineType = "highlight" // InlineTypeSubscript InlineTypeSubscript is the Subscript variant of InlineType. InlineTypeSubscript InlineType = "subscript" // InlineTypeSuperscript InlineTypeSuperscript is the Superscript variant of InlineType. InlineTypeSuperscript InlineType = "superscript" // InlineTypeInsert InlineTypeInsert is the Insert variant of InlineType. InlineTypeInsert InlineType = "insert" // InlineTypeDelete InlineTypeDelete is the Delete variant of InlineType. InlineTypeDelete InlineType = "delete" // InlineTypeCode InlineTypeCode is the Code variant of InlineType. InlineTypeCode InlineType = "code" // InlineTypeLink InlineTypeLink is the Link variant of InlineType. InlineTypeLink InlineType = "link" // InlineTypeImage InlineTypeImage is the Image variant of InlineType. InlineTypeImage InlineType = "image" // InlineTypeSpan InlineTypeSpan is the Span variant of InlineType. InlineTypeSpan InlineType = "span" // InlineTypeMath InlineTypeMath is the Math variant of InlineType. InlineTypeMath InlineType = "math" // InlineTypeRawInline InlineTypeRawInline is the RawInline variant of InlineType. InlineTypeRawInline InlineType = "raw_inline" // InlineTypeFootnoteRef InlineTypeFootnoteRef is the FootnoteRef variant of InlineType. InlineTypeFootnoteRef InlineType = "footnote_ref" // InlineTypeSymbol InlineTypeSymbol is the Symbol variant of InlineType. InlineTypeSymbol InlineType = "symbol" ) // RelationshipKind is an enumeration type. type RelationshipKind string const ( // RelationshipKindFootnoteReference RelationshipKindFootnoteReference footnote marker -> footnote definition. RelationshipKindFootnoteReference RelationshipKind = "footnote_reference" // RelationshipKindCitationReference RelationshipKindCitationReference citation marker -> bibliography entry. RelationshipKindCitationReference RelationshipKind = "citation_reference" // RelationshipKindInternalLink RelationshipKindInternalLink internal anchor link (`#id`) -> target heading/element. RelationshipKindInternalLink RelationshipKind = "internal_link" // RelationshipKindCaption RelationshipKindCaption caption paragraph -> figure/table it describes. RelationshipKindCaption RelationshipKind = "caption" // RelationshipKindLabel RelationshipKindLabel label -> labeled element (HTML `