NotionImport.h header

#include <ew/app/NotionImport.h>

Namespace ew::app

NotionPage struct

struct ew::app::NotionPage

One page read from a Notion "Export → Markdown & CSV" folder: its path relative to the export root (with '/' separators) and its Markdown content. Notion names each file and folder "<Title> <32-hex-id>", nesting sub-pages in a same-named folder beside the page's .md file.

Members

QString ew::app::NotionPage::relativePath

The page's path relative to the export root, e.g. "Characters abc…/Alice def….md".

QString ew::app::NotionPage::content

The page's raw Markdown content.

Functions

ImportedManuscript ew::app::buildNotionDocuments(const std::vector< NotionPage > &pages, const QString &exportName)

Turns a set of Notion pages into an importable manuscript rooted at exportName. Mirrors the export's folder tree: a root Document (kind Note, titled exportName) holds a container Document per subfolder, and each page becomes a Document under its folder's container. Notion's trailing 32-hex-character id is stripped from every title and folder name; each Notion internal link – [Display](Url%20Encoded%20Path.md) – is rewritten to a project link ([Display](ewriter://object/<uuid>)) when its target resolves to another imported page by relative path, and left as literal text otherwise so nothing is lost. Documents are returned by pointer (content objects are non-copyable), root first. Pure and deterministic given pages.

ImportedManuscript ew::app::importNotionExport(const QString &exportDir)

Reads the Notion export directory exportDir recursively (every *.md file) and imports it via buildNotionDocuments(), naming the root after the directory. CSV database files are ignored (only Markdown pages are imported). Returns an empty result if the directory has no Markdown files or cannot be read.