Files
plainleaf/website/API/slashcommand.md
T
Zef Hemel 34557e0575 Update documentation for consistency and clarity
- Revised multiple documentation files to correct references and improve clarity, including updates to the Command Palette, Document Editor, and various Markdown files.
- Removed outdated references to "Slash Templatese" and replaced them with "Slash Templates" for consistency.
- Enhanced explanations regarding meta pages and shortcuts, ensuring accurate guidance for users.
2025-04-17 12:04:20 +02:00

21 lines
509 B
Markdown

APIs to create [[Slash Commands]]. For simple cases it is recommended to use [[Library/Std/Slash Templates]] instead.
## slashcommand.define(spec)
Define a custom slash command.
Supported keys in the spec:
* `name`: name of the command
* `description`: Description of the command
* `run`: The callback function that will be invoked once the command is run.
Example:
```lua
slashcommand.define {
name = "hello-world",
run = function()
editor.insertAtCursor("Hello |^| world!", false, true)
end
}
```