The target Brain to import into.
Recursively walk sourceDir, parse every .md file, and insert traces.
Non-Markdown files are silently ignored. Files that fail to parse are
recorded in result.errors and processing continues.
Directory to recursively scan for .md files.
Optional options: Pick<ImportOptions, "dedup">ImportResult with counts of imported, skipped, and errored items.
Protected postPost-process a parsed file before it is inserted into the database.
The base implementation is a no-op. ObsidianImporter overrides this
to extract [[wikilinks]] and #tags.
Absolute path of the source file.
Parsed front-matter data.
Markdown body content.
Mutable result accumulator.
The ID assigned (or taken from front-matter) for this trace.
Protected holdsWhether a note's body holds a trace's text: the text without its leading
and trailing whitespace, which the import takes off a body, is the body,
each line break in both read as \n (see withLfLineBreaks).
A note whose front-matter id names a trace of its scope and scope id
that it holds is that trace's own note, and so its duplicate, also when
the trace's text begins or ends with whitespace. ObsidianImporter also
reads past the tag line and the links ObsidianExporter writes after the
text, and may read the brain's graph to do so, through db, so an
override may answer with a promise.
The text of the trace the note's id names.
The note's body, without its leading and trailing whitespace.
Optional _db: Pick<Brain, "all">What a read of the brain goes through: the note's transaction, which holds a connection of the brain's own, so a read through the brain would wait for another (a Postgres pool of one waits for good).
true when the note holds the trace's text, or a promise of the answer.
Protected addAdd to a trace what its own note holds beyond the trace, once the import
has found the note to be that trace's own note; the note then counts as
skipped. The base implementation adds nothing: a Markdown note holds only
the trace's text. ObsidianImporter adds the tags of the note's tag line
and the links of its Related: list that the trace does not hold yet.
The trace the note is the note of.
The note's body, without its leading and trailing whitespace.
Mutable result accumulator.
Protected Readonly brainThe target Brain to import into.
Imports Markdown files from a directory into a
Brain.Usage: