Skip to content

Commit e7a2cb8

Browse files
committed
test: Add some notes on how outlinks might be made accessible to users
1 parent 119a9fc commit e7a2cb8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/Obsidian/Cache.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,22 @@ describe('accessing links in file', function () {
616616

617617
const cachedMetadata: CachedMetadata = task.file.cachedMetadata;
618618

619+
/**
620+
* I am thinking of the following, to evantually make links accessible to users.
621+
* 1. Provide a class or interface called Link, with fields:
622+
* - displayText, e.g. "link_in_yaml"
623+
* - link, e.g. "link_in_yaml"
624+
* - original, e.g. "[[link_in_yaml]]"
625+
* 2. Add some getters that construct the relevant Link objects from cached metadata on demand, such as:
626+
* - task.file.linksInBody
627+
* - task.file.linksInFrontMatter
628+
* - task.file.allLinks
629+
* - task.links
630+
* 3. Consider the vocabulary - some dataview users talk about inlines and outlinks.
631+
* The above are all outlinks - but do we want to name them as such, to prepare
632+
* for if or when inlinks are also supported?
633+
*/
634+
619635
it('see source', () => {
620636
expect(data.fileContents).toMatchInlineSnapshot(`
621637
"---

0 commit comments

Comments
 (0)