Skip to content
This repository was archived by the owner on Jun 14, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/api/classes/MetadataCache.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,22 @@ Source paths are all vault absolute paths, similar to `resolvedLinks`.
getFirstLinkpathDest(linkpath: string, sourcePath: string): TFile | null;
```

Get the best match for a linkpath.
The function gets the best match for a linkpath, and requires two parameters. You need to supply the source path as well so that it can match the closest note to the source you’re calling it from. This lets it resolve the correct note in case there are two with the same name in your vault.

### getFileCache

```ts
getFileCache(file: TFile): CachedMetadata | null;
```

The input for the `getFileCache` is a TFile (also in the API). This is a JS class for a specific file, that you can also get with the metadata cache if you know the name using `getFirstLinkpathDest`. Alternatively, if you know the full path of a file, you can use `getCache`
### getCache

```ts
getCache(path: string): CachedMetadata;
```

Example: `this.app.metadataCache.getCache("A.md")`

### fileToLinktext

```ts
Expand Down