Documentation
¶
Overview ¶
export.go normalizes a Notion workspace EXPORT (the "Markdown & CSV" or "HTML" zip a user downloads) into vault.Page documents — distinct from notion.go, which shapes records from the live Notion API connector. Both live in this package because both are pure Notion-format knowledge; neither depends on cloud.
A Notion export encodes hierarchy in the directory tree (a page's subpages live in a folder named after the page) and links between pages as relative file links ([text](Child%20<id>.md) or <a href="Child%20<id>.html">). This normalizer rebuilds the parent tree from the folder nesting and rewrites intra-export links to "[Title]" wikilinks, so the kb-page after_save hook extracts them into kb-link edges — the export's link structure survives as real KB links.
Package notion is the pure record-shaping logic for the Notion long-tail connector: how to turn the raw JSON a Notion search returns (via the activepieces piece run through the auto engine) into normalized {title, body, external_id, url, timestamp} documents for KB ingestion. It has NO cloud dependency, so the Notion parsing — where the real per-provider complexity lives — is unit-testable in isolation. clients/kb/sync_piece.go wires this into the framework.Ingest path.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Body ¶
Body renders a short body from the record's plain-text property values, so the embedding has prose beyond the title. Full block content is a follow-up getPageOrBlockChildren pull; this keeps the first ingest bounded and honest.
func ParseExport ¶
ParseExport maps a Notion export's page files (.md or .html) to pages, resolving the parent tree from folder nesting and rewriting intra-export links to wikilinks. Non-page files (.csv databases, images) are ignored.
func Results ¶
Results extracts the item list from a custom_api_call output. The piece returns { status, headers, body }; a Notion search puts items under body.results.