Buttons
Button are well… Buttons, inside your notes. They can be configured to do a variety of things, like opening a file, running a command, or even running a JavaScript file.
Creating a button
To create a button, you need to create a code block with the language set to meta-bind-button
.
The inside of the code block belongs the configuration in YAML format for the button.
The following example button displays Meta Bind Help
and opens the meta bind FAQ page.
Inline Buttons
Inline buttons are buttons that are displayed inline with the text.
They are created using inline code blocks starting with BUTTON
.
Inline buttons must reference a button code block defined elsewhere in the same note via matching ids.
Buttons declared in the plugin’s settings under Button Templates
can be referenced by inline buttons in every note.
The following example button inline button references the code block button with the help-button
id below it.
By referencing the button code block, the inline button will have the same configuration as the code block button.
The code block button can be hidden by setting the hidden
YAML property to true
.
Button Groups
Inline buttons can display multiple buttons in a row.
For this, multiple button ids separated by commas need to be passed to the BUTTON
inline code block.
The following example displays a button group of two buttons.
Button Configuration
Button Properties
The YAML configuration of a button has must follow the following TypeScript interface.
action
and actions
are mutually exclusive, meaning that only one of them can be used.
Button Actions
Button actions can require multiple properties depending on the type of action, but every action has a type
property, by which it is identified.
A list of button actions and their required properties can be found in the sidebar under Reference -> Button Actions
.