The target Brain to import into.
Recursively walk sourceDir and import every .md file as
MarkdownImporter does, reading each note's #tags and [[wikilinks]]
as well. Each import reads the brain's graph afresh: the labels it holds
that have a line break are read once, when a note first needs them (see
holdsTraceText). An import that inserted a note, or added a tag
to a trace the brain holds, rebuilds the brain's full-text index once,
after its last note, so the full-text search finds the note and the tag.
Directory to recursively scan for .md files.
Optional options: Pick<ImportOptions, "dedup">dedup (default true) skips a note the brain holds.
ImportResult with counts of imported, skipped, and errored items.
Protected holdsWhether a note's body holds a trace's text: the body is the text, as a
Markdown note's is, or it opens with the text, without its leading and
trailing whitespace, and holds after it, past whitespace, only what
ObsidianExporter writes there: the tag line, the Related: list, or
the tag line, a blank line and the list. Each link of the list is a line
- [[label]], or runs over the line breaks of a label the brain's graph
holds, as the export writes a label that holds a line break; the graph is
read for such labels once, when a list does not read as one line a link,
through db, the note's transaction.
The text is read whole, so a trace whose own text ends in a line of hashtags,
and a trace with no text, are the duplicates of their own notes too, and
a vault exported from a brain and imported into it adds nothing. A note
that holds anything else after the text, such as a paragraph added in
Obsidian before or after its links, is not the trace's own note. Line
breaks are read as \n in the note, the text and the labels alike, so a
note an editor saved again with CRLF line endings is its trace's own note.
The text of the trace the note's id names.
The note's body, without its leading and trailing whitespace.
What the graph is read through: the note's transaction, or the brain.
A promise of true when the note holds the trace's text.
Protected addAdd to a trace what its own note holds beyond the trace: the tags of the
note's tag line the trace does not hold, a tag compared in the form the
tag line writes it (whitespace as -), and links from the trace's node to
the labels of the note's Related: list it does not link to, a link
read as postProcess reads one. A note left as the export wrote it
adds nothing to a trace that still holds the tags and links the export
wrote; a tag or a link the trace lost after the export is added again.
The trace the note is the note of.
The note's body, without its leading and trailing whitespace.
Mutable result accumulator (errors recorded here).
Protected postPost-process a successfully imported Markdown file:
![[...]]).#hashtags and merge them into the trace's tag list.[[wikilinks]] and create knowledge_edges entries.Absolute path of the source file (unused here).
Parsed front-matter data.
Markdown body (content after front-matter).
Mutable ImportResult accumulator.
The ID of the just-inserted trace.
Protected Readonly brainThe target Brain to import into.
Imports an Obsidian vault (directory of Markdown files) into a
Brain.Usage: