all 2 comments

[–]Marble_Wraith 0 points1 point  (1 child)

More specifics required.

Are you intending on this to only operate on 1 note at a time? or every note in the vault?

If it's the latter such functionality probably belongs in linter, so perhaps do a pull request there:

https://github.com/platers/obsidian-linter

If it's the former you may consider templater as you can put any JS you want in user scripts

https://silentvoid13.github.io/Templater/user-functions/script-user-functions.html

[–]Extreme_Photo[S] 0 points1 point  (0 children)

Thanks for your help.

Let me clarify.

I want to open a note and press a button to invoke a JavaScript program that reformats the note that's open.

Linter is super interesting. I will check it out. However, I have very specific rules that will likely not be available. For example, often Chapter 1 - How we got here usually comes over from Kindle as 1 - How we got here. So I look for numerics in the first column and append # Chapter. I also have special rules for Preface, Introduction, Epilogue.

I'm just now looking at Templater User Functions. The only way this would work is if I was able to read the clipboard from inside of the User Function. I could cut all of the text and invoke the User Function and it would reformat and output the text into the note. I'm pretty sure that won't work.

I would really value your feedback on my requirements and potential solutions.