Closed purefun closed 2 years ago
May the doc https://github.com/mickael-menu/zk-nvim/blob/main/doc/zk.txt#L323 should be updated.
there is no api
in require('zk').
TLDR: To filter notes by paths, use hrefs
, for example :ZkNotes {hrefs = {"<dir1>", "<dir2>"}}
.
ZkNotes
takes a single argument: a dictionary of options. So :ZkNotes <div> {}
is not correct.
To pass the first argument to zk.list
, we added an notebook_path
option in zk-nvim
. From the README:
The
options
parameter can be any valid Lua expression that evaluates to a table. For a list of available options, refer to thezk
docs. In addition,options.notebook_path
can be used to explicitly specify a notebook by providing a path to any file or directory within the notebook.
However, usually you don't need to mess with notebook_path
. It is not used to filter notes by path but to locate the notebook where the command is run. To filter notes by paths, you need to use hrefs
instead.
May the doc https://github.com/mickael-menu/zk-nvim/blob/main/doc/zk.txt#L323 should be updated.
there is no
api
in require('zk').
Yes I think it should be require("zk.api").list
instead. Do you confirm @kabouzeid? I'll update the doc if needed.
Thank you for your response. That's very helpful.
@mickael-menu yes that's correct
According to https://github.com/mickael-menu/zk/blob/main/docs/editors-integration.md#zklist
:ZkNotes <dir> {}
can't filter by the<dir>
, It lists all notes instead.require('zk').pick_notes({ notebook_path = '<dir>' })
has the same result.