Add examples to documentation

This commit is contained in:
Kai Yorke 2025-03-20 14:01:50 +13:00
parent eb31360dad
commit adaec2ca58
No known key found for this signature in database

View file

@ -51,4 +51,27 @@ Introduced in 0.20.0
| `target` | Full path of the target of the link |
| `position` | JSON object containing information about location of the link |
| `display_text` | Text displayed on the page for that link |
| `target_exists` | information if the target file exists. 1 if it exists, 0 otherwise |
| `target_exists` | information if the target file exists. 1 if it exists, 0 otherwise |
#### Frontmatter links
Links that appear in a file's frontmatter (Obsidian properties) contain a `frontmatterKey` property in the `position`
JSON object. This can be used to identify links that are in the note body or within a specific frontmatter property.
For instance, to query all links to the current file that appear in the body of a note:
```sql
SELECT * FROM links
WHERE target = @path
AND json_extract(position, '$.frontmatterKey') IS NULL
```
`frontmatterKey` can be used to select links within a specific property. A Map of Content, for instance, may wish to
show a list of files that list the MOC as a type:
```sql
LIST
SELECT a(path) FROM links
WHERE target = @path
AND json_extract(position, '$.frontmatterKey') = 'type'
```