Compare commits
95 Commits
Author | SHA1 | Date |
---|---|---|
Tillman Jex | be5bd76ee4 | 2 weeks ago |
Tillman Jex | 1741d3baa6 | 2 weeks ago |
tjex | a2bc5253e0 | 2 weeks ago |
tjex | 97d2ecf764 | 2 weeks ago |
Alison Jenkins | 8e1b2d9d17 | 2 weeks ago |
Kenichi Kamiya | 4d900eb902 | 2 weeks ago |
tjex | a8377e4bf7 | 2 weeks ago |
Tillman Jex | 1bd1058f20 | 2 weeks ago |
tjex | ea9cbbbbe9 | 2 weeks ago |
tjex | d9f76cfc89 | 2 weeks ago |
tjex | 8f20ac8258 | 2 weeks ago |
Nikhil Nygaard | 0787930ca5 | 1 month ago |
Vitaly Yerofeyevsky | 4a51e398ae | 2 months ago |
Tillman Jex | 7ae8a39de7 | 2 months ago |
Tillman Jex | 725126575d | 3 months ago |
Hugo | a50d5330df | 3 months ago |
Sören Tempel | 555e199cfb | 3 months ago |
Tillman Jex | f0ed61cda7 | 3 months ago |
Tillman Jex | 6134873a5a | 3 months ago |
Billy Priambodo | 53df87974c | 3 months ago |
Hugo | 739d2d4fc0 | 3 months ago |
Hugo | 0edbb6f57a | 3 months ago |
Sören Tempel | 00a4361d20 | 4 months ago |
Tillman Jex | 578894f45b | 4 months ago |
Tillman Jex | e21519a1b4 | 4 months ago |
Tillman Jex | cfa74a7f0c | 4 months ago |
Tillman Jex | 8e2add0606 | 4 months ago |
guangwu | bf5cad60dc | 4 months ago |
Alexis Praga | c3f26ca12b | 5 months ago |
Tillman Jex | 0973f9929d | 6 months ago |
dependabot[bot] | 45b68121ce | 6 months ago |
Tadeas Uhlir | c9d4734d3c | 6 months ago |
Tadeas Uhlir | 05c50a70d5 | 6 months ago |
Tillman Jex | b10d51dbc2 | 6 months ago |
Tillman Jex | 56f4e650ea | 6 months ago |
Sumit Sahrawat | 6a06ded3c4 | 7 months ago |
Kyle Huggins | 1471c6be2c | 8 months ago |
Tillman Jex | d4e542b70c | 8 months ago |
Tillman Jex | 537c7f7554 | 8 months ago |
Michael McDonagh | 55d5487d24 | 9 months ago |
dependabot[bot] | f7079be6c0 | 9 months ago |
dependabot[bot] | a1f2a701af | 9 months ago |
dependabot[bot] | 70a9afb9f5 | 9 months ago |
Michael McDonagh | 0eaf26483f | 9 months ago |
Julio Lopez | 5a2333d0af | 9 months ago |
Mickaël Menu | e3e52dfe69 | 9 months ago |
Julio Lopez | 87f3680a9b | 9 months ago |
dependabot[bot] | f120f9546c | 9 months ago |
Tillman Jex | 5bb1c0ba89 | 9 months ago |
Tillman Jex | 1e28fe4b92 | 9 months ago |
Michael McDonagh | 50fb638dd9 | 9 months ago |
Michael McDonagh | 7ba9df6526 | 9 months ago |
Julio Lopez | be1249d7a6 | 11 months ago |
Julio Lopez | 228c96fcea | 11 months ago |
dependabot[bot] | 1fd1298c00 | 12 months ago |
khimaros | 0b4db9ade6 | 1 year ago |
Mickaël Menu | 072fae2f6c | 1 year ago |
Mickaël Menu | b71a74eabc | 1 year ago |
Mickaël Menu | 1ec777de7e | 1 year ago |
Mickaël Menu | 75205fe099 | 1 year ago |
wrvsrx | 6252e51595 | 1 year ago |
Leonardo Mello | e26ac5133e | 1 year ago |
Leonardo Mello | a8d1db4c57 | 2 years ago |
dependabot[bot] | ba611e1c1e | 2 years ago |
Mickaël Menu | 39bcb8069f | 2 years ago |
dependabot[bot] | 89ff022593 | 2 years ago |
Mickaël Menu | ea4457ad67 | 2 years ago |
Cyril Dutrieux | 6401a4e1f6 | 2 years ago |
Patrick Anker | f7d4db07d6 | 2 years ago |
Leiser Fernández Gallo | 150c82fb22 | 2 years ago |
Matthias Vogelgesang | 279f9ef3cd | 2 years ago |
dependabot[bot] | 6506198743 | 2 years ago |
Mickaël Menu | ae3a86dbfa | 2 years ago |
Mickaël Menu | d79da8933a | 2 years ago |
Mickaël Menu | 15d4cfc921 | 2 years ago |
Oliver Marriott | 142b636342 | 2 years ago |
Oliver Marriott | 9d88245102 | 2 years ago |
Zach Leslie | 404ef9d6f5 | 2 years ago |
Mickaël Menu | c21c4fc21f | 2 years ago |
dependabot[bot] | cdf4f8e0c1 | 2 years ago |
Mickaël Menu | 1745097256 | 2 years ago |
Sridhar Ratnakumar | 9faec3628a | 2 years ago |
Kristof Lünenschloß | 814a5d7c07 | 2 years ago |
bibor | ab1d8fd0bd | 2 years ago |
Mickaël Menu | 61b9c0f5d7 | 2 years ago |
Mickaël Menu | 78c40eeecf | 2 years ago |
Pete Kazmier | a6e522562e | 2 years ago |
Mickaël Menu | eefc3be9c6 | 2 years ago |
Mickaël Menu | c06375ee3a | 2 years ago |
Mickaël Menu | 8bfafe5dab | 2 years ago |
Mickaël Menu | 53aabce1ed | 2 years ago |
Mickaël Menu | aaf6c42bd8 | 2 years ago |
Mickaël Menu | 68e6b70eae | 2 years ago |
Mickaël Menu | 4b76fbadf1 | 2 years ago |
Mickaël Menu | 1a05a04432 | 2 years ago |
@ -0,0 +1,19 @@
|
|||||||
|
title: "[Help] "
|
||||||
|
body:
|
||||||
|
- type: checkboxes
|
||||||
|
id: checks
|
||||||
|
attributes:
|
||||||
|
label: Verify
|
||||||
|
options:
|
||||||
|
- label: I searched the existing discussions for help
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: help
|
||||||
|
attributes:
|
||||||
|
label: How can we help you?
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
:warning: Unfortunately, my time is limited and I can't offer reliable user support. I might answer if you catch me on a slow day, or hopefully someone else will.
|
@ -0,0 +1,14 @@
|
|||||||
|
body:
|
||||||
|
- type: checkboxes
|
||||||
|
id: checks
|
||||||
|
attributes:
|
||||||
|
label: Verify
|
||||||
|
options:
|
||||||
|
- label: I searched the existing discussions for similar ideas
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: help
|
||||||
|
attributes:
|
||||||
|
label: Share your idea or feature request
|
||||||
|
validations:
|
||||||
|
required: true
|
@ -0,0 +1,65 @@
|
|||||||
|
name: Bug report
|
||||||
|
description: File a bug report to help improve zk.
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Thank you for filing a bug report!
|
||||||
|
- type: checkboxes
|
||||||
|
id: checks
|
||||||
|
attributes:
|
||||||
|
label: Check if applicable
|
||||||
|
description: |
|
||||||
|
:warning: My time is limited and if I don't plan on fixing the reported bug myself, I might close this issue. No hard feelings.
|
||||||
|
:heart: But if you would like to contribute a fix yourself, **I'll be happy to guide you through the codebase and review a pull request**.
|
||||||
|
options:
|
||||||
|
- label: I have searched the existing issues (**required**)
|
||||||
|
required: true
|
||||||
|
- label: I'm willing to help fix the problem and contribute a pull request
|
||||||
|
- type: textarea
|
||||||
|
id: bug-description
|
||||||
|
attributes:
|
||||||
|
label: Describe the bug
|
||||||
|
description: Also tell me, what did you expect to happen?
|
||||||
|
placeholder: A clear and concise description of what the bug is.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: bug-steps
|
||||||
|
attributes:
|
||||||
|
label: How to reproduce?
|
||||||
|
description: |
|
||||||
|
Step by step explanation to reproduce the issue.
|
||||||
|
|
||||||
|
If you can, drag and drop:
|
||||||
|
- a zipped sample notebook
|
||||||
|
- screenshots or a screencast showing the issue
|
||||||
|
placeholder: |
|
||||||
|
1. Add a note with the content "..."
|
||||||
|
2. Run `zk edit --interactive`
|
||||||
|
3. See error
|
||||||
|
...
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: vim-config
|
||||||
|
attributes:
|
||||||
|
label: zk configuration
|
||||||
|
description: |
|
||||||
|
Paste the minimal `zk` configuration file (`.zk/config.toml`) reproducing the issue.
|
||||||
|
render: toml
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: bug-environment
|
||||||
|
attributes:
|
||||||
|
label: Environment
|
||||||
|
description: |
|
||||||
|
Run the following shell commands and paste the result here:
|
||||||
|
```
|
||||||
|
zk --version && echo "system: `uname -srmo`"
|
||||||
|
```
|
||||||
|
placeholder: |
|
||||||
|
zk 0.13.0
|
||||||
|
system: Darwin 22.5.0 arm64
|
||||||
|
render: bash
|
@ -0,0 +1,10 @@
|
|||||||
|
name: Feature request
|
||||||
|
description: Suggest an idea for this project.
|
||||||
|
body:
|
||||||
|
- type: checkboxes
|
||||||
|
id: checks
|
||||||
|
attributes:
|
||||||
|
label: If you have an idea, open a discussion
|
||||||
|
options:
|
||||||
|
- label: I will [create a new discussion](https://github.com/zk-org/zk/discussions/new?category=ideas) instead of an issue.
|
||||||
|
|
@ -0,0 +1,13 @@
|
|||||||
|
name: User support
|
||||||
|
description: You need help?
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
:warning: Unfortunately, my time is limited and I can't offer reliable user support. I might answer if you catch me on a slow day, or hopefully someone else will.
|
||||||
|
- type: checkboxes
|
||||||
|
id: checks
|
||||||
|
attributes:
|
||||||
|
label: If you need help, open a discussion
|
||||||
|
options:
|
||||||
|
- label: I will [create a new discussion](https://github.com/zk-org/zk/discussions/new?category=help) instead of an issue.
|
@ -0,0 +1,26 @@
|
|||||||
|
# Build the Sphinx docs on PR to catch any issues before merging.
|
||||||
|
# Deployment happens on push to main with gh-pages.yml
|
||||||
|
name: Build Docs
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: "pages"
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pages:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
permissions:
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
steps:
|
||||||
|
- id: deployment
|
||||||
|
uses: sphinx-notes/pages@v3
|
||||||
|
with:
|
||||||
|
publish: false
|
@ -0,0 +1,24 @@
|
|||||||
|
name: Deploy GitHub Pages
|
||||||
|
|
||||||
|
# NOTE: workflow uses this repo: https://github.com/sphinx-notes/pages
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: "pages"
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pages:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
permissions:
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
steps:
|
||||||
|
- id: deployment
|
||||||
|
uses: sphinx-notes/pages@v3
|
@ -0,0 +1,2 @@
|
|||||||
|
printWidth: 80
|
||||||
|
proseWrap: "always"
|
@ -0,0 +1,66 @@
|
|||||||
|
# Contributing to `zk`
|
||||||
|
|
||||||
|
## Understanding the codebase
|
||||||
|
|
||||||
|
### Building the project
|
||||||
|
|
||||||
|
It is recommended to use the `Makefile` for compiling the project, as the `go` command requires a few parameters.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
make build
|
||||||
|
```
|
||||||
|
|
||||||
|
This will be expanded to the following command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
CGO_ENABLED=1 GOARCH=arm64 go build -tags "fts5" -ldflags "-X=main.Version=`git describe --tags --match v[0-9]* 2> /dev/null` -X=main.Build=`git rev-parse --short HEAD`"
|
||||||
|
```
|
||||||
|
|
||||||
|
- `CGO_ENABLED=1` enables CGO, which is required by the `mattn/go-sqlite3` dependency.
|
||||||
|
- `GOARCH=arm64` is only required for Apple Silicon chips.
|
||||||
|
- `-tags "fts5"` enables the FTS option with `mattn/go-sqlite3`, which handles much of the magic behind `zk`'s `--match` filtering option.
|
||||||
|
- ``-ldflags "-X=main.Version=`git describe --tags --match v[0-9]* 2> /dev/null` -X=main.Build=`git rev-parse --short HEAD`"`` will automatically set `zk`'s build and version numbers using the latest Git tag and commit SHA.
|
||||||
|
|
||||||
|
### Automated tests
|
||||||
|
|
||||||
|
The project is vetted with two different kind of automated tests: unit tests and end-to-end tests.
|
||||||
|
|
||||||
|
#### Unit tests
|
||||||
|
|
||||||
|
Unit tests are using the standard [Go testing library](https://pkg.go.dev/testing). To execute them, use the command `make test`.
|
||||||
|
|
||||||
|
They are ideal for testing parsing output or individual API edge cases and minutiae.
|
||||||
|
|
||||||
|
#### End-to-end tests
|
||||||
|
|
||||||
|
Most of `zk`'s functionality is tested with functional tests ran with [`tesh`](https://github.com/mickael-menu/tesh), which you can execute with `make tesh` (or `make teshb`, to debug whitespaces changes).
|
||||||
|
|
||||||
|
When addressing a GitHub issue, it's a good idea to begin by creating a `tesh` file in `tests/issue-XXX.tesh`. If a starting notebook state is required, it can be added under `tests/fixtures`.
|
||||||
|
|
||||||
|
If you modify the output of `zk`, you may disrupt some `tesh` files. You can use `make tesh-update` to automatically update them with the correct output.
|
||||||
|
|
||||||
|
### CI workflows
|
||||||
|
|
||||||
|
Several GitHub action workflows are executed when pull requests are merged or releases are created.
|
||||||
|
|
||||||
|
- `.github/workflows/build.yml` checks that the project can be built and the tests still pass.
|
||||||
|
- `.github/workflows/codeql.yml` runs static analysis to vet code quality.
|
||||||
|
- `.github/workflows/gh-pages.yml` deploy the documentation files to GitHub Pages.
|
||||||
|
- `.github/workflows/release.yml` submits a new version to Homebrew when a Git version tag is created.
|
||||||
|
- `.github/workflows/triage.yml` automatically tags old issues and PRs as staled.
|
||||||
|
|
||||||
|
## Releasing a new version
|
||||||
|
|
||||||
|
When `zk` is ready to be released, you can update the `CHANGELOG.md` ([for example](https://github.com/zk-org/zk/commit/ea4457ad671aa85a6b15747460c6f2c9ad61bf73)) and create a new Git version tag (for example `v0.13.0`). Make sure you follow the [Semantic Versioning](https://semver.org) scheme.
|
||||||
|
|
||||||
|
Then, create [a new GitHub release](https://github.com/zk-org/zk/releases) with a copy of the latest `CHANGELOG.md` entries and the binaries for all supported platforms.
|
||||||
|
|
||||||
|
Binaries can be created automatically using `make dist-linux` and `make dist-macos`.
|
||||||
|
|
||||||
|
Unfortunately, `make dist-macos` must be run manually on both an Apple Silicon and Intel chips. The Linux builds are created using Docker and [these custom images](https://github.com/zk-org/zk-xcompile), which are hosted via [ghcr.io within zk-org](https://github.com/orgs/zk-org/packages/container/package/zk-xcompile).
|
||||||
|
|
||||||
|
This process is convoluted because `zk` requires CGO with `mattn/go-sqlite3`, which prevents using Go's native cross-compilation. Transitioning to a CGO-free SQLite driver such as [cznic/sqlite](https://gitlab.com/cznic/sqlite) could simplify the distribution process significantly.
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
TODO: add documentation steps for Sphinx docs, after it's all working.
|
@ -0,0 +1,24 @@
|
|||||||
|
title: "zk"
|
||||||
|
permalink: /:title
|
||||||
|
defaults:
|
||||||
|
- scope:
|
||||||
|
path: "README.md"
|
||||||
|
values:
|
||||||
|
title: "zk"
|
||||||
|
- scope:
|
||||||
|
path: "" # all
|
||||||
|
values:
|
||||||
|
render_with_liquid: false
|
||||||
|
exclude:
|
||||||
|
- ".github/"
|
||||||
|
- ".gitignore"
|
||||||
|
- "CHANGELOG.md"
|
||||||
|
- "CONTRIBUTING.md"
|
||||||
|
- "LICENSE"
|
||||||
|
- "Makefile"
|
||||||
|
- "go.mod"
|
||||||
|
- "go.sum"
|
||||||
|
- "internal/"
|
||||||
|
- "main.go"
|
||||||
|
- "tests/"
|
||||||
|
|
@ -0,0 +1,197 @@
|
|||||||
|
# zk configuration file
|
||||||
|
#
|
||||||
|
# Uncomment the properties you want to customize.
|
||||||
|
|
||||||
|
# NOTE SETTINGS
|
||||||
|
#
|
||||||
|
# Defines the default options used when generating new notes.
|
||||||
|
[note]
|
||||||
|
|
||||||
|
# Language used when writing notes.
|
||||||
|
# This is used to generate slugs or with date formats.
|
||||||
|
#language = "en"
|
||||||
|
|
||||||
|
# The default title used for new note, if no `--title` flag is provided.
|
||||||
|
#default-title = "Untitled"
|
||||||
|
|
||||||
|
# Template used to generate a note's filename, without extension.
|
||||||
|
#filename = "{{id}}"
|
||||||
|
|
||||||
|
# The file extension used for the notes.
|
||||||
|
#extension = "md"
|
||||||
|
|
||||||
|
# Template used to generate a note's content.
|
||||||
|
# If not an absolute path or "~/unix/path", it's relative to .zk/templates/
|
||||||
|
template = "default.md"
|
||||||
|
|
||||||
|
# Path globs ignored while indexing existing notes.
|
||||||
|
#ignore = [
|
||||||
|
# "drafts/*",
|
||||||
|
# "log.md"
|
||||||
|
#]
|
||||||
|
|
||||||
|
# Configure random ID generation.
|
||||||
|
|
||||||
|
# The charset used for random IDs. You can use:
|
||||||
|
# * letters: only letters from a to z.
|
||||||
|
# * numbers: 0 to 9
|
||||||
|
# * alphanum: letters + numbers
|
||||||
|
# * hex: hexadecimal, from a to f and 0 to 9
|
||||||
|
# * custom string: will use any character from the provided value
|
||||||
|
#id-charset = "alphanum"
|
||||||
|
|
||||||
|
# Length of the generated IDs.
|
||||||
|
#id-length = 4
|
||||||
|
|
||||||
|
# Letter case for the random IDs, among lower, upper or mixed.
|
||||||
|
#id-case = "lower"
|
||||||
|
|
||||||
|
|
||||||
|
# EXTRA VARIABLES
|
||||||
|
#
|
||||||
|
# A dictionary of variables you can use for any custom values when generating
|
||||||
|
# new notes. They are accessible in templates with {{extra.<key>}}
|
||||||
|
[extra]
|
||||||
|
|
||||||
|
#key = "value"
|
||||||
|
|
||||||
|
|
||||||
|
# GROUP OVERRIDES
|
||||||
|
#
|
||||||
|
# You can override global settings from [note] and [extra] for a particular
|
||||||
|
# group of notes by declaring a [group."<name>"] section.
|
||||||
|
#
|
||||||
|
# Specify the list of directories which will automatically belong to the group
|
||||||
|
# with the optional `paths` property.
|
||||||
|
#
|
||||||
|
# Omitting `paths` is equivalent to providing a single path equal to the name of
|
||||||
|
# the group. This can be useful to quickly declare a group by the name of the
|
||||||
|
# directory it applies to.
|
||||||
|
|
||||||
|
#[group."<NAME>"]
|
||||||
|
#paths = ["<DIR1>", "<DIR2>"]
|
||||||
|
#[group."<NAME>".note]
|
||||||
|
#filename = "{{format-date now}}"
|
||||||
|
#[group."<NAME>".extra]
|
||||||
|
#key = "value"
|
||||||
|
|
||||||
|
|
||||||
|
# MARKDOWN SETTINGS
|
||||||
|
[format.markdown]
|
||||||
|
|
||||||
|
# Format used to generate links between notes.
|
||||||
|
# Either "wiki", "markdown" or a custom template. Default is "markdown".
|
||||||
|
#link-format = "wiki"
|
||||||
|
# Indicates whether a link's path will be percent-encoded.
|
||||||
|
# Defaults to true for "markdown" format and false for "wiki" format.
|
||||||
|
#link-encode-path = true
|
||||||
|
# Indicates whether a link's path file extension will be removed.
|
||||||
|
# Defaults to true.
|
||||||
|
#link-drop-extension = true
|
||||||
|
|
||||||
|
# Enable support for #hashtags.
|
||||||
|
hashtags = true
|
||||||
|
# Enable support for :colon:separated:tags:.
|
||||||
|
colon-tags = false
|
||||||
|
# Enable support for Bear's #multi-word tags#
|
||||||
|
# Hashtags must be enabled for multi-word tags to work.
|
||||||
|
multiword-tags = false
|
||||||
|
|
||||||
|
|
||||||
|
# EXTERNAL TOOLS
|
||||||
|
[tool]
|
||||||
|
|
||||||
|
# Default editor used to open notes. When not set, the EDITOR or VISUAL
|
||||||
|
# environment variables are used.
|
||||||
|
#editor = "vim"
|
||||||
|
|
||||||
|
# Pager used to scroll through long output. If you want to disable paging
|
||||||
|
# altogether, set it to an empty string "".
|
||||||
|
#pager = "less -FIRX"
|
||||||
|
|
||||||
|
# Command used to preview a note during interactive fzf mode.
|
||||||
|
# Set it to an empty string "" to disable preview.
|
||||||
|
|
||||||
|
# bat is a great tool to render Markdown document with syntax highlighting.
|
||||||
|
#https://github.com/sharkdp/bat
|
||||||
|
#fzf-preview = "bat -p --color always {-1}"
|
||||||
|
|
||||||
|
|
||||||
|
# LSP
|
||||||
|
#
|
||||||
|
# Configure basic editor integration for LSP-compatible editors.
|
||||||
|
# See https://github.com/zk-org/zk/blob/main/docs/editors-integration.md
|
||||||
|
#
|
||||||
|
[lsp]
|
||||||
|
|
||||||
|
[lsp.diagnostics]
|
||||||
|
# Each diagnostic can have for value: none, hint, info, warning, error
|
||||||
|
|
||||||
|
# Report titles of wiki-links as hints.
|
||||||
|
#wiki-title = "hint"
|
||||||
|
# Warn for dead links between notes.
|
||||||
|
dead-link = "error"
|
||||||
|
|
||||||
|
[lsp.completion]
|
||||||
|
# Customize the completion pop-up of your LSP client.
|
||||||
|
|
||||||
|
# Show the note title in the completion pop-up, or fallback on its path if empty.
|
||||||
|
#note-label = "{{title-or-path}}"
|
||||||
|
# Filter out the completion pop-up using the note title or its path.
|
||||||
|
#note-filter-text = "{{title}} {{path}}"
|
||||||
|
# Show the note filename without extension as detail.
|
||||||
|
#note-detail = "{{filename-stem}}"
|
||||||
|
|
||||||
|
|
||||||
|
# NAMED FILTERS
|
||||||
|
#
|
||||||
|
# A named filter is a set of note filtering options used frequently together.
|
||||||
|
#
|
||||||
|
[filter]
|
||||||
|
|
||||||
|
# Matches the notes created the last two weeks. For example:
|
||||||
|
# $ zk list recents --limit 15
|
||||||
|
# $ zk edit recents --interactive
|
||||||
|
#recents = "--sort created- --created-after 'last two weeks'"
|
||||||
|
|
||||||
|
|
||||||
|
# COMMAND ALIASES
|
||||||
|
#
|
||||||
|
# Aliases are user commands called with `zk <alias> [<flags>] [<args>]`.
|
||||||
|
#
|
||||||
|
# The alias will be executed with `$SHELL -c`, please refer to your shell's
|
||||||
|
# man page to see the available syntax. In most shells:
|
||||||
|
# * $@ can be used to expand all the provided flags and arguments
|
||||||
|
# * you can pipe commands together with the usual | character
|
||||||
|
#
|
||||||
|
[alias]
|
||||||
|
# Here are a few aliases to get you started.
|
||||||
|
|
||||||
|
# Shortcut to a command.
|
||||||
|
#ls = "zk list $@"
|
||||||
|
|
||||||
|
# Default flags for an existing command.
|
||||||
|
#list = "zk list --quiet $@"
|
||||||
|
|
||||||
|
# Edit the last modified note.
|
||||||
|
#editlast = "zk edit --limit 1 --sort modified- $@"
|
||||||
|
|
||||||
|
# Edit the notes selected interactively among the notes created the last two weeks.
|
||||||
|
# This alias doesn't take any argument, so we don't use $@.
|
||||||
|
#recent = "zk edit --sort created- --created-after 'last two weeks' --interactive"
|
||||||
|
|
||||||
|
# Print paths separated with colons for the notes found with the given
|
||||||
|
# arguments. This can be useful to expand a complex search query into a flag
|
||||||
|
# taking only paths. For example:
|
||||||
|
# zk list --link-to "`zk path -m potatoe`"
|
||||||
|
#path = "zk list --quiet --format {{path}} --delimiter , $@"
|
||||||
|
|
||||||
|
# Show a random note.
|
||||||
|
#lucky = "zk list --quiet --format full --sort random --limit 1"
|
||||||
|
|
||||||
|
# Returns the Git history for the notes found with the given arguments.
|
||||||
|
# Note the use of a pipe and the location of $@.
|
||||||
|
#hist = "zk list --format path --delimiter0 --quiet $@ | xargs -t -0 git log --patch --"
|
||||||
|
|
||||||
|
# Edit this configuration file.
|
||||||
|
#conf = '$EDITOR "$ZK_NOTEBOOK_DIR/.zk/config.toml"'
|
@ -0,0 +1,3 @@
|
|||||||
|
# {{title}}
|
||||||
|
|
||||||
|
{{content}}
|
@ -1,2 +0,0 @@
|
|||||||
permalink: /:title
|
|
||||||
theme: jekyll-theme-modernist
|
|
@ -1,57 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="{{ site.lang | default: "en-US" }}">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
|
|
||||||
{% seo %}
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
|
|
||||||
<script src="{{ '/assets/js/scale.fix.js' | relative_url }}"></script>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="wrapper">
|
|
||||||
<header {% unless site.description or site.github.project_tagline %} class="without-description" {% endunless %}>
|
|
||||||
<h1><a href="https://mickael-menu.github.io/zk/">{{ site.title | default: site.github.repository_name }}</a></h1>
|
|
||||||
{% if site.description or site.github.project_tagline %}
|
|
||||||
<p>{{ site.description | default: site.github.project_tagline }}</p>
|
|
||||||
{% endif %}
|
|
||||||
<p class="view"><a href="{{ site.github.repository_url }}">View the Project on GitHub <small>{{ github_name }}</small></a></p>
|
|
||||||
<ul>
|
|
||||||
{% if site.show_downloads %}
|
|
||||||
<li><a href="{{ site.github.zip_url }}">Download <strong>ZIP File</strong></a></li>
|
|
||||||
<li><a href="{{ site.github.tar_url }}">Download <strong>TAR Ball</strong></a></li>
|
|
||||||
{% endif %}
|
|
||||||
<li><a href="{{ site.github.repository_url }}">View On <strong>GitHub</strong></a></li>
|
|
||||||
</ul>
|
|
||||||
</header>
|
|
||||||
<section>
|
|
||||||
|
|
||||||
{{ content }}
|
|
||||||
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
{% if site.github.is_project_page %}
|
|
||||||
<p>Project maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a></p>
|
|
||||||
{% endif %}
|
|
||||||
</footer>
|
|
||||||
<!--[if !IE]><script>fixScale(document);</script><![endif]-->
|
|
||||||
|
|
||||||
{% if site.google_analytics %}
|
|
||||||
<script>
|
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
||||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
||||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
|
||||||
ga('create', '{{ site.google_analytics }}', 'auto');
|
|
||||||
ga('send', 'pageview');
|
|
||||||
</script>
|
|
||||||
{% endif %}
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
---
|
|
||||||
|
|
||||||
@import "{{ site.theme }}";
|
|
||||||
|
|
||||||
code, pre {
|
|
||||||
font-size: inherit;
|
|
||||||
}
|
|
||||||
|
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 167 KiB |
After Width: | Height: | Size: 3.9 KiB |
@ -1,10 +0,0 @@
|
|||||||
# Automating frequent tasks
|
|
||||||
|
|
||||||
`zk` was designed with automation in mind and strive to be [a good Unix citizen](https://en.wikipedia.org/wiki/Unix_philosophy). As such, it offers a number of ways to interface with other programs:
|
|
||||||
|
|
||||||
* write [command aliases](config-alias.md) or [named filters](config-filter.md) for repeated complex commands
|
|
||||||
* [call `zk` from other programs](external-call.md)
|
|
||||||
* [send notes for processing by other programs](external-processing.md)
|
|
||||||
* [create a note with initial content](note-creation.md) from a standard input pipe
|
|
||||||
|
|
||||||
If you find out that `zk` does not behave as expected or could communicate better with other programs, [please post an issue](https://github.com/mickael-menu/zk/issues).
|
|
@ -0,0 +1,30 @@
|
|||||||
|
# Configuration file for the Sphinx documentation builder.
|
||||||
|
#
|
||||||
|
# For the full list of built-in configuration values, see the documentation:
|
||||||
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||||
|
|
||||||
|
# -- Project information -----------------------------------------------------
|
||||||
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
||||||
|
|
||||||
|
project = "zk"
|
||||||
|
copyright = "2024, zk-org"
|
||||||
|
author = "zk-org"
|
||||||
|
release = "0.14.1"
|
||||||
|
|
||||||
|
# -- General configuration ---------------------------------------------------
|
||||||
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
||||||
|
|
||||||
|
extensions = ["myst_parser"]
|
||||||
|
myst_enable_extensions = ["colon_fence", "html_image"]
|
||||||
|
suppress_warnings = ["myst.xref_missing", "myst.iref_ambiguous"]
|
||||||
|
|
||||||
|
templates_path = ["_templates"]
|
||||||
|
exclude_patterns = [".zk"]
|
||||||
|
|
||||||
|
|
||||||
|
# -- Options for HTML output -------------------------------------------------
|
||||||
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
||||||
|
|
||||||
|
html_theme = "furo"
|
||||||
|
# html_static_path = ["_static"]
|
||||||
|
master_doc = "index"
|
@ -1,43 +0,0 @@
|
|||||||
# Extra user variables
|
|
||||||
|
|
||||||
`zk` is opened for template context extension which can be useful when [creating new notes](note-creation.md), for example:
|
|
||||||
|
|
||||||
* expanding custom metadata (author, subject, etc.)
|
|
||||||
* modifying a [template](template.md)'s output dynamically depending on the value of an extra variable
|
|
||||||
|
|
||||||
## Static extra variables
|
|
||||||
|
|
||||||
You can declare static extra variables in the [configuration file](config.md)'s `[extra]` section. Each [note group](config-group.md) can have its own `[extra]` section, which may override values from the root section.
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[extra]
|
|
||||||
visibility = "public"
|
|
||||||
author = "Mickaël"
|
|
||||||
|
|
||||||
[group.journal.extra]
|
|
||||||
visibility = "private" # overrides
|
|
||||||
```
|
|
||||||
|
|
||||||
## Dynamic extra variables
|
|
||||||
|
|
||||||
Maybe more useful, you can provide additional extra variables dynamically to `zk new` from the command-line with `--extra`. Multiple variables can be separated by a comma `,`.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ zk new --extra author=Thomas
|
|
||||||
$ zk new --extra show-header=1,author=Thomas
|
|
||||||
```
|
|
||||||
|
|
||||||
## Using extra variables in templates
|
|
||||||
|
|
||||||
After declaring extra variables, you can expand them inside the [template used when creating new notes](template-creation.md), using the usual [Handlebars syntax](template.md).
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
# {{title}}
|
|
||||||
|
|
||||||
Written by {{extra.author}}.
|
|
||||||
|
|
||||||
{{#if extra.show-header}}
|
|
||||||
Behold, the mighty dynamic header!
|
|
||||||
{{/if}}
|
|
||||||
```
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
|||||||
# Note group
|
|
||||||
|
|
||||||
A *group* is a named [configuration section](config.md) used to override [note creation rules](config-note.md) for specific directories. This allows you to use your [notebook](notebook.md) very differently depending on the type of note created. For a practical example, take a look at [maintaining a daily journal](daily-journal.md).
|
|
||||||
|
|
||||||
## Declaring a new group
|
|
||||||
|
|
||||||
To add a new group to your configuration file, declare a new `[group.<name>]` section. It takes a single optional property `paths`, which is the list of directories belonging to this group.
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[group.journal]
|
|
||||||
paths = [
|
|
||||||
"journal/daily",
|
|
||||||
"journal/weekly"
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also use [glob patterns](https://en.wikipedia.org/wiki/Glob_\(programming\)) in `paths`.
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[group.journal]
|
|
||||||
paths = ["journal/*"]
|
|
||||||
```
|
|
||||||
|
|
||||||
If you omit `paths`, the directory named after the group will be inferred. Note the double quotes when using spaces or slashes for subdirectories.
|
|
||||||
|
|
||||||
```toml
|
|
||||||
# This will automatically apply to the `citations/web` directory
|
|
||||||
[group."citations/web"]
|
|
||||||
```
|
|
||||||
|
|
||||||
## Overriding note configuration and extra variables
|
|
||||||
|
|
||||||
You can override the global [note configuration](config-note.md) and [extra user variables](config-extra.md) for a given group.
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[group.journal.note]
|
|
||||||
filename = "{{date now}}"
|
|
||||||
template = "journal.md"
|
|
||||||
|
|
||||||
[group.journal.extra]
|
|
||||||
author = "Mickaël"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Choose a group dynamically
|
|
||||||
|
|
||||||
If you prefer to keep multiple groups in a single directory, you can specify which group to use when creating a new note explicitly.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ zk new --group journal
|
|
||||||
```
|
|
@ -0,0 +1,48 @@
|
|||||||
|
# Extra user variables
|
||||||
|
|
||||||
|
`zk` is opened for template context extension which can be useful when
|
||||||
|
[creating new notes](../notes/note-creation.md), for example:
|
||||||
|
|
||||||
|
- expanding custom metadata (author, subject, etc.)
|
||||||
|
- modifying a [template](../notes/template.md)'s output dynamically depending on the
|
||||||
|
value of an extra variable
|
||||||
|
|
||||||
|
## Static extra variables
|
||||||
|
|
||||||
|
You can declare static extra variables in the [configuration file](config.md)'s
|
||||||
|
`[extra]` section. Each [note group](config-group.md) can have its own `[extra]`
|
||||||
|
section, which may override values from the root section.
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[extra]
|
||||||
|
visibility = "public"
|
||||||
|
author = "Mickaël"
|
||||||
|
|
||||||
|
[group.journal.extra]
|
||||||
|
visibility = "private" # overrides
|
||||||
|
```
|
||||||
|
|
||||||
|
## Dynamic extra variables
|
||||||
|
|
||||||
|
Maybe more useful, you can provide additional extra variables dynamically to
|
||||||
|
`zk new` from the command-line with `--extra`. Multiple variables can be
|
||||||
|
separated by a comma `,`.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk new --extra author=Thomas
|
||||||
|
$ zk new --extra show-header=1,author=Thomas
|
||||||
|
```
|
||||||
|
|
||||||
|
## Using extra variables in templates
|
||||||
|
|
||||||
|
After declaring extra variables, you can expand them inside the
|
||||||
|
[template used when creating new notes](../notes/template-creation.md), using the usual
|
||||||
|
[Handlebars syntax](../notes/template.md).
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
# {{title}}
|
||||||
|
|
||||||
|
Written by {{extra.author}}.
|
||||||
|
|
||||||
|
{{#if extra.show-header}} Behold, the mighty dynamic header! {{/if}}
|
||||||
|
```
|
@ -0,0 +1,60 @@
|
|||||||
|
# Note group
|
||||||
|
|
||||||
|
A _group_ is a named [configuration section](config.md) used to override
|
||||||
|
[note creation rules](config-note.md) for specific directories. This allows you
|
||||||
|
to use your [notebook](../notes/notebook.md) very differently depending on the type of
|
||||||
|
note created. For a practical example, take a look at
|
||||||
|
[maintaining a daily journal](../tips/daily-journal.md).
|
||||||
|
|
||||||
|
## Declaring a new group
|
||||||
|
|
||||||
|
To add a new group to your configuration file, declare a new `[group.<name>]`
|
||||||
|
section. It takes a single optional property `paths`, which is the list of
|
||||||
|
directories belonging to this group.
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[group.journal]
|
||||||
|
paths = [
|
||||||
|
"journal/daily",
|
||||||
|
"journal/weekly"
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also use
|
||||||
|
[glob patterns](https://en.wikipedia.org/wiki/Glob_(programming)) in `paths`.
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[group.journal]
|
||||||
|
paths = ["journal/*"]
|
||||||
|
```
|
||||||
|
|
||||||
|
If you omit `paths`, the directory named after the group will be inferred. Note
|
||||||
|
the double quotes when using spaces or slashes for subdirectories.
|
||||||
|
|
||||||
|
```toml
|
||||||
|
# This will automatically apply to the `citations/web` directory
|
||||||
|
[group."citations/web"]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Overriding note configuration and extra variables
|
||||||
|
|
||||||
|
You can override the global [note configuration](config-note.md) and
|
||||||
|
[extra user variables](config-extra.md) for a given group.
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[group.journal.note]
|
||||||
|
filename = "{{format-date now}}"
|
||||||
|
template = "journal.md"
|
||||||
|
|
||||||
|
[group.journal.extra]
|
||||||
|
author = "Mickaël"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Choose a group dynamically
|
||||||
|
|
||||||
|
If you prefer to keep multiple groups in a single directory, you can specify
|
||||||
|
which group to use when creating a new note explicitly.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk new --group journal
|
||||||
|
```
|
@ -0,0 +1,17 @@
|
|||||||
|
# Notebook configuration
|
||||||
|
|
||||||
|
The `[notebook]` section from the [configuration file](config.md) is used to set
|
||||||
|
the default notebook directory. If the path starts with `~` it will be replaced
|
||||||
|
with the user home directory (`$HOME`). This property also supports environment
|
||||||
|
variables.
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[notebook]
|
||||||
|
dir = "~/notebook" # same as "$HOME/notebook"
|
||||||
|
```
|
||||||
|
|
||||||
|
The following properties are customizable:
|
||||||
|
|
||||||
|
- `dir` (string)
|
||||||
|
- Path of the default notebook.
|
||||||
|
- Only available in the global config file (`~/.config/zk/config.toml`).
|
@ -0,0 +1,16 @@
|
|||||||
|
Configuration
|
||||||
|
=============
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:glob:
|
||||||
|
:maxdepth: 3
|
||||||
|
|
||||||
|
The config file <config>
|
||||||
|
Notebook <config-notebook>
|
||||||
|
Notes <config-note>
|
||||||
|
Groups <config-group>
|
||||||
|
Aliases <config-alias>
|
||||||
|
Filters <config-filter>
|
||||||
|
LSP <config-lsp>
|
||||||
|
Extra <config-extra>
|
||||||
|
Tools <tools>
|
@ -0,0 +1,17 @@
|
|||||||
|
# Setting your default editor
|
||||||
|
|
||||||
|
`zk` is not a text editor. Instead, it is designed to interface with your
|
||||||
|
favorite editor to write your notes.
|
||||||
|
|
||||||
|
You can customize which editor to use either from the
|
||||||
|
[configuration file](config.md) or environment variables. In order of
|
||||||
|
precedence, `zk` will use:
|
||||||
|
|
||||||
|
1. `ZK_EDITOR` environment variable
|
||||||
|
2. `editor` configuration property
|
||||||
|
```toml
|
||||||
|
[tool]
|
||||||
|
editor = "vim"
|
||||||
|
```
|
||||||
|
3. `VISUAL` environment variable
|
||||||
|
4. `EDITOR` environment variable
|
@ -0,0 +1,21 @@
|
|||||||
|
# Setting your default pager
|
||||||
|
|
||||||
|
When `zk`'s output exceeds a certain limit, it is automatically paginated by
|
||||||
|
your system pager. By default, `less` is used but you may set up your own pager
|
||||||
|
in the [configuration file](config.md) or environment variables. In order of
|
||||||
|
precedence, `zk` will use:
|
||||||
|
|
||||||
|
1. `ZK_PAGER` environment variable
|
||||||
|
2. `pager` configuration property
|
||||||
|
```toml
|
||||||
|
[tool]
|
||||||
|
pager = "less -FIRX"
|
||||||
|
```
|
||||||
|
3. `PAGER` environment variable
|
||||||
|
|
||||||
|
## Disable the pager
|
||||||
|
|
||||||
|
If you need to disable paging, you can either:
|
||||||
|
|
||||||
|
- use `--no-pager`
|
||||||
|
- set the `pager` configuration property to an empty string `""`
|
@ -0,0 +1,16 @@
|
|||||||
|
# Setting your default shell
|
||||||
|
|
||||||
|
This is _currently_ not supported on Windows (that defaults always to `cmd`).
|
||||||
|
|
||||||
|
You can customize which shell to use to run aliases and commands either from the
|
||||||
|
[configuration file](config.md) or environment variables. In order of
|
||||||
|
precedence, `zk` will use:
|
||||||
|
|
||||||
|
1. `ZK_SHELL` environment variable
|
||||||
|
2. `shell` configuration property
|
||||||
|
```toml
|
||||||
|
[tool]
|
||||||
|
shell = "/bin/bash"
|
||||||
|
```
|
||||||
|
3. `SHELL` environment variable
|
||||||
|
4. `sh` as fallback
|
@ -0,0 +1,13 @@
|
|||||||
|
Tools
|
||||||
|
=====
|
||||||
|
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:glob:
|
||||||
|
:maxdepth: 3
|
||||||
|
|
||||||
|
fzf <tool-fzf>
|
||||||
|
Pager <tool-pager>
|
||||||
|
Editor <tool-editor>
|
||||||
|
Shell <tool-shell>
|
||||||
|
|
@ -1,45 +0,0 @@
|
|||||||
# Maintaining a daily journal
|
|
||||||
|
|
||||||
Let's assume you want to write daily notes named like `2021-02-16.md` in a `journal/daily` sub-directory. This common use case is a good fit for creating a [note group](config-group.md) overriding the default [note creation](note-creation.md) settings.
|
|
||||||
|
|
||||||
First, create a `group` entry in the [configuration file](config.md) to set the note settings for this directory. Refer to the [template syntax reference](template.md) to understand how to use the `{{date}}` helper.
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[group.daily]
|
|
||||||
# Directories listed here will automatically use this group when creating notes.
|
|
||||||
paths = ["journal/daily"]
|
|
||||||
|
|
||||||
[group.daily.note]
|
|
||||||
# %Y-%m-%d is actually the default format, so you could use {{date now}} instead.
|
|
||||||
filename = "{{date now '%Y-%m-%d'}}"
|
|
||||||
extension = "md"
|
|
||||||
template = "daily.md"
|
|
||||||
```
|
|
||||||
|
|
||||||
Next, create a template file under `.zk/templates/daily.md` to render the note content. Here we used the date again to generate a title like "February 16, 2021".
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
# {{date now "long"}}
|
|
||||||
|
|
||||||
What did I do today?
|
|
||||||
```
|
|
||||||
|
|
||||||
We are now ready to write today's note! We don't need to set `--title` since the note's title is entirely generated by the template.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ zk new journal/daily
|
|
||||||
```
|
|
||||||
|
|
||||||
That is a bit of a mouthful for a command called every day. Would it not be better to just write `zk daily`? We can, by defining a [command alias](config-alias.md) in the [configuration file](config.md).
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[alias]
|
|
||||||
daily = 'zk new --no-input "$ZK_NOTEBOOK_DIR/journal/daily"'
|
|
||||||
```
|
|
||||||
|
|
||||||
Let's unpack this alias:
|
|
||||||
|
|
||||||
* `zk new` will refuse to overwrite notes. If you already created today's note, it will instead ask you if you wish to edit it. Using `--no-input` skips the prompt and edit the existing note right away.
|
|
||||||
* `$ZK_NOTEBOOK_DIR` is set to the absolute path of the current [notebook](notebook.md) when running an alias. Using it allows you to run `zk daily` no matter where you are in the notebook folder hierarchy.
|
|
||||||
* We need to use double quotes around `$ZK_NOTEBOOK_DIR`, otherwise it will not be expanded.
|
|
||||||
|
|
@ -1,233 +0,0 @@
|
|||||||
# Editors integration
|
|
||||||
|
|
||||||
There are several extensions available to integrate `zk` in your favorite editor:
|
|
||||||
|
|
||||||
* [`zk.nvim`](https://github.com/megalithic/zk.nvim) for Neovim 0.5+, maintained by [Seth Messer](https://github.com/megalithic)
|
|
||||||
* [`zk-vscode`](https://github.com/mickael-menu/zk-vscode) for Visual Studio Code
|
|
||||||
|
|
||||||
## Language Server Protocol
|
|
||||||
|
|
||||||
`zk` ships with a [Language Server](https://microsoft.github.io/language-server-protocol/overviews/lsp/overview/) to provide basic support for any LSP-compatible editor. The currently supported features are:
|
|
||||||
|
|
||||||
* Auto-complete Markdown links with `[[` (setup wiki-links in the [note formats configuration](note-format.md))
|
|
||||||
* Auto-complete [hashtags and colon-separated tags](tags.md).
|
|
||||||
* Preview the content of a note when hovering a link.
|
|
||||||
* Navigate in your notes by following internal links.
|
|
||||||
* Create a new note using the current selection as title.
|
|
||||||
* Diagnostics for dead links and wiki-links titles.
|
|
||||||
* [And more to come...](https://github.com/mickael-menu/zk/issues/22)
|
|
||||||
|
|
||||||
You can configure some of these features in your notebook's [configuration file](config-lsp.md).
|
|
||||||
|
|
||||||
### Editor LSP configurations
|
|
||||||
|
|
||||||
To start the Language Server, use the `zk lsp` command. Refer to the following sections for editor-specific examples. [Feel free to share the configuration for your editor](https://github.com/mickael-menu/zk/issues/22).
|
|
||||||
|
|
||||||
#### Vim and Neovim
|
|
||||||
|
|
||||||
##### Vim and Neovim 0.4
|
|
||||||
|
|
||||||
With [`coc.nvim`](https://github.com/neoclide/coc.nvim), run `:CocConfig` and add the following in the settings file:
|
|
||||||
|
|
||||||
<details><summary><tt>coc-settings.json</tt></summary>
|
|
||||||
|
|
||||||
```jsonc
|
|
||||||
{
|
|
||||||
// Important, otherwise link completion containing spaces and other special characters won't work.
|
|
||||||
"suggest.invalidInsertCharacters": [],
|
|
||||||
|
|
||||||
"languageserver": {
|
|
||||||
"zk": {
|
|
||||||
"command": "zk",
|
|
||||||
"args": ["lsp"],
|
|
||||||
"trace.server": "messages",
|
|
||||||
"filetypes": ["markdown"]
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
|
|
||||||
Here are some additional useful key bindings and custom commands:
|
|
||||||
|
|
||||||
<details><summary><tt>~/.config/nvim/init.vim</tt></summary>
|
|
||||||
|
|
||||||
```viml
|
|
||||||
" User command to index the current notebook.
|
|
||||||
"
|
|
||||||
" zk.index expects a notebook path as first argument, so we provide the current
|
|
||||||
" buffer path with expand("%:p").
|
|
||||||
command! -nargs=0 ZkIndex :call CocAction("runCommand", "zk.index", expand("%:p"))
|
|
||||||
nnoremap <leader>zi :ZkIndex<CR>
|
|
||||||
|
|
||||||
" User command to create and open a new note, to be called like this:
|
|
||||||
" :ZkNew {"title": "An interesting subject", "dir": "inbox", ...}
|
|
||||||
"
|
|
||||||
" Note the concatenation with the "edit" command to open the note right away.
|
|
||||||
command! -nargs=? ZkNew :exec "edit ".CocAction("runCommand", "zk.new", expand("%:p"), <args>).path
|
|
||||||
|
|
||||||
" Create a new note after prompting for its title.
|
|
||||||
nnoremap <leader>zn :ZkNew {"title": input("Title: ")}<CR>
|
|
||||||
" Create a new note in the directory journal/daily.
|
|
||||||
nnoremap <leader>zj :ZkNew {"dir": "journal/daily"}<CR>
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
|
|
||||||
##### Neovim 0.5 built-in LSP client
|
|
||||||
|
|
||||||
Using [`nvim-lspconfig`](https://github.com/neovim/nvim-lspconfig):
|
|
||||||
|
|
||||||
<details><summary><tt>~/.config/nvim/init.lua</tt></summary>
|
|
||||||
|
|
||||||
```lua
|
|
||||||
local lspconfig = require('lspconfig')
|
|
||||||
local configs = require('lspconfig/configs')
|
|
||||||
|
|
||||||
configs.zk = {
|
|
||||||
default_config = {
|
|
||||||
cmd = {'zk', 'lsp'},
|
|
||||||
filetypes = {'markdown'},
|
|
||||||
root_dir = function()
|
|
||||||
return vim.loop.cwd()
|
|
||||||
end,
|
|
||||||
settings = {}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
lspconfig.zk.setup({ on_attach = function(client, buffer)
|
|
||||||
-- Add keybindings here, see https://github.com/neovim/nvim-lspconfig#keybindings-and-completion
|
|
||||||
end })
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
|
|
||||||
#### Sublime Text
|
|
||||||
|
|
||||||
Install the [Sublime LSP](https://github.com/sublimelsp/LSP) package, then run the **Preferences: LSP Settings** command. Add the following to the settings file:
|
|
||||||
|
|
||||||
<details><summary><tt>LSP.sublime-settings</tt></summary>
|
|
||||||
|
|
||||||
```jsonc
|
|
||||||
{
|
|
||||||
"clients": {
|
|
||||||
"zk": {
|
|
||||||
"enabled": true,
|
|
||||||
"command": ["zk", "lsp"],
|
|
||||||
"languageId": "markdown",
|
|
||||||
"scopes": [ "source.markdown" ],
|
|
||||||
"syntaxes": [ "Packages/MarkdownEditing/Markdown.sublime-syntax" ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
|
|
||||||
#### Visual Studio Code
|
|
||||||
|
|
||||||
Install the [`zk-vscode`](https://marketplace.visualstudio.com/items?itemName=mickael-menu.zk-vscode) extension from the Marketplace.
|
|
||||||
|
|
||||||
### Custom commands
|
|
||||||
|
|
||||||
Using `zk`'s LSP custom commands, you can call `zk` commands right from your editor. Please refer to your editor's documentation on how to bind keyboard shortcuts to custom LSP commands.
|
|
||||||
|
|
||||||
#### `zk.index`
|
|
||||||
|
|
||||||
This LSP command calls `zk index` to refresh your notebook's index. It can be useful to make sure that the auto-completion is up-to-date. `zk.index` takes two arguments:
|
|
||||||
|
|
||||||
1. A path to a file or directory in the notebook to index.
|
|
||||||
2. <details><summary>(Optional) A dictionary of additional options (click to expand)</summary>
|
|
||||||
|
|
||||||
| Key | Type | Description |
|
|
||||||
|---------|---------|-----------------------------------|
|
|
||||||
| `force` | boolean | Reindexes all the notes when true |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
`zk.index` returns a dictionary of indexing statistics.
|
|
||||||
|
|
||||||
#### `zk.new`
|
|
||||||
|
|
||||||
This LSP command calls `zk new` to create a new note. It can be useful to quickly create a new note with a key binding. `zk.new` takes two arguments:
|
|
||||||
|
|
||||||
1. A path to any file or directory in the notebook, to locate it.
|
|
||||||
2. <details><summary>(Optional) A dictionary of additional options (click to expand)</summary>
|
|
||||||
|
|
||||||
| Key | Type | Description |
|
|
||||||
|------------------------|----------------------|-------------------------------------------------------------------------------------------|
|
|
||||||
| `title` | string | Title of the new note |
|
|
||||||
| `content` | string | Initial content of the note |
|
|
||||||
| `dir` | string | Parent directory, relative to the root of the notebook |
|
|
||||||
| `group` | string | [Note configuration group](config-group.md) |
|
|
||||||
| `template` | string | [Custom template used to render the note](template-creation.md) |
|
|
||||||
| `extra` | dictionary | A dictionary of extra variables to expand in the template |
|
|
||||||
| `date` | string | A date of creation for the note in natural language, e.g. "tomorrow" |
|
|
||||||
| `edit` | boolean | When true, the editor will open the newly created note (**not supported by all editors**) |
|
|
||||||
| `insertLinkAtLocation` | location<sup>1</sup> | A location in another note where a link to the new note will be inserted |
|
|
||||||
|
|
||||||
The `location` type is an [LSP Location object](https://microsoft.github.io/language-server-protocol/specification#location), for example:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"uri":"file:///Users/mickael/notes/9se3.md",
|
|
||||||
"range": {
|
|
||||||
"end":{"line": 5, "character":149},
|
|
||||||
"start":{"line": 5, "character":137}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
|
|
||||||
`zk.new` returns a dictionary with the key `path` containing the absolute path to the newly created file.
|
|
||||||
|
|
||||||
#### `zk.list`
|
|
||||||
|
|
||||||
This LSP command calls `zk list` to search a notebook. It takes two arguments:
|
|
||||||
|
|
||||||
1. A path to any file or directory in the notebook, to locate it.
|
|
||||||
2. <details><summary>A dictionary of additional options (click to expand)</summary>
|
|
||||||
|
|
||||||
| Key | Type | Required? | Description |
|
|
||||||
|------------------|--------------|-----------|-------------------------------------------------------------------------|
|
|
||||||
| `select` | string array | Yes | List of note fields to return<sup>1</sup> |
|
|
||||||
| `hrefs` | string array | No | Find notes matching the given path, including its descendants |
|
|
||||||
| `limit` | integer | No | Limit the number of notes found |
|
|
||||||
| `match` | string | No | Terms to search for in the notes |
|
|
||||||
| `exactMatch` | boolean | No | Search for exact occurrences of the `match` argument (case insensitive) |
|
|
||||||
| `excludeHrefs` | string array | No | Ignore notes matching the given path, including its descendants |
|
|
||||||
| `tags` | string array | No | Find notes tagged with the given tags |
|
|
||||||
| `mention` | string array | No | Find notes mentioning the title of the given ones |
|
|
||||||
| `mentionedBy` | string array | No | Find notes whose title is mentioned in the given ones |
|
|
||||||
| `linkTo` | string array | No | Find notes which are linking to the given ones |
|
|
||||||
| `linkedBy` | string array | No | Find notes which are linked by the given ones |
|
|
||||||
| `orphan` | boolean | No | Find notes which are not linked by any other note |
|
|
||||||
| `related` | string array | No | Find notes which might be related to the given ones |
|
|
||||||
| `maxDistance` | integer | No | Maximum distance between two linked notes |
|
|
||||||
| `recursive` | boolean | No | Follow links recursively |
|
|
||||||
| `created` | string | No | Find notes created on the given date |
|
|
||||||
| `createdBefore` | string | No | Find notes created before the given date |
|
|
||||||
| `createdAfter` | string | No | Find notes created after the given date |
|
|
||||||
| `modified` | string | No | Find notes modified on the given date |
|
|
||||||
| `modifiedBefore` | string | No | Find notes modified before the given date |
|
|
||||||
| `modifiedAfter` | string | No | Find notes modified after the given date |
|
|
||||||
| `sort` | string array | No | Order the notes by the given criterion |
|
|
||||||
|
|
||||||
1. As the output of this command might be very verbose and put a heavy load on the LSP client, you need to explicitly set which note fields you want to receive with the `select` option. The following fields are available: `filename`, `filenameStem`, `path`, `absPath`, `title`, `lead`, `body`, `snippets`, `rawContent`, `wordCount`, `tags`, `metadata`, `created`, `modified` and `checksum`.
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
`zk.list` returns the found notes as a JSON array.
|
|
||||||
|
|
||||||
#### `zk.tag.list`
|
|
||||||
|
|
||||||
This LSP command calls `zk tag list` to return the list of tags in a notebook. It takes two arguments:
|
|
||||||
|
|
||||||
1. A path to any file or directory in the notebook, to locate it.
|
|
||||||
2. <details><summary>(Optional) A dictionary of additional options (click to expand)</summary>
|
|
||||||
|
|
||||||
| Key | Type | Required? | Description |
|
|
||||||
|--------|--------------|-----------|--------------------------------------------------|
|
|
||||||
| `sort` | string array | No | Order the tags by the given criteria<sup>1</sup> |
|
|
||||||
|
|
||||||
1. The available sort criteria are `name` and `note-count`. You can change the order by appending `-` or `+` to the criterion.
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
`zk.tag.list` returns the tags as a JSON array.
|
|
@ -1,5 +0,0 @@
|
|||||||
# A future-proof notebook
|
|
||||||
|
|
||||||
`zk` is designed to be future-proof and rely on simple [plain text formats](note-format.md) such as Markdown.
|
|
||||||
|
|
||||||
The shape of your [notebook](notebook.md) is entirely up to you, making `zk` flexible enough to be used in a variety of contexts. However, `zk` shines in a Zettelkasten-style notebook with many small interlinked notes.
|
|
@ -1,83 +0,0 @@
|
|||||||
# Getting started with `zk`
|
|
||||||
|
|
||||||
A short introduction showing how to use `zk`.
|
|
||||||
|
|
||||||
## Create a new notebook
|
|
||||||
|
|
||||||
Create a [notebook](notebook.md) to host your notes. You are free to organize your notebook as you want, adding subdirectories if needed.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ zk init my-notes
|
|
||||||
Initialized a notebook in my-notes
|
|
||||||
|
|
||||||
$ cd my-notes
|
|
||||||
```
|
|
||||||
|
|
||||||
## Create your first notes
|
|
||||||
|
|
||||||
Now you are ready to write your very first note. Pick a subject, [create a new note](note-creation.md) and write on!
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ zk new --title "An interesting concept"
|
|
||||||
```
|
|
||||||
|
|
||||||
You can customize your experience using [custom templates](template.md) to generate many kind of notes.
|
|
||||||
|
|
||||||
<div align="center"><img alt="Create a note" width="85%" src="assets/media/new1.svg"/></div>
|
|
||||||
|
|
||||||
If you are not sure whether a note already exists for a particular subject, the "search or create" mode might be more appropriate than `zk new`. It is inspired by [Notational Velocity](https://notational.net/) and enables searching for an existing note or creating a new one in a single action.
|
|
||||||
|
|
||||||
From `zk`'s interactive edit screen, press `Ctrl-E` to create a new note using the current search query as title.
|
|
||||||
|
|
||||||
<div align="center"><img alt="Create a note" width="85%" src="assets/media/new2.svg"/></div>
|
|
||||||
|
|
||||||
## List existing notes
|
|
||||||
|
|
||||||
After some time, hopefully you will have enough notes to be lost in it. Use `zk`'s powerful [filtering capabilities](note-filtering.md) to find the notes you need.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ zk list --tag "recipe" --match "pizza -pineapple"
|
|
||||||
```
|
|
||||||
<div align="center"><img alt="Format the list output" width="85%" src="assets/media/list.svg"/></div>
|
|
||||||
|
|
||||||
Sort the results however you need with `--sort`.
|
|
||||||
|
|
||||||
<div align="center"><img alt="Format the list output" width="85%" src="assets/media/list-sort.svg"/></div>
|
|
||||||
|
|
||||||
`--format` and `--delimiter` offer some versatile formatting options to customize the output.
|
|
||||||
|
|
||||||
<div align="center"><img alt="Format the list output" width="85%" src="assets/media/list-format.svg"/></div>
|
|
||||||
|
|
||||||
`zk` is aware of the links you set between your notes. You can use the linking options to find the backlinks or outbound links of a note. It even supports listing indirect links thanks to `--recursive`.
|
|
||||||
|
|
||||||
<div align="center"><img alt="Format the list output" width="85%" src="assets/media/list-link.svg"/></div>
|
|
||||||
|
|
||||||
`zk` supports an interactive mode powered by [`fzf`](https://github.com/junegunn/fzf) to further filter notes manually.
|
|
||||||
|
|
||||||
<div align="center"><img alt="Format the list output" width="85%" src="assets/media/list-interactive.svg"/></div>
|
|
||||||
|
|
||||||
## Edit existing notes
|
|
||||||
|
|
||||||
To edit notes with your default editor, use `zk edit`. It supports the same [filtering options](note-filtering.md) as `zk list`.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ zk edit --interactive --match "recipe pizza -pineapple"
|
|
||||||
|
|
||||||
# or with short flags
|
|
||||||
$ zk edit -i -m "recipe pizza -pineapple"
|
|
||||||
```
|
|
||||||
|
|
||||||
<div align="center"><img alt="Format the list output" width="85%" src="assets/media/edit.svg"/></div>
|
|
||||||
|
|
||||||
## Edit the configuration file
|
|
||||||
|
|
||||||
To customize your experience with `zk`, you may want to edit the [user configuration file](config.md).
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ vim .zk/config.toml
|
|
||||||
```
|
|
||||||
|
|
||||||
Declaring your own [aliases](config-alias.md) is a great way to make your experience with `zk` easier and more familiar.
|
|
||||||
|
|
||||||
<div align="center"><img alt="Format the list output" width="85%" src="assets/media/alias.svg"/></div>
|
|
||||||
|
|
@ -0,0 +1,78 @@
|
|||||||
|
.. image:: assets/media/zk-black-modern.png
|
||||||
|
:align: center
|
||||||
|
:width: 300px
|
||||||
|
|
||||||
|
.. image:: assets/media/screencast.svg
|
||||||
|
:align: center
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:hidden:
|
||||||
|
:titlesonly:
|
||||||
|
|
||||||
|
GitHub <https://github.com/zk-org/zk>
|
||||||
|
Neovim Plugin <https://github.com/zk-org/zk-nvim>
|
||||||
|
|
||||||
|
config/index
|
||||||
|
notes/index
|
||||||
|
tips/index
|
||||||
|
|
||||||
|
`zk` is a plain text note-taking tool that leverages the power of the command line.
|
||||||
|
|
||||||
|
Install as below and then... :doc:`get zettling <tips/getting-started>`!
|
||||||
|
|
||||||
|
Installation
|
||||||
|
============
|
||||||
|
|
||||||
|
Homebrew:
|
||||||
|
|
||||||
|
.. code-block:: sh
|
||||||
|
|
||||||
|
brew install zk
|
||||||
|
|
||||||
|
# Or, if you want to be on the bleeding edge:
|
||||||
|
brew install --HEAD zk
|
||||||
|
|
||||||
|
|
||||||
|
Nix:
|
||||||
|
|
||||||
|
.. code-block:: sh
|
||||||
|
|
||||||
|
# Run zk from Nix store without installing it:
|
||||||
|
nix run nixpkgs#zk
|
||||||
|
|
||||||
|
# Or, to install it permanently:
|
||||||
|
nix-env -iA zk
|
||||||
|
|
||||||
|
Alpine Linux:
|
||||||
|
|
||||||
|
.. code-block:: sh
|
||||||
|
|
||||||
|
# `zk` is currently available in the `testing` repositories:
|
||||||
|
apk add zk
|
||||||
|
|
||||||
|
Arch Linux:
|
||||||
|
|
||||||
|
You can install `the zk package <https://archlinux.org/packages/extra/x86_64/zk/>`_ from the official repos.
|
||||||
|
|
||||||
|
.. code-block:: sh
|
||||||
|
|
||||||
|
sudo pacman -S zk
|
||||||
|
|
||||||
|
Build from scratch:
|
||||||
|
|
||||||
|
Make sure you have a working `Go 1.21+ installation <https://golang.org/>`_, then clone the repository:
|
||||||
|
|
||||||
|
.. code-block:: sh
|
||||||
|
|
||||||
|
git clone https://github.com/zk-org/zk.git
|
||||||
|
cd zk
|
||||||
|
|
||||||
|
On macOS / Linux:
|
||||||
|
|
||||||
|
.. code-block:: sh
|
||||||
|
|
||||||
|
make
|
||||||
|
./zk -h
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
|||||||
# Creating a new note
|
|
||||||
|
|
||||||
You can add a new note to a [notebook](notebook.md) using `zk new --title "An interesting concept" [<directory>]`.
|
|
||||||
|
|
||||||
`zk` automatically generates a filename and initial content according to rules set in your [configuration file](config.md). These settings can be customized per [group of notes](config-group.md) in your notebook, as illustrated in [Maintaining a daily journal](daily-journal.md).
|
|
||||||
|
|
||||||
By default, `zk new` will start [your editor](tool-editor.md) after creating the note. You can choose instead to print the absolute path to the note with `--print-path`, which is more useful for [automation](automation.md).
|
|
||||||
|
|
||||||
## Search or create with a single command
|
|
||||||
|
|
||||||
If you are not sure whether a note already exists for a particular subject, the "search or create" mode might be more appropriate than `zk new`. It is inspired by [Notational Velocity](https://notational.net/) and enables searching for an existing note or creating a new one in a single action.
|
|
||||||
|
|
||||||
This option is available when running `zk edit --interactive`, which spawns [`fzf`](tool-fzf.md) to filter selected notes. From `fzf`, press `Ctrl-E` to create a new note using the current search query as title.
|
|
||||||
|
|
||||||
## Create a note with initial content
|
|
||||||
|
|
||||||
Initial content can be fed to the template through a standard input pipe, which will be expandable with the `{{content}}` [template variable](template-creation.md).
|
|
||||||
|
|
||||||
For example, to use the content of the macOS clipboard as the initial content you can run:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ pbpaste | zk new
|
|
||||||
```
|
|
||||||
|
|
@ -1,267 +0,0 @@
|
|||||||
# Searching and filtering notes
|
|
||||||
|
|
||||||
A few commands are built upon `zk`'s powerful note filtering capabilities, such as `edit` and `list`. They accept any option described here. You may also declare [named filters](config-filter.md) in the [configuration file](config.md) for the same set of options you use frequently.
|
|
||||||
|
|
||||||
## Filter by path
|
|
||||||
|
|
||||||
All filtering commands take for unique positional argument a list of paths. When set, only the notes matching the given paths will be returned.
|
|
||||||
|
|
||||||
You can use it to find all the notes in a directory.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ zk list journal/daily journal/weekly
|
|
||||||
```
|
|
||||||
|
|
||||||
Or specific notes.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ zk edit 200911172034-an-interesting-concept.md
|
|
||||||
```
|
|
||||||
|
|
||||||
It works fine with only a path prefix as well. This is useful when you have a [note ID](note-id.md) prefix, but not the full file path.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ zk edit 200911172034
|
|
||||||
```
|
|
||||||
|
|
||||||
These rules apply to all the following options, when they expect a `<path>` parameter.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ zk list --link-to 200911172034
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also use a nested `zk` command to pre-filter paths to feed to an option with a `<path>` argument. [See the `inline` command alias example](config-alias.md) for more explanation.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# List the notes which have at least one link pointing to them (i.e. not orphans).
|
|
||||||
$ zk list --exclude "`zk inline --orphan`"
|
|
||||||
|
|
||||||
# List the notes which are linked by at least one note from the journal/ directory.
|
|
||||||
$ zk list --linked-by "`zk inline journal`"
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Search the title or body
|
|
||||||
|
|
||||||
Use `--match <query>` (or `-m`) to search through the title and body of notes.
|
|
||||||
|
|
||||||
The search is powered by a [full-text search](https://en.wikipedia.org/wiki/Full-text_search) database enabling near-instant results. Queries are not case-sensitive and terms are tokenized, which means that searching for `create` will also match `created` and `creating`.
|
|
||||||
|
|
||||||
A syntax similar to Google Search is available for advanced search queries.
|
|
||||||
|
|
||||||
### Combining terms
|
|
||||||
|
|
||||||
By default, the search engine will find the notes containing all the terms in the query, in any order.
|
|
||||||
|
|
||||||
```
|
|
||||||
"tesla edison"
|
|
||||||
```
|
|
||||||
|
|
||||||
If you want to find the notes containing any or both of the terms, put `OR` (all caps) or a pipe `|` between them.
|
|
||||||
|
|
||||||
```
|
|
||||||
"tesla OR edison"
|
|
||||||
"tesla | edison"
|
|
||||||
```
|
|
||||||
|
|
||||||
Search for an exact phrase by surrounding it with double quotes. In this case, you will need to single quote the full query if you do not want to escape the double quotes.
|
|
||||||
|
|
||||||
```
|
|
||||||
'tesla "alternating current"'
|
|
||||||
```
|
|
||||||
|
|
||||||
To construct more complex queries, you can group sub-queries with parentheses.
|
|
||||||
|
|
||||||
```
|
|
||||||
"current (tesla OR edison)"
|
|
||||||
```
|
|
||||||
|
|
||||||
Finally, you can filter out results by excluding a term with `NOT` (all caps) or a `-` prefix.
|
|
||||||
|
|
||||||
```
|
|
||||||
"tesla NOT car"
|
|
||||||
"tesla -car"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Search in specific fields
|
|
||||||
|
|
||||||
If you want to search only in the title or body of notes, prefix a query with `title:` or `body:`.
|
|
||||||
|
|
||||||
```
|
|
||||||
"title: tesla"
|
|
||||||
"body: (tesla OR edison)"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Prefix terms
|
|
||||||
|
|
||||||
Match any term beginning with the given prefix with a wildcard `*`.
|
|
||||||
|
|
||||||
```
|
|
||||||
"edi*"
|
|
||||||
```
|
|
||||||
|
|
||||||
Prefixing a query with `^` will match notes whose title or body start with the following term.
|
|
||||||
|
|
||||||
```
|
|
||||||
"title: ^journal"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Search for special characters
|
|
||||||
|
|
||||||
If you need to find patterns containing special characters, such as an `email@addre.ss` or a `[[wiki-link]]`, use the `--exact-match` / `-e` option. The search will be case-insensitive.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ zk list --exact-match --match "[[link]]"
|
|
||||||
$ zk list -em "[[link]]"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Filter by tags
|
|
||||||
|
|
||||||
You can filter your notes by their [tags](tags.md) using `--tags` (or `-t`).
|
|
||||||
|
|
||||||
Find the notes having several tags by separating them with a comma.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ zk list --tag "history, europe"
|
|
||||||
```
|
|
||||||
|
|
||||||
To match notes having either or both tags, use a pipe `|` or `OR` (all caps).
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ zk list --tag "inbox OR todo"
|
|
||||||
```
|
|
||||||
|
|
||||||
If you want to exclude notes having a particular tag instead, prefix it with `-` or `NOT` (all caps).
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ zk list --tag "NOT done"
|
|
||||||
```
|
|
||||||
|
|
||||||
Your shell might give you some trouble using the `-` prefix. You can quote it and add an extra space as a workaround, e.g. `--tag " -done"`.
|
|
||||||
|
|
||||||
Finally, you can use glob patterns to match multiple tags. This is particularly useful if you use a separator (e.g. `/`) to group multiple tags under a parent tag.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ zk list --tag "year/201*"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Filter by creation or modification date
|
|
||||||
|
|
||||||
To find notes created or modified on a specific day, use `--created <date>` and `--modified <date>`. They accept a human-friendly date for argument.
|
|
||||||
|
|
||||||
```
|
|
||||||
--created yesterday
|
|
||||||
--created "last tuesday"
|
|
||||||
--modified "Feb 3"
|
|
||||||
```
|
|
||||||
|
|
||||||
You can filter by range instead, using `--created-before`, `--created-after`, `--modified-before` and `--modified-after`.
|
|
||||||
|
|
||||||
```
|
|
||||||
--created-before 10am
|
|
||||||
--modified-after 2021
|
|
||||||
--created-after "last monday" --created-before yesterday
|
|
||||||
```
|
|
||||||
|
|
||||||
## Explore links
|
|
||||||
|
|
||||||
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 200911172034
|
|
||||||
--link-to 200911172034
|
|
||||||
```
|
|
||||||
|
|
||||||
These options stop at the first level by default. But you can explore the whole web by adding the `--recursive` (or `-r`) option to find all the notes leading to (or from) a given note. If you feel overwhelmed, limit the distance between two notes with `--max-distance <count>`.
|
|
||||||
|
|
||||||
```
|
|
||||||
--linked-by 200911172034 --recursive --max-distance 3
|
|
||||||
```
|
|
||||||
|
|
||||||
Finally, it can be useful to see which notes have no links pointing to them at all. You can use the `--orphan` option for this.
|
|
||||||
|
|
||||||
## Find related notes
|
|
||||||
|
|
||||||
Part of writing a great notebook is to establish links between related notes. The `--related <path>` option can help by listing results having a linked note in common, but not yet connected to the note.
|
|
||||||
|
|
||||||
```
|
|
||||||
--related 200911172034
|
|
||||||
```
|
|
||||||
|
|
||||||
## Locate mentions of other notes
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
```
|
|
||||||
--mentioned-by 200911172034
|
|
||||||
```
|
|
||||||
|
|
||||||
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).
|
|
||||||
|
|
||||||
```
|
|
||||||
---
|
|
||||||
title: Artificial Intelligence
|
|
||||||
aliases: [AI, robot]
|
|
||||||
---
|
|
||||||
```
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
```
|
|
||||||
--mentioned-by 200911172034 --no-linked-by 200911172034
|
|
||||||
--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.
|
|
||||||
|
|
||||||
```
|
|
||||||
-x journal
|
|
||||||
```
|
|
||||||
|
|
||||||
## Limit the number of results
|
|
||||||
|
|
||||||
If you are only interested into the first few notes, limit the number of results with `--limit <count>` (or `-n`).
|
|
||||||
|
|
||||||
```
|
|
||||||
--limit 20
|
|
||||||
```
|
|
||||||
|
|
||||||
Using `-n1` is particularly common when you are expecting only a single result.
|
|
||||||
|
|
||||||
## Interactive filtering
|
|
||||||
|
|
||||||
A common search flow is to reduce the search scope using `zk`'s filtering options, before selecting manually the notes to process among them. This is especially useful with `zk edit` to avoid opening many unwanted notes with your editor.
|
|
||||||
|
|
||||||
Use `--interactive` (or `-i`) to select filtered notes manually. The interactive selection is handled by [`fzf`](tool-fzf.md) which brings a powerful fuzzy matching search into the mix.
|
|
||||||
|
|
||||||
## Sort the results
|
|
||||||
|
|
||||||
After finding matching notes, it might be useful to sort them before processing. The `--sort <criteria>` (or `-s`) option is made for that.
|
|
||||||
|
|
||||||
You can add a `+` (ascending) or `-` (descending) suffix to a sort criterion to customize the order. Each criterion has a sensible intrinsic order by default.
|
|
||||||
|
|
||||||
```
|
|
||||||
--sort path
|
|
||||||
--sort created+
|
|
||||||
-st- (eq. --sort title-)
|
|
||||||
```
|
|
||||||
|
|
||||||
| Criterion | Shortcut | Order | Description |
|
|
||||||
|--------------|----------|-------|------------------------------------|
|
|
||||||
| `created` | `c` | `-` | Creation date |
|
|
||||||
| `modified` | `m` | `-` | Modification date |
|
|
||||||
| `path` | `p` | `+` | File path relative to the notebook |
|
|
||||||
| `title` | `t` | `+` | Note title |
|
|
||||||
| `random` | `r` | `+` | Order notes randomly |
|
|
||||||
| `word-count` | `wc` | `+` | Word count in the note |
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
|||||||
# Note ID
|
|
||||||
|
|
||||||
Each note is uniquely identified by its path relative to the [notebook](notebook.md)'s root. However, in some cases it is more convenient to refer to a "note ID", which is the unique part of its filename. For example, the note ID of the file `200911172034 An interesting concept.md` is `200911172034`. You could have several notes named "An interesting concept", but only one with the ID `200911172034`.
|
|
||||||
|
|
||||||
The purpose of using a unique identifier in your note filenames is to create stable links between your notes, which will not break even if you change the title of the linked note. [See this reference for more information](https://zettelkasten.de/introduction/#the-unique-identifier).
|
|
||||||
|
|
||||||
There are several flavors of note IDs and `zk` supports most of them. You can set it up in the [note configuration](config-note.md).
|
|
||||||
|
|
||||||
## Random ID
|
|
||||||
|
|
||||||
A random ID enables short and memorable unique identifiers. By default, `zk` is configured to generate random IDs of four alphanumeric characters. I found this to be the sweet spot between an easily memorable and usable ID and enough candidates. This default setting can generate 1 679 616 unique IDs.
|
|
||||||
|
|
||||||
## Timestamp
|
|
||||||
|
|
||||||
Another common ID is a timestamp in the `YYYYMMDDHHMM` shape. This is less readable than a short random ID, but has the added advantage of being sortable by creation date. However, I find this not so useful in practice.
|
|
||||||
|
|
||||||
## Sequential IDs
|
|
||||||
|
|
||||||
Sequential (incremented) IDs are currently not supported by `zk`. They get ugly very quickly when deleting outdated notes and have an irregular shape.
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
# Notebook
|
|
||||||
|
|
||||||
A *notebook* is a directory containing a collection of notes managed by `zk`. Notebooks cannot be nested, but you are free to organize your notes in subdirectories.
|
|
||||||
|
|
||||||
To create a new notebook, simply run `zk init [<directory>]`.
|
|
||||||
|
|
||||||
Most `zk` commands are operating "Git-style" on the notebook containing the current working directory (or one of its parents). However, you can explicitly set which notebook to use with `--notebook-dir` or the `ZK_NOTEBOOK_DIR` environment variable. Setting `ZK_NOTEBOOK_DIR` in your shell configuration (e.g. `~/.profile`) can be used to define a default notebook which `zk` commands will use when the working directory is not in another notebook.
|
|
||||||
|
|
||||||
## Anatomy of a notebook
|
|
||||||
|
|
||||||
Similarly to Git, a notebook is identified by the presence of a `.zk` directory at its root. This directory contains the only `zk`-specific files in your notebook:
|
|
||||||
|
|
||||||
* `.zk/config.toml` is the user [configuration file](config.md)
|
|
||||||
* `.zk/templates/` contains [user templates](template.md) used when [creating new notes](note-creation.md)
|
|
||||||
* `.zk/notebook.db` is the SQLite database enabling [powerful search features](note-filtering.md).
|
|
@ -0,0 +1,16 @@
|
|||||||
|
Notes
|
||||||
|
=====
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:glob:
|
||||||
|
:maxdepth: 3
|
||||||
|
|
||||||
|
notebook
|
||||||
|
note-creation
|
||||||
|
note-filtering
|
||||||
|
note-format
|
||||||
|
note-frontmatter
|
||||||
|
tags
|
||||||
|
note-id
|
||||||
|
templating
|
||||||
|
|
@ -0,0 +1,44 @@
|
|||||||
|
# Creating a new note
|
||||||
|
|
||||||
|
You can add a new note to a [notebook](notebook.md) using
|
||||||
|
`zk new --title "An interesting concept" [<directory>]`.
|
||||||
|
|
||||||
|
`zk` automatically generates a filename and initial content according to rules
|
||||||
|
set in your [configuration file](../config/config.md). These settings can be customized
|
||||||
|
per [group of notes](../config/config-group.md) in your notebook, as illustrated in
|
||||||
|
[Maintaining a daily journal](../tips/daily-journal.md).
|
||||||
|
|
||||||
|
By default, `zk new` will start [your editor](../config/tool-editor.md) after creating the
|
||||||
|
note. You can choose instead to print the absolute path to the note with
|
||||||
|
`--print-path`, which is more useful for [automation](../tips/automation.md).
|
||||||
|
|
||||||
|
(test)=
|
||||||
|
## Search or create with a single command
|
||||||
|
|
||||||
|
If you are not sure whether a note already exists for a particular subject, the
|
||||||
|
"search or create" mode might be more appropriate than `zk new`. It is inspired
|
||||||
|
by [Notational Velocity](https://notational.net/) and enables searching for an
|
||||||
|
existing note or creating a new one in a single action.
|
||||||
|
|
||||||
|
This option is available when running `zk edit --interactive`, which spawns
|
||||||
|
[`fzf`](../config/tool-fzf.md) to filter selected notes. From `fzf`, press `Ctrl-E` to
|
||||||
|
create a new note using the current search query as title.
|
||||||
|
|
||||||
|
## Create a note with initial content
|
||||||
|
|
||||||
|
Initial content can be fed to the template through standard input using
|
||||||
|
`zk new --interactive`, which will be expandable with the `{{content}}`
|
||||||
|
[template variable](template-creation.md).
|
||||||
|
|
||||||
|
For example, to use the content of the macOS clipboard as the initial content
|
||||||
|
you can run:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ pbpaste | zk new --interactive
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, you can use the content of a file:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk new --interactive < file.txt
|
||||||
|
```
|
@ -0,0 +1,385 @@
|
|||||||
|
# Searching and filtering notes
|
||||||
|
|
||||||
|
A few commands are built upon `zk`'s powerful note filtering capabilities, such
|
||||||
|
as `edit` and `list`. They accept any option described here. You may also
|
||||||
|
declare [named filters](../config/config-filter.md) in the
|
||||||
|
[configuration file](../config/config.md) for the same set of options you use
|
||||||
|
frequently.
|
||||||
|
|
||||||
|
## Filter by path
|
||||||
|
|
||||||
|
All filtering commands take for unique positional argument a list of paths. When
|
||||||
|
set, only the notes matching the given paths will be returned.
|
||||||
|
|
||||||
|
You can use it to find all the notes in a directory.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk list journal/daily journal/weekly
|
||||||
|
```
|
||||||
|
|
||||||
|
Or specific notes.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk edit 200911172034-an-interesting-concept.md
|
||||||
|
```
|
||||||
|
|
||||||
|
It works fine with only a path prefix as well. This is useful when you have a
|
||||||
|
[note ID](note-id.md) prefix, but not the full file path.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk edit 200911172034
|
||||||
|
```
|
||||||
|
|
||||||
|
These rules apply to all the following options, when they expect a `<path>`
|
||||||
|
parameter.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk list --link-to 200911172034
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also use a nested `zk` command to pre-filter paths to feed to an option
|
||||||
|
with a `<path>` argument.
|
||||||
|
[See the `inline` command alias example](../config/config-alias.md) for more
|
||||||
|
explanation.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# List the notes which have at least one link pointing to them (i.e. not orphans).
|
||||||
|
$ zk list --exclude "`zk inline --orphan`"
|
||||||
|
|
||||||
|
# List the notes which are linked by at least one note from the journal/ directory.
|
||||||
|
$ zk list --linked-by "`zk inline journal`"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Search the title or body
|
||||||
|
|
||||||
|
Use `--match <query>` (or `-m`) to search through the title and body of notes.
|
||||||
|
|
||||||
|
The search is powered by different strategies to answer various use cases:
|
||||||
|
|
||||||
|
- `fts` (default) uses a
|
||||||
|
[full-text search](https://en.wikipedia.org/wiki/Full-text_search) database to
|
||||||
|
offer near-instant results and advanced search operators.
|
||||||
|
- `exact` is useful if you need to find patterns containing special characters.
|
||||||
|
- `re` enables regular expression for advanced use cases.
|
||||||
|
|
||||||
|
Change the currently used strategy with `--match-strategy <strategy>` (or `-M`).
|
||||||
|
To set the default strategy, you can declare a [custom alias](../config/config-alias.md):
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[alias]
|
||||||
|
list = "zk list --match-strategy re $@"
|
||||||
|
```
|
||||||
|
|
||||||
|
The `--match` option may be given multiple times, where each argument will be
|
||||||
|
combined with a boolean AND.
|
||||||
|
|
||||||
|
For example,
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk list --tag "recipe" --match "pizza -pineapple" --match "mushrooms"
|
||||||
|
```
|
||||||
|
|
||||||
|
Is equivalent to,
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk list --tag "recipe" --match "(pizza -pineapple) AND (mushrooms)"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Full-text search (`fts`)
|
||||||
|
|
||||||
|
The default match strategy is powered by a
|
||||||
|
[full-text search](https://en.wikipedia.org/wiki/Full-text_search) database
|
||||||
|
enabling near-instant results. Queries are not case-sensitive and terms are
|
||||||
|
tokenized, which means that searching for `create` will also match `created` and
|
||||||
|
`creating`.
|
||||||
|
|
||||||
|
A syntax similar to Google Search is available for advanced search queries.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# FTS is the default match strategy
|
||||||
|
$ zk list --match "tesla OR edison"
|
||||||
|
|
||||||
|
# ...but you can enable it explicitly.
|
||||||
|
$ zk list --match-strategy fts --match "tesla OR edison"
|
||||||
|
$ zk list -Mf -m "tesla OR edison"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Combining terms
|
||||||
|
|
||||||
|
By default, the search engine will find the notes containing all the terms in
|
||||||
|
the query, in any order.
|
||||||
|
|
||||||
|
```
|
||||||
|
"tesla edison"
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want to find the notes containing any or both of the terms, put `OR` (all
|
||||||
|
caps) or a pipe `|` between them.
|
||||||
|
|
||||||
|
```
|
||||||
|
"tesla OR edison"
|
||||||
|
"tesla | edison"
|
||||||
|
```
|
||||||
|
|
||||||
|
Search for an exact phrase by surrounding it with double quotes. In this case,
|
||||||
|
you will need to single quote the full query if you do not want to escape the
|
||||||
|
double quotes.
|
||||||
|
|
||||||
|
```
|
||||||
|
'tesla "alternating current"'
|
||||||
|
```
|
||||||
|
|
||||||
|
To construct more complex queries, you can group sub-queries with parentheses.
|
||||||
|
|
||||||
|
```
|
||||||
|
"current (tesla OR edison)"
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally, you can filter out results by excluding a term with `NOT` (all caps) or
|
||||||
|
a `-` prefix.
|
||||||
|
|
||||||
|
```
|
||||||
|
"tesla NOT car"
|
||||||
|
"tesla -car"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Search in specific fields
|
||||||
|
|
||||||
|
If you want to search only in the title or body of notes, prefix a query with
|
||||||
|
`title:` or `body:`.
|
||||||
|
|
||||||
|
```
|
||||||
|
"title: tesla"
|
||||||
|
"body: (tesla OR edison)"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Prefix terms
|
||||||
|
|
||||||
|
Match any term beginning with the given prefix with a wildcard `*`.
|
||||||
|
|
||||||
|
```
|
||||||
|
"edi*"
|
||||||
|
```
|
||||||
|
|
||||||
|
Prefixing a query with `^` will match notes whose title or body start with the
|
||||||
|
following term.
|
||||||
|
|
||||||
|
```
|
||||||
|
"title: ^journal"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Exact matches (`exact`)
|
||||||
|
|
||||||
|
If you need to find patterns containing special characters, such as an
|
||||||
|
`email@addre.ss` or a `[[wiki-link]]`, use the `exact` match strategy. The
|
||||||
|
search will be case-insensitive.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk list --match-strategy exact --match "[[link]]"
|
||||||
|
$ zk list -Me -m "[[link]]"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Regular expressions (`re`)
|
||||||
|
|
||||||
|
For advanced use cases, you can use the `re` match strategy to search the
|
||||||
|
notebook using regular expressions. The supported syntax is similar to the one
|
||||||
|
used by Python or Perl.
|
||||||
|
[See the full reference](https://golang.org/s/re2syntax).
|
||||||
|
|
||||||
|
:warning: Make sure to use quotes to prevent your shell from expanding
|
||||||
|
wildcards.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Find notes containing emails.
|
||||||
|
$ zk list --match-strategy re --match ".+@.+"
|
||||||
|
$ zk list -Mr -m ".+@.+"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Filter by tags
|
||||||
|
|
||||||
|
You can filter your notes by their [tags](tags.md) using `--tags` (or `-t`).
|
||||||
|
|
||||||
|
Find the notes having several tags by separating them with a comma.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk list --tag "history, europe"
|
||||||
|
```
|
||||||
|
|
||||||
|
To match notes having either or both tags, use a pipe `|` or `OR` (all caps).
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk list --tag "inbox OR todo"
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want to exclude notes having a particular tag instead, prefix it with `-`
|
||||||
|
or `NOT` (all caps).
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk list --tag "NOT done"
|
||||||
|
```
|
||||||
|
|
||||||
|
Your shell might give you some trouble using the `-` prefix. You can quote it
|
||||||
|
and add an extra space as a workaround, e.g. `--tag " -done"`.
|
||||||
|
|
||||||
|
You can use glob patterns to match multiple tags. This is particularly useful if
|
||||||
|
you use a separator (e.g. `/`) to group multiple tags under a parent tag.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk list --tag "year/201*"
|
||||||
|
```
|
||||||
|
|
||||||
|
A useful [notebook housekeeping](../tips/notebook-housekeeping.md) feature is to find
|
||||||
|
tags which _do not_ have tags.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk list --tagless
|
||||||
|
```
|
||||||
|
|
||||||
|
## Filter by creation or modification date
|
||||||
|
|
||||||
|
To find notes created or modified on a specific day, use `--created <date>` and
|
||||||
|
`--modified <date>`. They accept a human-friendly date for argument.
|
||||||
|
|
||||||
|
```
|
||||||
|
--created yesterday
|
||||||
|
--created "last tuesday"
|
||||||
|
--modified "Feb 3"
|
||||||
|
```
|
||||||
|
|
||||||
|
You can filter by range instead, using `--created-before`, `--created-after`,
|
||||||
|
`--modified-before` and `--modified-after`.
|
||||||
|
|
||||||
|
```
|
||||||
|
--created-before 10am
|
||||||
|
--modified-after 2021
|
||||||
|
--created-after "last monday" --created-before yesterday
|
||||||
|
```
|
||||||
|
|
||||||
|
## Explore links
|
||||||
|
|
||||||
|
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 200911172034
|
||||||
|
--link-to 200911172034
|
||||||
|
```
|
||||||
|
|
||||||
|
These options stop at the first level by default. But you can explore the whole
|
||||||
|
web by adding the `--recursive` (or `-r`) option to find all the notes leading
|
||||||
|
to (or from) a given note. If you feel overwhelmed, limit the distance between
|
||||||
|
two notes with `--max-distance <count>`.
|
||||||
|
|
||||||
|
```
|
||||||
|
--linked-by 200911172034 --recursive --max-distance 3
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally, it can be useful to see which notes have no links pointing to them at
|
||||||
|
all. You can use the `--orphan` option for this.
|
||||||
|
|
||||||
|
## Find related notes
|
||||||
|
|
||||||
|
Part of writing a great notebook is to establish links between related notes.
|
||||||
|
The `--related <path>` option can help by listing results having a linked note
|
||||||
|
in common, but not yet connected to the note.
|
||||||
|
|
||||||
|
```
|
||||||
|
--related 200911172034
|
||||||
|
```
|
||||||
|
|
||||||
|
## Locate mentions of other notes
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
```
|
||||||
|
--mentioned-by 200911172034
|
||||||
|
```
|
||||||
|
|
||||||
|
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).
|
||||||
|
|
||||||
|
```
|
||||||
|
---
|
||||||
|
title: Artificial Intelligence
|
||||||
|
aliases: [AI, robot]
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
```
|
||||||
|
--mentioned-by 200911172034 --no-linked-by 200911172034
|
||||||
|
--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.
|
||||||
|
|
||||||
|
```
|
||||||
|
-x journal
|
||||||
|
```
|
||||||
|
|
||||||
|
## Limit the number of results
|
||||||
|
|
||||||
|
If you are only interested into the first few notes, limit the number of results
|
||||||
|
with `--limit <count>` (or `-n`).
|
||||||
|
|
||||||
|
```
|
||||||
|
--limit 20
|
||||||
|
```
|
||||||
|
|
||||||
|
Using `-n1` is particularly common when you are expecting only a single result.
|
||||||
|
|
||||||
|
## Interactive filtering
|
||||||
|
|
||||||
|
A common search flow is to reduce the search scope using `zk`'s filtering
|
||||||
|
options, before selecting manually the notes to process among them. This is
|
||||||
|
especially useful with `zk edit` to avoid opening many unwanted notes with your
|
||||||
|
editor.
|
||||||
|
|
||||||
|
Use `--interactive` (or `-i`) to select filtered notes manually. The interactive
|
||||||
|
selection is handled by [`fzf`](../config/tool-fzf.md) which brings a powerful fuzzy
|
||||||
|
matching search into the mix.
|
||||||
|
|
||||||
|
## Sort the results
|
||||||
|
|
||||||
|
After finding matching notes, it might be useful to sort them before processing.
|
||||||
|
The `--sort <criteria>` (or `-s`) option is made for that.
|
||||||
|
|
||||||
|
You can add a `+` (ascending) or `-` (descending) suffix to a sort criterion to
|
||||||
|
customize the order. Each criterion has a sensible intrinsic order by default.
|
||||||
|
|
||||||
|
```
|
||||||
|
--sort path
|
||||||
|
--sort created+
|
||||||
|
-st- (eq. --sort title-)
|
||||||
|
```
|
||||||
|
|
||||||
|
| Criterion | Shortcut | Order | Description |
|
||||||
|
| ------------ | -------- | ----- | ---------------------------------- |
|
||||||
|
| `created` | `c` | `-` | Creation date |
|
||||||
|
| `modified` | `m` | `-` | Modification date |
|
||||||
|
| `path` | `p` | `+` | File path relative to the notebook |
|
||||||
|
| `title` | `t` | `+` | Note title |
|
||||||
|
| `random` | `r` | `+` | Order notes randomly |
|
||||||
|
| `word-count` | `wc` | `+` | Word count in the note |
|
@ -0,0 +1,34 @@
|
|||||||
|
# Note ID
|
||||||
|
|
||||||
|
Each note is uniquely identified by its path relative to the
|
||||||
|
[notebook](notebook.md)'s root. However, in some cases it is more convenient to
|
||||||
|
refer to a "note ID", which is the unique part of its filename. For example, the
|
||||||
|
note ID of the file `200911172034 An interesting concept.md` is `200911172034`.
|
||||||
|
You could have several notes named "An interesting concept", but only one with
|
||||||
|
the ID `200911172034`.
|
||||||
|
|
||||||
|
The purpose of using a unique identifier in your note filenames is to create
|
||||||
|
stable links between your notes, which will not break even if you change the
|
||||||
|
title of the linked note.
|
||||||
|
[See this reference for more information](https://zettelkasten.de/introduction/#the-unique-identifier).
|
||||||
|
|
||||||
|
There are several flavors of note IDs and `zk` supports most of them. You can
|
||||||
|
set it up in the [note configuration](../config/config-note.md).
|
||||||
|
|
||||||
|
## Random ID
|
||||||
|
|
||||||
|
A random ID enables short and memorable unique identifiers. By default, `zk` is
|
||||||
|
configured to generate random IDs of four alphanumeric characters. I found this
|
||||||
|
to be the sweet spot between an easily memorable and usable ID and enough
|
||||||
|
candidates. This default setting can generate 1 679 616 unique IDs.
|
||||||
|
|
||||||
|
## Timestamp
|
||||||
|
|
||||||
|
Another common ID is a timestamp in the `YYYYMMDDHHMM` shape. This is less
|
||||||
|
readable than a short random ID, but has the added advantage of being sortable
|
||||||
|
by creation date. However, I find this not so useful in practice.
|
||||||
|
|
||||||
|
## Sequential IDs
|
||||||
|
|
||||||
|
Sequential (incremented) IDs are currently not supported by `zk`. They get ugly
|
||||||
|
very quickly when deleting outdated notes and have an irregular shape.
|
@ -0,0 +1,29 @@
|
|||||||
|
# Notebook
|
||||||
|
|
||||||
|
A _notebook_ is a directory containing a collection of notes managed by `zk`.
|
||||||
|
Notebooks cannot be nested, but you are free to organize your notes in
|
||||||
|
subdirectories.
|
||||||
|
|
||||||
|
To create a new notebook, simply run `zk init [<directory>]`.
|
||||||
|
|
||||||
|
Most `zk` commands are operating "Git-style" on the notebook containing the
|
||||||
|
current working directory (or one of its parents). However, you can explicitly
|
||||||
|
set which notebook to use with `--notebook-dir` or the `ZK_NOTEBOOK_DIR`
|
||||||
|
environment variable. Setting `ZK_NOTEBOOK_DIR` in your shell configuration
|
||||||
|
(e.g. `~/.profile`) can be used to define a default notebook which `zk` commands
|
||||||
|
will use when the working directory is not in another notebook.
|
||||||
|
|
||||||
|
If the [default notebook](../config/config-notebook.md) is set it will be used as
|
||||||
|
`ZK_NOTEBOOK_DIR`, unless this environment variable is not already set.
|
||||||
|
|
||||||
|
## Anatomy of a notebook
|
||||||
|
|
||||||
|
Similarly to Git, a notebook is identified by the presence of a `.zk` directory
|
||||||
|
at its root. This directory contains the only `zk`-specific files in your
|
||||||
|
notebook:
|
||||||
|
|
||||||
|
- `.zk/config.toml` is the user [configuration file](../config/config.md)
|
||||||
|
- `.zk/templates/` contains [user templates](template.md) used when
|
||||||
|
[creating new notes](note-creation.md)
|
||||||
|
- `.zk/notebook.db` is the SQLite database enabling
|
||||||
|
[powerful search features](note-filtering.md).
|
@ -0,0 +1,10 @@
|
|||||||
|
Templating
|
||||||
|
==========
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 3
|
||||||
|
|
||||||
|
Template syntax <template>
|
||||||
|
Note templates <template-creation>
|
||||||
|
Template formatting <template-format>
|
||||||
|
|
@ -0,0 +1,2 @@
|
|||||||
|
furo
|
||||||
|
myst-parser
|
@ -1,27 +0,0 @@
|
|||||||
# Styling
|
|
||||||
|
|
||||||
`zk` supports a `{{style}}` [template helper](template.md) to format its output with colors and font decorations.
|
|
||||||
|
|
||||||
Usage: `{{style "<rules>" "<text>"}}`
|
|
||||||
|
|
||||||
Multiple rules can be provided, separated by spaces.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
```
|
|
||||||
Inline: {{style "red bold" "One is never alone with a rubber duck."}}
|
|
||||||
|
|
||||||
Block:
|
|
||||||
{{#style "underline"}}
|
|
||||||
For a moment, nothing happened. Then, after a second
|
|
||||||
or so, nothing continued to happen.
|
|
||||||
{{/style}}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Styling rules
|
|
||||||
|
|
||||||
* Decorations: `bold`, `italic`, `faint`, `underline`, `strikethrough`, `blink`, `reverse`, `hidden`
|
|
||||||
* Text color: `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`
|
|
||||||
* Text color (bright): `bright-black`, `bright-red`, `bright-green`, `bright-yellow`, `bright-blue`, `bright-magenta`, `bright-cyan`, `bright-white`
|
|
||||||
* Background color: `black-bg`, `red-bg`, `green-bg`, `yellow-bg`, `blue-bg`, `magenta-bg`, `cyan-bg`, `white-bg`
|
|
||||||
* Background color (bright): `bright-black-bg`, `bright-red-bg`, `bright-green-bg`, `bright-yellow-bg`, `bright-blue-bg`, `bright-magenta-bg`, `bright-cyan-bg`, `bright-white-bg`
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
# Automating frequent tasks
|
||||||
|
|
||||||
|
`zk` was designed with automation in mind and strive to be
|
||||||
|
[a good Unix citizen](https://en.wikipedia.org/wiki/Unix_philosophy). As such,
|
||||||
|
it offers a number of ways to interface with other programs:
|
||||||
|
|
||||||
|
- write [command aliases](../config/config-alias.md) or
|
||||||
|
[named filters](../config/config-filter.md) for repeated complex commands
|
||||||
|
- [call `zk` from other programs](external-call.md)
|
||||||
|
- [send notes for processing by other programs](external-processing.md)
|
||||||
|
- [create a note with initial content](../notes/note-creation.md) from a
|
||||||
|
standard input pipe
|
||||||
|
|
||||||
|
If you find out that `zk` does not behave as expected or could communicate
|
||||||
|
better with other programs,
|
||||||
|
[please post an issue](https://github.com/zk-org/zk/issues).
|
@ -0,0 +1,66 @@
|
|||||||
|
# Maintaining a daily journal
|
||||||
|
|
||||||
|
Let's assume you want to write daily notes named like `2021-02-16.md` in a
|
||||||
|
`journal/daily` sub-directory. This common use case is a good fit for creating a
|
||||||
|
[note group](../config/config-group.md) overriding the default
|
||||||
|
[note creation](../notes/note-creation.md) settings.
|
||||||
|
|
||||||
|
First, create a `group` entry in the [configuration file](../config/config.md) to set the
|
||||||
|
note settings for this directory. Refer to the
|
||||||
|
[template syntax reference](../notes/template.md) to understand how to use the
|
||||||
|
`{{format-date}}` helper.
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[group.daily]
|
||||||
|
# Directories listed here will automatically use this group when creating notes.
|
||||||
|
paths = ["journal/daily"]
|
||||||
|
|
||||||
|
[group.daily.note]
|
||||||
|
# %Y-%m-%d is actually the default format, so you could use {{format-date now}} instead.
|
||||||
|
filename = "{{format-date now '%Y-%m-%d'}}"
|
||||||
|
extension = "md"
|
||||||
|
template = "daily.md"
|
||||||
|
```
|
||||||
|
|
||||||
|
Next, create a template file under `.zk/templates/daily.md` to render the note
|
||||||
|
content. Here we used the date again to generate a title like "February 16,
|
||||||
|
2021".
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
# {{format-date now "long"}}
|
||||||
|
|
||||||
|
What did I do today?
|
||||||
|
```
|
||||||
|
|
||||||
|
We are now ready to write today's note! We don't need to set `--title` since the
|
||||||
|
note's title is entirely generated by the template.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk new journal/daily
|
||||||
|
```
|
||||||
|
|
||||||
|
That is a bit of a mouthful for a command called every day. Would it not be
|
||||||
|
better to just write `zk daily`? We can, by defining a
|
||||||
|
[command alias](../config/config-alias.md) in the [configuration file](../config/config.md).
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[alias]
|
||||||
|
daily = 'zk new --no-input "$ZK_NOTEBOOK_DIR/journal/daily"'
|
||||||
|
```
|
||||||
|
|
||||||
|
Let's unpack this alias:
|
||||||
|
|
||||||
|
- `zk new` will refuse to overwrite notes. If you already created today's note,
|
||||||
|
it will instead ask you if you wish to edit it. Using `--no-input` skips the
|
||||||
|
prompt and edit the existing note right away.
|
||||||
|
- `$ZK_NOTEBOOK_DIR` is set to the absolute path of the current
|
||||||
|
[notebook](../notes/notebook.md) when running an alias. Using it allows you to run
|
||||||
|
`zk daily` no matter where you are in the notebook folder hierarchy.
|
||||||
|
- We need to use double quotes around `$ZK_NOTEBOOK_DIR`, otherwise it will not
|
||||||
|
be expanded.
|
||||||
|
|
||||||
|
If you want to edit today's note, simply use this alias:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk daily
|
||||||
|
```
|
@ -0,0 +1,284 @@
|
|||||||
|
# Editors integration
|
||||||
|
|
||||||
|
There are several extensions available to integrate `zk` in your favorite
|
||||||
|
editor:
|
||||||
|
|
||||||
|
- [`zk-nvim`](https://github.com/zk-org/zk-nvim) for Neovim 0.5+
|
||||||
|
- [`zk-vscode`](https://github.com/zk-org/zk-vscode) for Visual Studio Code
|
||||||
|
|
||||||
|
## Language Server Protocol
|
||||||
|
|
||||||
|
`zk` ships with a
|
||||||
|
[Language Server](https://microsoft.github.io/language-server-protocol/overviews/lsp/overview/)
|
||||||
|
to provide basic support for any LSP-compatible editor. The currently supported
|
||||||
|
features are:
|
||||||
|
|
||||||
|
- Auto-complete Markdown links with `[[` (setup wiki-links in the
|
||||||
|
[note formats configuration](../notes/note-format.md))
|
||||||
|
- Auto-complete [hashtags and colon-separated tags](../notes/tags.md).
|
||||||
|
- Preview the content of a note when hovering a link.
|
||||||
|
- Navigate in your notes by following internal links.
|
||||||
|
- Create a new note using the current selection as title.
|
||||||
|
- Diagnostics for dead links and wiki-links titles.
|
||||||
|
- [And more to come...](https://github.com/zk-org/zk/issues/22)
|
||||||
|
|
||||||
|
You can configure some of these features in your notebook's
|
||||||
|
[configuration file](../config/config-lsp.md).
|
||||||
|
|
||||||
|
### Editor LSP configurations
|
||||||
|
|
||||||
|
To start the Language Server, use the `zk lsp` command. Refer to the following
|
||||||
|
sections for editor-specific examples.
|
||||||
|
[Feel free to share the configuration for your editor](https://github.com/zk-org/zk/issues/22).
|
||||||
|
|
||||||
|
#### Vim and Neovim
|
||||||
|
|
||||||
|
##### Vim and Neovim 0.4
|
||||||
|
|
||||||
|
With [`coc.nvim`](https://github.com/neoclide/coc.nvim), run `:CocConfig` and
|
||||||
|
add the following in the settings file:
|
||||||
|
|
||||||
|
<details><summary><tt>coc-settings.json</tt></summary>
|
||||||
|
|
||||||
|
```jsonc
|
||||||
|
{
|
||||||
|
// Important, otherwise link completion containing spaces and other special characters won't work.
|
||||||
|
"suggest.invalidInsertCharacters": [],
|
||||||
|
|
||||||
|
"languageserver": {
|
||||||
|
"zk": {
|
||||||
|
"command": "zk",
|
||||||
|
"args": ["lsp"],
|
||||||
|
"trace.server": "messages",
|
||||||
|
"filetypes": ["markdown"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
Here are some additional useful key bindings and custom commands:
|
||||||
|
|
||||||
|
<details><summary><tt>~/.config/nvim/init.vim</tt></summary>
|
||||||
|
|
||||||
|
```viml
|
||||||
|
" User command to index the current notebook.
|
||||||
|
"
|
||||||
|
" zk.index expects a notebook path as first argument, so we provide the current
|
||||||
|
" buffer path with expand("%:p").
|
||||||
|
command! -nargs=0 ZkIndex :call CocAction("runCommand", "zk.index", expand("%:p"))
|
||||||
|
nnoremap <leader>zi :ZkIndex<CR>
|
||||||
|
|
||||||
|
" User command to create and open a new note, to be called like this:
|
||||||
|
" :ZkNew {"title": "An interesting subject", "dir": "inbox", ...}
|
||||||
|
"
|
||||||
|
" Note the concatenation with the "edit" command to open the note right away.
|
||||||
|
command! -nargs=? ZkNew :exec "edit ".CocAction("runCommand", "zk.new", expand("%:p"), <args>).path
|
||||||
|
|
||||||
|
" Create a new note after prompting for its title.
|
||||||
|
nnoremap <leader>zn :ZkNew {"title": input("Title: ")}<CR>
|
||||||
|
" Create a new note in the directory journal/daily.
|
||||||
|
nnoremap <leader>zj :ZkNew {"dir": "journal/daily"}<CR>
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
##### Neovim 0.5 built-in LSP client
|
||||||
|
|
||||||
|
Using [`nvim-lspconfig`](https://github.com/neovim/nvim-lspconfig):
|
||||||
|
|
||||||
|
<details><summary><tt>~/.config/nvim/init.lua</tt></summary>
|
||||||
|
|
||||||
|
```lua
|
||||||
|
local lspconfig = require('lspconfig')
|
||||||
|
local configs = require('lspconfig/configs')
|
||||||
|
|
||||||
|
configs.zk = {
|
||||||
|
default_config = {
|
||||||
|
cmd = {'zk', 'lsp'},
|
||||||
|
filetypes = {'markdown'},
|
||||||
|
root_dir = function()
|
||||||
|
return vim.loop.cwd()
|
||||||
|
end,
|
||||||
|
settings = {}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.zk.setup({ on_attach = function(client, buffer)
|
||||||
|
-- Add keybindings here, see https://github.com/neovim/nvim-lspconfig#keybindings-and-completion
|
||||||
|
end })
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
#### Sublime Text
|
||||||
|
|
||||||
|
Install the [Sublime LSP](https://github.com/sublimelsp/LSP) package, then run
|
||||||
|
the **Preferences: LSP Settings** command. Add the following to the settings
|
||||||
|
file:
|
||||||
|
|
||||||
|
<details><summary><tt>LSP.sublime-settings</tt></summary>
|
||||||
|
|
||||||
|
```jsonc
|
||||||
|
{
|
||||||
|
"clients": {
|
||||||
|
"zk": {
|
||||||
|
"enabled": true,
|
||||||
|
"command": ["zk", "lsp"],
|
||||||
|
"languageId": "markdown",
|
||||||
|
"scopes": ["source.markdown"],
|
||||||
|
"syntaxes": ["Packages/MarkdownEditing/Markdown.sublime-syntax"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
#### Visual Studio Code
|
||||||
|
|
||||||
|
Install the
|
||||||
|
[`zk-vscode`](https://marketplace.visualstudio.com/items?itemName=mickael-menu.zk-vscode)
|
||||||
|
extension from the Marketplace.
|
||||||
|
|
||||||
|
### Custom commands
|
||||||
|
|
||||||
|
Using `zk`'s LSP custom commands, you can call `zk` commands right from your
|
||||||
|
editor. Please refer to your editor's documentation on how to bind keyboard
|
||||||
|
shortcuts to custom LSP commands.
|
||||||
|
|
||||||
|
#### `zk.index`
|
||||||
|
|
||||||
|
This LSP command calls `zk index` to refresh your notebook's index. It can be
|
||||||
|
useful to make sure that the auto-completion is up-to-date. `zk.index` takes two
|
||||||
|
arguments:
|
||||||
|
|
||||||
|
1. A path to a file or directory in the notebook to index.
|
||||||
|
2. <details><summary>(Optional) A dictionary of additional options (click to expand)</summary>
|
||||||
|
|
||||||
|
| Key | Type | Description |
|
||||||
|
| ------- | ------- | --------------------------------- |
|
||||||
|
| `force` | boolean | Reindexes all the notes when true |
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
`zk.index` returns a dictionary of indexing statistics.
|
||||||
|
|
||||||
|
#### `zk.new`
|
||||||
|
|
||||||
|
This LSP command calls `zk new` to create a new note. It can be useful to
|
||||||
|
quickly create a new note with a key binding. `zk.new` takes two arguments:
|
||||||
|
|
||||||
|
1. A path to any file or directory in the notebook, to locate it.
|
||||||
|
2. <details><summary>(Optional) A dictionary of additional options (click to expand)</summary>
|
||||||
|
|
||||||
|
| Key | Type | Description |
|
||||||
|
| ------------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `title` | string | Title of the new note |
|
||||||
|
| `content` | string | Initial content of the note |
|
||||||
|
| `dir` | string | Parent directory, relative to the root of the notebook |
|
||||||
|
| `group` | string | [Note configuration group](../config/config-group.md) |
|
||||||
|
| `template` | string | [Custom template used to render the note](../notes/template-creation.md) |
|
||||||
|
| `extra` | dictionary | A dictionary of extra variables to expand in the template |
|
||||||
|
| `date` | string | A date of creation for the note in natural language, e.g. "tomorrow" |
|
||||||
|
| `edit` | boolean | When true, the editor will open the newly created note (**not supported by all editors**) |
|
||||||
|
| `dryRun` | boolean | When true, `zk` will not actually create the note on the file system, but will return its generated content and path |
|
||||||
|
| `insertLinkAtLocation` | location<sup>1</sup> | A location in another note where a link to the new note will be inserted |
|
||||||
|
| `insertContentAtLocation` | location<sup>1</sup> | A location in another note where the content of the new note will be inserted |
|
||||||
|
|
||||||
|
1. The `location` type is an
|
||||||
|
[LSP Location object](https://microsoft.github.io/language-server-protocol/specification#location),
|
||||||
|
for example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"uri": "file:///Users/mickael/notes/9se3.md",
|
||||||
|
"range": {
|
||||||
|
"end": { "line": 5, "character": 149 },
|
||||||
|
"start": { "line": 5, "character": 137 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
`zk.new` returns a dictionary with two properties:
|
||||||
|
|
||||||
|
- `path` containing the absolute path to the created note.
|
||||||
|
- `content` containing the raw content of the created note.
|
||||||
|
|
||||||
|
#### `zk.link`
|
||||||
|
|
||||||
|
This LSP command allows editors to tap into the note linking mechanism. It takes
|
||||||
|
three arguments:
|
||||||
|
|
||||||
|
1. A `path` to any file in the notebook that will be linked to
|
||||||
|
2. An LSP `location` object that points to where the link will be inserted
|
||||||
|
3. An optional title of the link. If `title` is not provided, the title of the
|
||||||
|
note will be inserted instead
|
||||||
|
|
||||||
|
`zk.link` returns a JSON object with the path to the linked note, if the linking
|
||||||
|
was successful.
|
||||||
|
|
||||||
|
**Note**: This command is _not_ exposed in the command line. This command is
|
||||||
|
targeted at editor / plugin authors to extend zk functionality.
|
||||||
|
|
||||||
|
#### `zk.list`
|
||||||
|
|
||||||
|
This LSP command calls `zk list` to search a notebook. It takes two arguments:
|
||||||
|
|
||||||
|
1. A path to any file or directory in the notebook, to locate it.
|
||||||
|
2. <details><summary>A dictionary of additional options (click to expand)</summary>
|
||||||
|
|
||||||
|
| Key | Type | Required? | Description |
|
||||||
|
| ---------------- | ------------ | --------- | --------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `select` | string array | Yes | List of note fields to return<sup>1</sup> |
|
||||||
|
| `hrefs` | string array | No | Find notes matching the given path, including its descendants |
|
||||||
|
| `limit` | integer | No | Limit the number of notes found |
|
||||||
|
| `match` | string array | No | Terms to search for in the notes |
|
||||||
|
| `exactMatch` | boolean | No | (deprecated: use `matchStrategy`) Search for exact occurrences of the `match` argument (case insensitive) |
|
||||||
|
| `matchStrategy` | string | No | Specify match strategy, which may be "fts" (default), "exact" or "re" |
|
||||||
|
| `excludeHrefs` | string array | No | Ignore notes matching the given path, including its descendants |
|
||||||
|
| `tags` | string array | No | Find notes tagged with the given tags |
|
||||||
|
| `mention` | string array | No | Find notes mentioning the title of the given ones |
|
||||||
|
| `mentionedBy` | string array | No | Find notes whose title is mentioned in the given ones |
|
||||||
|
| `linkTo` | string array | No | Find notes which are linking to the given ones |
|
||||||
|
| `linkedBy` | string array | No | Find notes which are linked by the given ones |
|
||||||
|
| `orphan` | boolean | No | Find notes which are not linked by any other note |
|
||||||
|
| `tagless` | boolean | No | Find notes which have no tags |
|
||||||
|
| `related` | string array | No | Find notes which might be related to the given ones |
|
||||||
|
| `maxDistance` | integer | No | Maximum distance between two linked notes |
|
||||||
|
| `recursive` | boolean | No | Follow links recursively |
|
||||||
|
| `created` | string | No | Find notes created on the given date |
|
||||||
|
| `createdBefore` | string | No | Find notes created before the given date |
|
||||||
|
| `createdAfter` | string | No | Find notes created after the given date |
|
||||||
|
| `modified` | string | No | Find notes modified on the given date |
|
||||||
|
| `modifiedBefore` | string | No | Find notes modified before the given date |
|
||||||
|
| `modifiedAfter` | string | No | Find notes modified after the given date |
|
||||||
|
| `sort` | string array | No | Order the notes by the given criterion |
|
||||||
|
|
||||||
|
1. As the output of this command might be very verbose and put a heavy load on the LSP client, you need to explicitly set which note fields you want to receive with the `select` option. The following fields are available: `filename`, `filenameStem`, `path`, `absPath`, `title`, `lead`, `body`, `snippets`, `rawContent`, `wordCount`, `tags`, `metadata`, `created`, `modified` and `checksum`.
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
`zk.list` returns the found notes as a JSON array.
|
||||||
|
|
||||||
|
#### `zk.tag.list`
|
||||||
|
|
||||||
|
This LSP command calls `zk tag list` to return the list of tags in a notebook.
|
||||||
|
It takes two arguments:
|
||||||
|
|
||||||
|
1. A path to any file or directory in the notebook, to locate it.
|
||||||
|
2. <details><summary>(Optional) A dictionary of additional options (click to expand)</summary>
|
||||||
|
|
||||||
|
| Key | Type | Required? | Description |
|
||||||
|
| ------ | ------------ | --------- | ------------------------------------------------ |
|
||||||
|
| `sort` | string array | No | Order the tags by the given criteria<sup>1</sup> |
|
||||||
|
|
||||||
|
1. The available sort criteria are `name` and `note-count`. You can change
|
||||||
|
the order by appending `-` or `+` to the criterion.
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
`zk.tag.list` returns the tags as a JSON array.
|
@ -0,0 +1,8 @@
|
|||||||
|
# A future-proof notebook
|
||||||
|
|
||||||
|
`zk` is designed to be future-proof and rely on simple
|
||||||
|
[plain text formats](../notes/note-format.md) such as Markdown.
|
||||||
|
|
||||||
|
The shape of your [notebook](../notes/notebook.md) is entirely up to you, making
|
||||||
|
`zk` flexible enough to be used in a variety of contexts. However, `zk` shines
|
||||||
|
in a Zettelkasten-style notebook with many small interlinked notes.
|
@ -0,0 +1,101 @@
|
|||||||
|
# Getting started with `zk`
|
||||||
|
|
||||||
|
A short introduction showing how to use `zk`.
|
||||||
|
|
||||||
|
## Create a new notebook
|
||||||
|
|
||||||
|
Create a [notebook](../notes/notebook.md) to host your notes. You are free to organize
|
||||||
|
your notebook as you want, adding subdirectories if needed.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk init my-notes
|
||||||
|
Initialized a notebook in my-notes
|
||||||
|
|
||||||
|
$ cd my-notes
|
||||||
|
```
|
||||||
|
|
||||||
|
## Create your first notes
|
||||||
|
|
||||||
|
Now you are ready to write your very first note. Pick a subject,
|
||||||
|
[create a new note](../notes/note-creation.md) and write on!
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk new --title "An interesting concept"
|
||||||
|
```
|
||||||
|
|
||||||
|
You can customize your experience using [custom templates](../notes/template.md) to
|
||||||
|
generate many kind of notes.
|
||||||
|
|
||||||
|
![Create a note](../assets/media/new1.svg)
|
||||||
|
|
||||||
|
If you are not sure whether a note already exists for a particular subject, the
|
||||||
|
"search or create" mode might be more appropriate than `zk new`. It is inspired
|
||||||
|
by [Notational Velocity](https://notational.net/) and enables searching for an
|
||||||
|
existing note or creating a new one in a single action.
|
||||||
|
|
||||||
|
From `zk`'s interactive edit screen, press `Ctrl-E` to create a new note using
|
||||||
|
the current search query as title.
|
||||||
|
|
||||||
|
![Create a note](../assets/media/new2.svg)
|
||||||
|
|
||||||
|
## List existing notes
|
||||||
|
|
||||||
|
After some time, hopefully you will have enough notes to be lost in it.
|
||||||
|
|
||||||
|
To help structure your notebook, you can add [metadata](../notes/note-frontmatter.md)
|
||||||
|
(e.g. keywords/tags) to your notes. You can then use `zk`'s powerful
|
||||||
|
[filtering capabilities](../notes/note-filtering.md) to find the notes you need.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk list --tag "recipe" --match "pizza -pineapple"
|
||||||
|
```
|
||||||
|
|
||||||
|
![List notes](../assets/media/list.svg)
|
||||||
|
|
||||||
|
Sort the results however you need with `--sort`.
|
||||||
|
|
||||||
|
![Sort notes](../assets/media/list-sort.svg)
|
||||||
|
|
||||||
|
`--format` and `--delimiter` offer some versatile formatting options to
|
||||||
|
customize the output.
|
||||||
|
|
||||||
|
![Note list format](../assets/media/list-format.svg)
|
||||||
|
|
||||||
|
`zk` is aware of the links you set between your notes. Backlinks or outbound
|
||||||
|
links of a note can be revealed by using the link filtering options. It even
|
||||||
|
supports listing indirect links thanks to `--recursive`.
|
||||||
|
|
||||||
|
![Note list links](../assets/media/list-link.svg)
|
||||||
|
|
||||||
|
`zk` supports an interactive mode powered by
|
||||||
|
[`fzf`](https://github.com/junegunn/fzf) to further filter notes manually.
|
||||||
|
|
||||||
|
![Note list interactive](../assets/media/list-interactive.svg)
|
||||||
|
|
||||||
|
## Edit existing notes
|
||||||
|
|
||||||
|
To edit notes with your default editor, use `zk edit`. It supports the same
|
||||||
|
[filtering options](../notes/note-filtering.md) as `zk list`.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ zk edit --interactive --match "recipe pizza -pineapple"
|
||||||
|
|
||||||
|
# or with short flags
|
||||||
|
$ zk edit -i -m "recipe pizza -pineapple"
|
||||||
|
```
|
||||||
|
|
||||||
|
![Note edit](../assets/media/edit.svg)
|
||||||
|
|
||||||
|
## Edit the configuration file
|
||||||
|
|
||||||
|
To customize your experience with `zk`, you may want to edit the
|
||||||
|
[user configuration file](../config/config.md).
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ vim .zk/config.toml
|
||||||
|
```
|
||||||
|
|
||||||
|
Declaring your own [aliases](../config/config-alias.md) is a great way to make your
|
||||||
|
experience with `zk` easier and more familiar.
|
||||||
|
|
||||||
|
![Note alias](../assets/media/alias.svg)
|
@ -0,0 +1,17 @@
|
|||||||
|
Tips
|
||||||
|
====
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 3
|
||||||
|
|
||||||
|
getting-started
|
||||||
|
automation
|
||||||
|
daily-journal
|
||||||
|
notebook-housekeeping
|
||||||
|
external-processing
|
||||||
|
external-call
|
||||||
|
editors-integration
|
||||||
|
future-proof
|
||||||
|
neuron
|
||||||
|
style
|
||||||
|
|
@ -0,0 +1,35 @@
|
|||||||
|
# Styling
|
||||||
|
|
||||||
|
`zk` supports a `{{style}}` [template helper](../notes/template.md) to format
|
||||||
|
its output with colors and font decorations.
|
||||||
|
|
||||||
|
Usage: `{{style "<rules>" "<text>"}}`
|
||||||
|
|
||||||
|
Multiple rules can be provided, separated by spaces.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
```
|
||||||
|
Inline: {{style "red bold" "One is never alone with a rubber duck."}}
|
||||||
|
|
||||||
|
Block:
|
||||||
|
{{#style "underline"}}
|
||||||
|
For a moment, nothing happened. Then, after a second
|
||||||
|
or so, nothing continued to happen.
|
||||||
|
{{/style}}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Styling rules
|
||||||
|
|
||||||
|
- Decorations: `bold`, `italic`, `faint`, `underline`, `strikethrough`, `blink`,
|
||||||
|
`reverse`, `hidden`
|
||||||
|
- Text color: `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`,
|
||||||
|
`white`
|
||||||
|
- Text color (bright): `bright-black`, `bright-red`, `bright-green`,
|
||||||
|
`bright-yellow`, `bright-blue`, `bright-magenta`, `bright-cyan`,
|
||||||
|
`bright-white`
|
||||||
|
- Background color: `black-bg`, `red-bg`, `green-bg`, `yellow-bg`, `blue-bg`,
|
||||||
|
`magenta-bg`, `cyan-bg`, `white-bg`
|
||||||
|
- Background color (bright): `bright-black-bg`, `bright-red-bg`,
|
||||||
|
`bright-green-bg`, `bright-yellow-bg`, `bright-blue-bg`, `bright-magenta-bg`,
|
||||||
|
`bright-cyan-bg`, `bright-white-bg`
|
@ -1,14 +0,0 @@
|
|||||||
# Setting your default editor
|
|
||||||
|
|
||||||
`zk` is not a text editor. Instead, it is designed to interface with your favorite editor to write your notes.
|
|
||||||
|
|
||||||
You can customize which editor to use either from the [configuration file](config.md) or environment variables. In order of precedence, `zk` will use:
|
|
||||||
|
|
||||||
1. `ZK_EDITOR` environment variable
|
|
||||||
2. `editor` configuration property
|
|
||||||
```toml
|
|
||||||
[tool]
|
|
||||||
editor = "vim"
|
|
||||||
```
|
|
||||||
3. `VISUAL` environment variable
|
|
||||||
4. `EDITOR` environment variable
|
|
@ -1,18 +0,0 @@
|
|||||||
# Setting your default pager
|
|
||||||
|
|
||||||
When `zk`'s output exceeds a certain limit, it is automatically paginated by your system pager. By default, `less` is used but you may set up your own pager in the [configuration file](config.md) or environment variables. In order of precedence, `zk` will use:
|
|
||||||
|
|
||||||
1. `ZK_PAGER` environment variable
|
|
||||||
2. `pager` configuration property
|
|
||||||
```toml
|
|
||||||
[tool]
|
|
||||||
pager = "less -FIRX"
|
|
||||||
```
|
|
||||||
3. `PAGER` environment variable
|
|
||||||
|
|
||||||
## Disable the pager
|
|
||||||
|
|
||||||
If you need to disable paging, you can either:
|
|
||||||
|
|
||||||
* use `--no-pager`
|
|
||||||
* set the `pager` configuration property to an empty string `""`
|
|
@ -1,39 +1,54 @@
|
|||||||
module github.com/mickael-menu/zk
|
module github.com/zk-org/zk
|
||||||
|
|
||||||
go 1.15
|
go 1.21
|
||||||
|
|
||||||
replace github.com/tliron/glsp => github.com/mickael-menu/glsp v0.1.1
|
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/AlecAivazis/survey/v2 v2.3.2
|
github.com/AlecAivazis/survey/v2 v2.3.4
|
||||||
github.com/alecthomas/kong v0.2.18-0.20210927063154-5c7b038540ab
|
github.com/alecthomas/kong v0.5.0
|
||||||
github.com/aymerick/raymond v2.0.2+incompatible
|
github.com/aymerick/raymond v2.0.2+incompatible
|
||||||
github.com/bmatcuk/doublestar/v4 v4.0.2 // indirect
|
github.com/bmatcuk/doublestar/v4 v4.0.2
|
||||||
github.com/fatih/color v1.13.0
|
github.com/fatih/color v1.13.0
|
||||||
github.com/go-testfixtures/testfixtures/v3 v3.4.1
|
github.com/go-testfixtures/testfixtures/v3 v3.6.1
|
||||||
github.com/google/go-cmp v0.5.6
|
github.com/google/go-cmp v0.5.8
|
||||||
github.com/gosimple/slug v1.10.0
|
github.com/gosimple/slug v1.12.0
|
||||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
|
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
|
||||||
github.com/lestrrat-go/strftime v1.0.5
|
github.com/lestrrat-go/strftime v1.0.6
|
||||||
github.com/mattn/go-colorable v0.1.11 // indirect
|
|
||||||
github.com/mattn/go-isatty v0.0.14
|
github.com/mattn/go-isatty v0.0.14
|
||||||
github.com/mattn/go-sqlite3 v1.14.8
|
github.com/mattn/go-sqlite3 v1.14.22
|
||||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
|
|
||||||
github.com/mickael-menu/pretty v0.2.3
|
|
||||||
github.com/mvdan/xurls v1.1.0
|
github.com/mvdan/xurls v1.1.0
|
||||||
github.com/pelletier/go-toml v1.9.4
|
github.com/pelletier/go-toml v1.9.5
|
||||||
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/relvacode/iso8601 v1.1.0
|
github.com/relvacode/iso8601 v1.1.0
|
||||||
github.com/rogpeppe/go-internal v1.6.2 // indirect
|
|
||||||
github.com/rvflash/elapsed v0.2.0
|
github.com/rvflash/elapsed v0.2.0
|
||||||
github.com/schollz/progressbar/v3 v3.8.3
|
github.com/schollz/progressbar/v3 v3.8.6
|
||||||
github.com/tj/go-naturaldate v1.3.0
|
github.com/tj/go-naturaldate v1.3.0
|
||||||
github.com/tliron/glsp v0.0.0-20210824162824-d103e5701036
|
github.com/tliron/glsp v0.1.1
|
||||||
github.com/tliron/kutil v0.1.49
|
github.com/tliron/kutil v0.1.59
|
||||||
github.com/yuin/goldmark v1.4.1
|
github.com/yuin/goldmark v1.4.12
|
||||||
github.com/yuin/goldmark-meta v1.0.0
|
github.com/yuin/goldmark-meta v1.1.0
|
||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
|
github.com/zk-org/pretty v0.2.4
|
||||||
golang.org/x/sys v0.0.0-20211002104244-808efd93c36d // indirect
|
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
|
|
||||||
golang.org/x/text v0.3.7 // indirect
|
|
||||||
gopkg.in/djherbis/times.v1 v1.3.0
|
gopkg.in/djherbis/times.v1 v1.3.0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/gorilla/websocket v1.5.0 // indirect
|
||||||
|
github.com/gosimple/unidecode v1.0.1 // indirect
|
||||||
|
github.com/kr/pretty v0.3.0 // indirect
|
||||||
|
github.com/kr/text v0.2.0 // indirect
|
||||||
|
github.com/mattn/go-colorable v0.1.12 // indirect
|
||||||
|
github.com/mattn/go-runewidth v0.0.13 // indirect
|
||||||
|
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
|
||||||
|
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
|
||||||
|
github.com/petermattis/goid v0.0.0-20220526132513-07eaf5d0b9f4 // indirect
|
||||||
|
github.com/rivo/uniseg v0.2.0 // indirect
|
||||||
|
github.com/rogpeppe/go-internal v1.9.0 // indirect
|
||||||
|
github.com/sasha-s/go-deadlock v0.3.1 // indirect
|
||||||
|
github.com/sourcegraph/jsonrpc2 v0.1.0 // indirect
|
||||||
|
github.com/zchee/color/v2 v2.0.6 // indirect
|
||||||
|
golang.org/x/crypto v0.17.0 // indirect
|
||||||
|
golang.org/x/sys v0.15.0 // indirect
|
||||||
|
golang.org/x/term v0.15.0 // indirect
|
||||||
|
golang.org/x/text v0.14.0 // indirect
|
||||||
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
||||||
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
|
)
|
||||||
|