ChrisChinchilla / vscode-pandoc

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

add argument to pandoc.render to allow for skipping popup #12

Open classabbyamp opened 3 years ago

classabbyamp commented 3 years ago

This kind of ties into #8, but it would be nice to be able to specify a keybind to render without getting the popup window every time.

You can do something like

{
    "key": "f5",
    "command": "pandoc.render",
    "args": {"outputType": "pdf"},
    "when": "editorTextFocus && editorLangId == 'markdown'"
}

in keybindings.json and I believe the value of args will get passed to the command, like this:

-     var disposable = vscode.commands.registerCommand('pandoc.render', () => {
+     var disposable = vscode.commands.registerCommand('pandoc.render', (outputType: string) => {

and then some popup-skipping logic could be added or something.

Not 100% sure the details are right, this is just from my investigations into setting up a way to easily trigger a re-render.