Files
plainleaf/website/API/slashcommand.md
T
Zef Hemel 2ac30edb2f Update configuration documentation and remove deprecated templates
- Enhanced the `Config.md` documentation to clarify built-in configuration options and the use of the `config.set` API.
- Removed outdated `Page Template.md` and `Slash Template.md` files to streamline documentation and avoid confusion.
- Updated references in various documentation files to reflect the removal of deprecated templates and ensure consistency across the site.
2025-04-17 11:55:09 +02:00

510 B

APIs to create Slash Commands. For simple cases it is recommended to use Library/Std/Slash Templatese 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:

slashcommand.define {
  name = "hello-world",
  run = function()
editor.insertAtCursor("Hello |^| world!", false, true)
  end
}