Skip to content

Commit

Permalink
Add command documentation and fix RoamUpdate to scan by default
Browse files Browse the repository at this point in the history
  • Loading branch information
chipsenkbeil committed Apr 24, 2024
1 parent c6954c9 commit bfe8686
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 2 deletions.
81 changes: 81 additions & 0 deletions DOCS.org
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,87 @@
})
#+end_src

* Commands

** RoamAddAlias

:RoamAddAlias [<ARGS>]

Description:

Adds an alias to the node under the cursor.

If arguments are supplied, they are used as the alias; otherwise, a prompt
is provided to specify the alias.

** RoamAddOrigin

:RoamAddOrigin [<ARGS>]

Description:

Adds/replaces the origin to the node under the cursor. Opens a selection
dialog to pick the node to act as the origin.

If arguments are supplied, they are used as the initial input to the
selection dialog.

** RoamRemoveAlias

:RoamRemoveAlias [<ARGS>]

Description:

Removes an alias for the node under the cursor. Opens a selection
dialog to pick the alias to remove.

If arguments are supplied, they are used as the initial input to the
selection dialog.

** RoamRemoveOrigin

:RoamRemoveOrigin [<ARGS>]

Description:

Removes the origin for the node under the cursor.

** RoamReset

:RoamReset [sync]

Description:

Resets the roam database, wiping and rebuilding it.

If =sync= argument is provided, will perform the reset synchronously.

** RoamSave

:RoamSave[!] [sync]

Description:

Save the roam database to disk. If no changes to the database have occurred
since last save, nothing happens.

If =!= is provided, will force saving.

If =sync= argument is provided, will perform the save synchronously.

** RoamUpdate

:RoamUpdate[!] [sync]

Description:

Updates the roam database, checking every existing file for changes.

If =!= is provided, will perform a complete recheck of the database
for changes found on disk including new and deleted files.

If =sync= argument is provided, will perform the update synchronously.

* User Interface

** Org Roam Buffer
Expand Down
3 changes: 1 addition & 2 deletions lua/org-roam/setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ local function define_commands(roam)
profiler:start()

log.fmt_debug("Updating database (force = %s, sync = %s)", force, sync)
local promise = roam.database:load({ force = force }):next(function(...)
local promise = roam.database:load({ force = force or "scan" }):next(function(...)
local tt = profiler:stop():time_taken_as_string()
notify.info("Updated database [took " .. tt .. "]")
return ...
Expand Down Expand Up @@ -216,7 +216,6 @@ local function define_commands(roam)
vim.api.nvim_create_user_command("RoamRemoveOrigin", function()
roam.api.remove_origin()
end, {
bang = true,
desc = "Removes an origin from the current node under cursor",
})
end
Expand Down

0 comments on commit bfe8686

Please sign in to comment.