Skip to content
Discussion options

You must be logged in to vote

Using the API, I came out with this solution:

    local commands = require("zk.commands")

    commands.add("ZkDir", function(options)
      options = options or {}
      local dir = options.dir or "journal/daily"

      require("zk.api").list(nil, {
        select = { "absPath", "path", "title", "created", "modified" },
      }, function(err, notes)
        if err then
          vim.notify("Error fetching notes: " .. vim.inspect(err), vim.log.levels.ERROR)
          return
        end

        -- Filter notes after retrieval and ensure valid paths
        local filtered_notes = {}
        for _, note in ipairs(notes) do
          -- Check both that path exists and matches our directory

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tjex
Comment options

tjex Jun 22, 2025
Maintainer

@idr4n
Comment options

Answer selected by idr4n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants