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
Add command to save graph to disk #4330
Conversation
:fn (fn [] (state/set-state! :ui/open-select :graph-remove)) | ||
:binding false} | ||
|
||
:graph/add {:desc "Add a graph" | ||
:fn (fn [] (route-handler/redirect! {:to :repo-add})) | ||
:binding false} | ||
|
||
:graph/save {:desc "Save current graph to disk" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mentioned "to disk" because I thought it's helpful for users to understand what save means. I'm open to suggestions on better wording
:fn (fn [] (state/set-state! :ui/open-select :graph-remove)) | ||
:binding false} | ||
|
||
:graph/add {:desc "Add a graph" | ||
:fn (fn [] (route-handler/redirect! {:to :repo-add})) | ||
:binding false} | ||
|
||
:graph/save {:desc "Save current graph to disk" | ||
:fn #(state/pub-event! [:graph/save]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if users could define commands in config.edn to route to any event. I've updated https://quire.io/w/Logseq-_team_dedicated_to_sport_of_knowledge/189/Define_shortcuts_commands_in_config to capture this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR adds a command to save the current graph to
~/.logseq/graphs
. This is useful for power users as it allows them to develop and use applications directly against the datascript db. I'm writing a personal CLI to use an updated datascript db. I added this command because the only other way I saw to persist the db was to quit the app which isn't user friendly