after_extract
after_extract(items, ctx) receives all extracted items at once. Good for cross-item logic, dedup, or sorting.
No short-circuit: returning nil or empty table just means no items, not a pipeline abort.
Signature
Section titled “Signature”function after_extract(items, ctx) -> tableParameters
Section titled “Parameters”| Field | Type | Description |
|---|---|---|
items |
array | Array of item tables |
Each item has:
item.fields- table (string→string)item.matches- READ-ONLY: Populated by engine
Returns
Section titled “Returns”| Return | Effect |
|---|---|
| Array of items | Continue with modified items |
Empty table / nil / false |
No items to process |
Example
Section titled “Example”function after_extract(items, ctx) -- Remove duplicate titles local seen = {} local unique = {} for _, item in ipairs(items) do local title = item.fields.title or "" if not seen[title] and title ~= "" then seen[title] = true table.insert(unique, item) end end return uniqueendSee Also
Section titled “See Also”- override_extract - Replace the built-in CSS extractor
- filter_item - Per-item filter (replaces built-in keyword filter)