The Brain instance to read from.
Export the brain's live memory traces as .md files into outputDir.
Another brain's traces in the same database are not read.
Directories are created on demand, one name at a time. A trace is not
written, and is reported in the result, when its scope, type or id is not
a safe file or folder name, when its file would lie outside outputDir,
when a folder or file in its place under outputDir is a symbolic link or
its file has a second name (a hard link), when something other than a
regular file holds its file's place (a folder, a named pipe, a socket, a
device), or when an older trace's file is the same file, where names
ignore case or by the file system's own reckoning. Every other trace is
written. At most MAX_OPEN_TRACE_FILES files are open at once.
Root directory to write the Markdown vault into.
Optional _options: ExportOptionsOptional export configuration (currently unused but accepted for API consistency with other exporters).
The traces left out, with the reason for each.
The first error met opening or writing a file for a reason other than the refusals above, such as a full disk, once every other trace has been tried.
Protected buildBuild the Markdown content for a single trace.
Subclasses (e.g. ObsidianExporter) override this to inject wiki-links
and #tag decorations into the body.
Parsed trace row from the database.
Full Markdown file content (front-matter + body).
Protected frontThe front-matter fields of a trace's file, which MarkdownImporter reads
back: its id, type, scope, strength, tags and creation time, and its scope
id as scopeId when the trace is filed under one. A trace filed under
'' writes no scopeId, and its import files it under ''. A trace of a
Brain that holds the encoded scope-id form writes scopeIdForm: encoded,
so an import takes its scope id as it is written. A trace a second user
filed on another user's session writes that user's id as turnUserId, so
its import files it as that user's trace, which a delete of the user's
traces finds.
The trace row.
The trace's tags, parsed.
Protected traceDetermine the relative file path for a trace within the output directory.
Default: {scope}/{type}/{id}.md. Each of the three must be a safe file
or folder name (see pathNameProblem), or the trace is refused. Whatever
a subclass returns, the export writes the file only when its resolved
path lies inside the output directory.
The trace row.
Relative path string (no leading slash).
When the trace's scope, type or id is not a safe name; the export reports such a trace in its result instead of writing it.
Protected Readonly brainThe Brain instance to read from.
Exports memory traces as Markdown files with YAML front-matter.
Usage: