@ -12,7 +12,11 @@ All notable changes to this project will be documented in this file.
* If you want to exclude notes having a particular tag, prefix it with `-` or `NOT` (all caps), e.g. `--tag "NOT done"`.
* Use glob patterns to match multiple tags, e.g. `--tag "book-*"`.
* Many tag flavors are supported: `#hashtags`, `:colon:separated:tags:` ([opt-in](docs/note-format.md)) and even Bear's [`#multi-word tags#`](https://blog.bear.app/2017/11/bear-tips-how-to-create-multi-word-tags/) ([opt-in](docs/note-format.md)). If you prefer to use a YAML frontmatter, list your tags with the key `tags` or `keywords`.
* Print metadata from the YAML frontmatter in `list` output using `{{metadata.<key>}}`, e.g. `{{metadata.description}}`. Keys are normalized to lower case.
* Find every mention of a note in your notebook with `--mention file.md`.
* This will look for occurrences of the note's title in other notes.
* 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-link-to`, e.g. `--mention file.md --no-link-to file.md`.
* Print metadata from the [YAML frontmatter](docs/note-frontmatter.md) in `list` output using `{{metadata.<key>}}`, e.g. `{{metadata.description}}`. Keys are normalized to lower case.
* Use the YAML frontmatter key `date` for the note creation date, when provided.
* Access environment variables from note templates with the `env.<key>` template variable, e.g. `{{env.PATH}}`.
@ -157,6 +157,16 @@ This is such a useful command, that an alias might be helpful.
bl = "zk list --link-to $@"
```
### Locate unlinked mentions of 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.
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"
```
### Browse the Git history of selected notes
This example showcases the "`xargs` formula" with a concrete example.
@ -181,6 +181,29 @@ Part of writing a great notebook is to establish links between related notes. Th
--related 200911172034
```
## Locate mentions in other notes
Another great way to look for potential new links is to find every mention of a note in your notebook.
```
--mention 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).
```
---
title: Artificial Intelligence
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.
```
--mention 200911172034 --no-link-to 200911172034
```
## Exclude notes from the results
To prevent certain notes from polluting the results, you can explicitly exclude them with `--exclude <path>` (or `-x`). This is particularly useful when you have a whole directory of notes to be ignored.
Markdown being a simple format, it does not offer any way to attach additional metadata to a note. The community came up with a solution by inserting a YAML header at the top of each note to contain its metadata. This method is widely supported among Zettelkasten softwares, including `zk`.
```yaml
---
title: Improve the structure of essays by rewriting
| `title` | Title of the note – takes precedence over the first heading |
| `date` | Creation date – takes precedence over the file date |
| `tags` | List of tags attached to this note |
| `keywords` | Alias for `tags` |
All metadata are indexed and can be printed in `zk list` output, using the template variable `{{metadata.<key>}}`, e.g. `{{metadata.description}}`. The keys are normalized to lower case.