Using a script to call pandoc with the pandoc plugin

Hi,

I’m using the Pandoc plugin and depending on where I am in my vault, sometimes I want to convert with specific options; other times, I want to use the defaults.

The way the Pandoc plugin works, I have to specify any command-line option (–defaults) in the global setting. If the file isn’t present in a folder, the whole thing fails.

I would like the ability to set a default local config file and have Pandoc load it if it’s there and apply whatever the rules of --defaults are. Otherwise, it uses the global defaults.

I tried creating a Powershell script and using that as the path but when I execute it, nothing happens.

Maybe I’m not doing it right (I’m not a PowerShell/Windows expert; I’m more comfortable with Linux CLI but…) or maybe this use case is unsupported.

Thanks,

L

Maybe you need to mark the script file as executable? I’m not familiar with how this stuff works on Windows, but on Mac and Linux that’s a thing that needs to be done.

On Windows the extension of the file determines what you can do with it. When you “execute” a file from the command line, it runs it with the default program associated with the extension. I tried with PowerShell and CMD (the equivalen of bash, I guess) but neither of them work. It looks like the extension requires the executable binary (an exe file).

While researching this, I saw that there is an extension to execute arbitrary commands from within Obsidian. I might end up using that and creating my own version of the Pandoc plugin. Or, at least, a reasonable facsimile.

However, if someone has found a way to do this with the original plugin, I’m still open to it.

Thanks,

L

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.