-
Notifications
You must be signed in to change notification settings - Fork 39
Description
Currently, the vscode-pandoc extension does not expand VS Code variables like ${workspaceFolder} in settings such as pandoc.docxOptString or pandoc.pdfOptString.
For example:
"pandoc.docxOptString": "--reference-doc=${workspaceFolder}/templates/reference.docx"results in Pandoc receiving the literal string ${workspaceFolder} rather than the resolved path.
This makes it difficult to maintain portable workspace configurations or share templates located in a fixed subfolder.
Expected behaviour
VS Code variables (e.g. ${workspaceFolder}, ${fileDirname}, etc.) should be expanded before invoking Pandoc, matching how variable substitution works in tasks.json and launch.json.
Actual behaviour
Variables are passed literally to Pandoc.
Environment
- VS Code: (your version)
- vscode-pandoc: (extension version)
- OS: (Windows/macOS/Linux)
- Pandoc version: (output of
pandoc --version)
Why this matters
This would let users:
- Keep relative paths in project configuration.
- Avoid hard-coded absolute paths.
- Make multi-workspace and team setups cleaner.
Suggested solution
Use VS Code’s [variable resolver API](https://code.visualstudio.com/api/references/vscode-api#workspace) (e.g. vscode.workspace.getConfiguration() and vscode.workspace.workspaceFolders) to resolve variable placeholders in strings before invoking Pandoc.