Hello! First off I would like to thank you for this plugin, it has been of great use to me and so many others.
In the plugin settings, when you type Extra Pandoc Arguments, the conversion between the string and the actual command (line ~310 in the main.js file) is faulty. The " and ' are not applied properly, and the spaces essentially separate a single command in two.
I will give an example from your examples. Let's say we typed --bibliography "Zotero Exports\My Library.json". This would run
--bibliography "Zotero which does not exist, and the export will fail.
I found a work around for myself, and since I do not know any Java Script, I do think there are better ways of doing this. Specifically, I changed:
if (extraParams) {
for (let i = 0; i < extraParams.length; i++) {
let extraParam = extraParams[i].split('=');
args.push(extraParam[0], extraParam[1]);
}
}
This way you can only add arguments as --template=letter.tex (so the = is mandatory) and separate them by new lines, not spaces. Now you do not have a problem with --bibliography=Zotero Exports\My Library.json, meaning that even in a weird format, you get the full functionality of the argument settings.
I am hoping that with this issue report, we will eventually find a better work around on the main topic of " and '.
P.S. For extra ease, when calling pandoc, instead of passing the extra arguments as (line ~ 11280) this.settings.extraArguments.split('\n'), I pass them as this.settings.extraArguments.replace('$VAULT_PATH$', this.vaultBasePath()).split('\n'), allowing me to use the vault path, without writing it out. It would be a cool feature to add to later releases. This way I can define a new --data-dir=$VAULT_PATH\.pandoc for pandoc, which will be saved in the local vault folder and better reflects Obsidian's mentality of having everything local and in the same folder. I am sorry for getting slightly off topic with this.
Hello! First off I would like to thank you for this plugin, it has been of great use to me and so many others.
In the plugin settings, when you type Extra Pandoc Arguments, the conversion between the string and the actual command (line ~310 in the main.js file) is faulty. The
"
and'
are not applied properly, and the spaces essentially separate a single command in two.I will give an example from your examples. Let's say we typed
--bibliography "Zotero Exports\My Library.json"
. This would run--bibliography "Zotero
which does not exist, and the export will fail.I found a work around for myself, and since I do not know any Java Script, I do think there are better ways of doing this. Specifically, I changed:
to:
This way you can only add arguments as
--template=letter.tex
(so the=
is mandatory) and separate them by new lines, not spaces. Now you do not have a problem with--bibliography=Zotero Exports\My Library.json
, meaning that even in a weird format, you get the full functionality of the argument settings.I am hoping that with this issue report, we will eventually find a better work around on the main topic of
"
and'
.P.S. For extra ease, when calling pandoc, instead of passing the extra arguments as (line ~ 11280)
this.settings.extraArguments.split('\n')
, I pass them asthis.settings.extraArguments.replace('$VAULT_PATH$', this.vaultBasePath()).split('\n')
, allowing me to use the vault path, without writing it out. It would be a cool feature to add to later releases. This way I can define a new--data-dir=$VAULT_PATH\.pandoc
for pandoc, which will be saved in the local vault folder and better reflects Obsidian's mentality of having everything local and in the same folder. I am sorry for getting slightly off topic with this.