TableauExcerptExtension.Processor behaviour (TableauExcerptExtension v1.1.0)

Copy Markdown View Source

Behaviour for format-specific excerpt processing.

Processors handle format-specific logic for filtering and cleaning excerpts.

Summary

Callbacks

Cleans an excerpt with format-specific processing.

Filters a list of blocks to keep only paragraph-like content.

Callbacks

clean(excerpt, body)

@callback clean(excerpt :: String.t(), body :: String.t()) :: String.t() | nil

Cleans an excerpt with format-specific processing.

Receives the raw excerpt and the full body content. Returns the cleaned excerpt or nil if the excerpt becomes empty.

filter_paragraphs(blocks)

@callback filter_paragraphs(blocks :: [String.t()]) :: [String.t()]

Filters a list of blocks to keep only paragraph-like content.

Receives blocks split on and returns filtered blocks. Used during fallback extraction to identify actual paragraphs.