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

Compile Step: Standard Obsidian commands #283

Open
tryonkus opened this issue Jan 6, 2025 · 1 comment
Open

Compile Step: Standard Obsidian commands #283

tryonkus opened this issue Jan 6, 2025 · 1 comment
Labels
compile Pertaining to the Compile feature. enhancement New feature or request

Comments

@tryonkus
Copy link

tryonkus commented Jan 6, 2025

What should this step do?
Run an arbitrary Obsidian command

Should this step affect scenes, manuscripts, or join the two?
After the compile is finished, I'd like to be able to execute standard Obsidian commands on the compiled manuscript.

I'm using Commander to build basic macros, including Regex Pipeline to prepare text for publishing and micro.publish to publish to micro.blog. I can include a Longform command to compile the current project with the default workflow, which avoids any user input. I'm having issues with steps that do require user input—the macro doesn't know to wait until after the input is entered and the command is completed, so I need to estimate how long it will take and add a delay of X milliseconds.

The advantages to scripting in Longform would be:

  • The script would execute as part of my compile process.
  • I'm hoping Longform would handle step completion better (this could be a limit of the Obsidian API).
  • I wouldn't have to write my own Javascript (getting there, but I've got some learning to do).

I'm guessing I can execute Obsidian commands from a Javascript user step, and the simple answer to this might be to point me to documentation of how to do that. I've learned enough JS to write fairly sophisticated Templater templates, and I could buckle down and learn enough to write a user step. 😏

Thanks for any suggestions you can provide.

@tryonkus tryonkus added compile Pertaining to the Compile feature. enhancement New feature or request labels Jan 6, 2025
@kevboh
Copy link
Owner

kevboh commented Jan 8, 2025

Yes, this is definitely a custom user step, the docs for which are here. I don't know off the top of my head how to call a command directly from the Obsidian API, but I think it's doable. I don't have time atm to actually write the step, but please let me know if you get stuck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compile Pertaining to the Compile feature. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants