@ -15,6 +15,9 @@ All notable changes to this project will be documented in this file.
* This allows running `zk` without being in a notebook.
* By setting `ZK_NOTEBOOK_DIR` in your shell configuration file (e.g. `~/.profile`), you are declaring a default global notebook which will be used when `zk` is not in a notebook.
* When the notebook directory is set explicitly, any path given as argument will be relative to it instead of the actual working directory.
* Find every note whose title is mentioned in the note you are working on with `--mentioned-by file.md`.
* To refer to a note using several names, you can use the [YAML frontmatter key `aliases`](https://publish.obsidian.md/help/How+to/Add+aliases+to+note). For example the note titled "Artificial Intelligence" might have: `aliases: [AI, robot]`
* To find only unlinked mentions, pair it with `--no-linked-by`, e.g. `--mentioned-by file.md --no-linked-by file.md`.
joinClauses=append(joinClauses,"JOIN notes_fts nsrc ON nsrc.rowid IN ("+d.joinIds(ids,",")+") AND nsrc.notes_fts MATCH mention_query(n.title, n.metadata)")
}
ifopts.LinkedBy!=nil{
filter:=opts.LinkedBy
maxDistance=filter.MaxDistance
@ -658,6 +638,10 @@ WHERE collection_id IN (SELECT id FROM collections t WHERE kind = '%s' AND (%s))
args=append(args,opts.ModifiedEnd)
}
ifopts.ExcludeIds!=nil{
whereExprs=append(whereExprs,"n.id NOT IN ("+d.joinIds(opts.ExcludeIds,",")+")")
@ -157,14 +157,14 @@ This is such a useful command, that an alias might be helpful.
bl = "zk list --link-to $@"
```
### Locate unlinked mentions of a note
### Locate unlinked mentions in a note
This alias can help you look for potential new links to establish, by listing every mention of a note in your notebook which is not already linked to it.
This alias can help you look for potential new links to establish, by listing every note whose title is mentioned in the note you are working on but which are not already linked to it.
Note that we are using a single argument `$1` which is repeated for both options.
```toml
unlinked-mentions = "zk list --mention $1 --no-link-to $1"
unlinked-mentions = "zk list --mentioned-by $1 --no-linked-by $1"
@ -158,7 +158,7 @@ You can filter by range instead, using `--created-before`, `--created-after`, `-
You can use the following options to explore the web of links spanning your [notebook](notebook.md).
`--linked-by <path>` (or `-l`) finds the notes linked by the given one, while `--link-to <path>` (or `-L`) searches the notes having a link to it (also known as *backlinks*).
`--linked-by <path>` (or `-L`) finds the notes linked by the given one, while `--link-to <path>` (or `-l`) searches the notes having a link to it (also known as *backlinks*).
```
--linked-by 200911172034
@ -181,15 +181,15 @@ Part of writing a great notebook is to establish links between related notes. Th
--related 200911172034
```
## Locate mentions in other notes
## Locate mentions of other notes
Another great way to look for potential new links is to find every mention of a note in your notebook.
Another great way to look for potential new links is to find every mention of other notes in the note you are currently working on.
```
--mention 200911172034
--mentioned-by 200911172034
```
This option will locate the notes containing the note's title. To refer to a note using several names, you can use the [YAML frontmatter](note-frontmatter.md) to declare additional aliases. For example, a note titled "Artificial Intelligence" might have for aliases "AI" and "robot". This method is compatible with [Obsidian](https://publish.obsidian.md/help/How+to/Add+aliases+to+note).
This option will find every note whose title is mentioned in the given note. To refer to a note using several names, you can use the [YAML frontmatter](note-frontmatter.md) to declare additional aliases. For example, a note titled "Artificial Intelligence" might have for aliases "AI" and "robot". This method is compatible with [Obsidian](https://publish.obsidian.md/help/How+to/Add+aliases+to+note).
```
---
@ -198,9 +198,16 @@ aliases: [AI, robot]
---
```
To find only unlinked mentions, pair the `--mention` option with `--no-link-to` to remove notes which are already linked from the results.
Alternatively, find every note mentioning the given note with `--mention`.
```
--mention 200911172034
```
To find only unlinked mentions, pair the `--mentioned-by` and `--mentions` options with `--no-linked-by` (resp. `--no-link-to`) to remove notes which are already linked from the results.