From e7a2cb8b2867f7ae1417db0ec7ebe0380b6fbbb4 Mon Sep 17 00:00:00 2001 From: Clare Macrae Date: Fri, 22 Nov 2024 12:06:52 +0000 Subject: [PATCH] test: Add some notes on how outlinks might be made accessible to users --- tests/Obsidian/Cache.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/Obsidian/Cache.test.ts b/tests/Obsidian/Cache.test.ts index 33bf8e550d..60e72e8a62 100644 --- a/tests/Obsidian/Cache.test.ts +++ b/tests/Obsidian/Cache.test.ts @@ -616,6 +616,22 @@ describe('accessing links in file', function () { const cachedMetadata: CachedMetadata = task.file.cachedMetadata; + /** + * I am thinking of the following, to evantually make links accessible to users. + * 1. Provide a class or interface called Link, with fields: + * - displayText, e.g. "link_in_yaml" + * - link, e.g. "link_in_yaml" + * - original, e.g. "[[link_in_yaml]]" + * 2. Add some getters that construct the relevant Link objects from cached metadata on demand, such as: + * - task.file.linksInBody + * - task.file.linksInFrontMatter + * - task.file.allLinks + * - task.links + * 3. Consider the vocabulary - some dataview users talk about inlines and outlinks. + * The above are all outlinks - but do we want to name them as such, to prepare + * for if or when inlinks are also supported? + */ + it('see source', () => { expect(data.fileContents).toMatchInlineSnapshot(` "---