Get Decorations

getDecoration

../packages/engine-server/src/enginev2.ts (Private){key: getDecorations}

getDecorations(id) {
    note = this.notes[id]
    runAllDecorators(note)
}
runAllDecorators(note, engine) {
    proc = MDUtilsV5.procRemarkParse
    tree = proc.parse
    tree.visit(nodeIn) {
        runDecorator
    }

}

runDecorator(node, note, noteText) {
    switch(node.type) {
        ...
        decorateWikilink
    }
}
decorateWikilink {
    fname, vaultName  := wikiLink
    linkedNoteType
}

linkedNoteType(note, fnamem vaultName) {
    vault := 
    if vaultName && !vault
        return DECORATION_TYPES.brokenWikilink

    matchingNotes = engine.findNotes
    if !matchingNotes
        return DECORATION_TYPES.brokenWikilink

    matchingNotes = note

}

ref

task note

  const decoration: DecorationTaskNote = {
    type: DECORATION_TYPES.taskNote,
    range,
    beforeText: status ? `${status} ` : undefined,
    afterText:
      decorationString.length > 0
        ? ` ${decorationString.join(" ")}`
        : undefined,
  };

Backlinks