ChrisChinchilla / vscode-pandoc

Visual Studio Code extension lets you render markdown to pdf, word doc or html with pandoc
MIT License
26 stars 13 forks source link

Feature request: configuration "profiles" #3

Open tonypapousek opened 4 years ago

tonypapousek commented 4 years ago

I author and render out documents for multiple clients. Each client uses a different branded docx template (i.e. ~/path/to/client1/docs/template.docx and ~/path/to/client2/docs/template.docx). Currently, switching between clients requires editing the vscode config every time and is prone to typos.

I'd like to define different "profiles" to simplify this process that can be selected when running the extension (i.e. Pandoc Render -> Select Client -> Output Format).

As far as configuration goes, adding a profiles object could facilitate this while keeping the current keys as a default profile. For example:

"pandoc.profiles" = {
   "client1": {
       "docxOptString" : "~/path/to/client1/docs/template.docx"
    },
   "client2": {
       "docxOptString" : "~/path/to/client2/docs/template.docx"
    }
}

"pandoc.defaultProfile" = "client1" // Fall back to current keys if this doesn't exist.

Parsing logic:

If pandoc.profiles.client1 doesn't exist, fall back to pandoc.docxOptString as default.

If pandoc.profiles doesn't exist (or Object.keys(pandoc.profiles) is empty), use the current extension behavior and don't list profiles.

Btw, thanks for maintaining this extension!