Skip to content
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 Prepend and Append logic to Command buttons #169

Merged
merged 4 commits into from
Jan 31, 2024

Conversation

pangolinsec
Copy link
Contributor

Enhancing command buttons to enable them to prepend or append command output (relative to the button).

This PR effectively resolves Issue #119 (#119).
By assigning a template to a hotkey (a workaround proposed by ladyMonolid in the obsidian forum: https://forum.obsidian.md/t/buttons-with-templater-and-metaedit-trying-to-update-frontmatter-value-but-it-keeps-reverting/53384), command buttons can run a template.

Since this PR permits command buttons to now prepend or append content, it permits the same functionality of a prepend or append template button.

Add the buttonStart variable and pass it to the command.
Added buttonStart to the command

Added prepend logic to set cursor right before the button. This permits any output from the command to be prepended to the button.

Added append logic to set cursor right after the button (and after the button block id). This permits any output from the command to be appended to the button.Added buttonStart to the command

Added prepend logic to set cursor right before the button. This permits any output from the command to be prepended to the button.

Added append logic to set cursor right after the button (and after the button block id). This permits any output from the command to be appended to the button.
Adding a Default, a Prepend, and an Append option when creating a command button. Also storing that value.
@lightheaded
Copy link

@shabegom shabegom merged commit e439bb9 into shabegom:main Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants