Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run commands from outside a notebook directory #13

Closed
mickael-menu opened this issue Mar 17, 2021 · 1 comment · Fixed by #14
Closed

Run commands from outside a notebook directory #13

mickael-menu opened this issue Mar 17, 2021 · 1 comment · Fixed by #14
Labels
enhancement New feature or request
Projects

Comments

@mickael-menu
Copy link
Member

There has been some discussions around the best way to manage a global notebook.

Declaring in the global configuration file a default notebook would go against the design of zk in my opinion. A notebook is like a Git repository, with a .zk marker similar to .git.

However, it could be interesting to specify from the command line the notebook where zk commands are run. There is a precedent with Git, which provides --git-dir and --work-tree.

I suggest specifying the path to the notebook with (in order of precedence):

  • --notebook-dir <path>
  • current working directory (or its parents)
  • ZK_NOTEBOOK_DIR env variable

To simplify, any relative path provided as arguments would be relative to the notebook directory (when set explicitly), which allows stuff like:

$ zk list --exclude journal --notebook-dir ~/notes

In practice, that means that someone using a single notebook can set it as a "default global one" with ZK_NOTEBOOK_DIR in ~/.profile.

@mickael-menu mickael-menu added the enhancement New feature or request label Mar 17, 2021
@mickael-menu mickael-menu added this to Backlog in zk via automation Mar 17, 2021
@megalithic
Copy link

Exactly this!

zk automation moved this from Backlog to Done Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
zk
Done
Development

Successfully merging a pull request may close this issue.

2 participants