Skip to content

Commit

Permalink
Fix attachmentFolderPath and remove unncessary command template argum…
Browse files Browse the repository at this point in the history
…ents (#174)

* Make attachmentFolderPath an absolute path

* Remove unnessesary standalone arguments

* Fix mistake so -s is removed from the PDF command, not the textbundle command
  • Loading branch information
FeralFlora authored May 14, 2024
1 parent 773502b commit 4b28fb2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/export_templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default {
name: 'PDF',
type: 'pandoc',
arguments:
'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/pdf.lua" ${ options.textemplate ? `--resource-path="${pluginDir}/textemplate" --template="${options.textemplate}"` : ` ` } -s -o "${outputPath}" -t pdf',
'-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" --lua-filter="${luaDir}/pdf.lua" ${ options.textemplate ? `--resource-path="${pluginDir}/textemplate" --template="${options.textemplate}"` : ` ` } -o "${outputPath}" -t pdf',
customArguments: '--pdf-engine=pdflatex',
optionsMeta: {
'textemplate': 'preset:textemplate', // reference from `PresetOptionsMeta` in `src/settings.ts`
Expand All @@ -68,13 +68,13 @@ export default {
'Word (.docx)': {
name: 'Word (.docx)',
type: 'pandoc',
arguments: '-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t docx',
arguments: '-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -o "${outputPath}" -t docx',
extension: '.docx',
},
'OpenOffice': {
name: 'OpenOffice',
type: 'pandoc',
arguments: '-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t odt',
arguments: '-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -o "${outputPath}" -t odt',
extension: '.odt',
},
'RTF': {
Expand All @@ -86,7 +86,7 @@ export default {
'Epub': {
name: 'Epub',
type: 'pandoc',
arguments: '-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -s -o "${outputPath}" -t epub',
arguments: '-f ${fromFormat} --resource-path="${currentDir}" --resource-path="${attachmentFolderPath}" -o "${outputPath}" -t epub',
extension: '.epub',
},
'Latex': {
Expand Down
2 changes: 2 additions & 0 deletions src/exporto0o.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ export async function exportToOo(
attachmentFolderPath = vaultDir;
} else if (attachmentFolderPath.startsWith('.')) {
attachmentFolderPath = path.join(currentDir, attachmentFolderPath.substring(1));
} else {
attachmentFolderPath = path.join(vaultDir, attachmentFolderPath);
}

let frontMatter: unknown = null;
Expand Down

0 comments on commit 4b28fb2

Please sign in to comment.