@vrerv/md-to-notion
Version:
An upload of markdown files to a hierarchy of Notion pages.
28 lines • 1.26 kB
TypeScript
export interface Folder {
name: string;
files: MarkdownFileData[];
subfolders: Folder[];
}
export interface MarkdownFileData {
fileName: string;
getContent: (linkMap: Map<string, string>) => any[];
}
/**
* Read and process Markdown files from a specified directory.
* The function reads all Markdown files in the directory and its subdirectories, following symbolic links,
* extracts their content, and converts it to Notion block format.
*
* @param dirPath - The path to the directory containing the Markdown files.
* @param filter - A function that determines if a path should be processed. node_modules are excluded by default.
* @param replacer
* @returns A hierarchical structure of folders and files that contain Markdown files.
*/
export declare function readMarkdownFiles(dirPath: string, filter?: (path: string) => boolean, replacer?: (text: string, linkPathFromRoot: string) => string): Folder | null;
/**
* Prints the folder hierarchy structure.
*
* @param folder - The root folder to start printing from.
* @param indent - The current level of indentation (used for recursion).
*/
export declare function printFolderHierarchy(folder: Folder | null, indent?: string): void;
//# sourceMappingURL=read-md.d.ts.map