Open AnnanFay opened 7 years ago
I've been trying to do this too. If you use the following configuration, you'll have the shortcut but it will still show the prompt;
{
"keys": ["ctrl+shift+k"],"command": "prompt_pandoc"
},
I think in order to be able to give it the text argument with the name of the transformation, some modifications need to be done in the code or another function would need to be created because the transformation
argument in the run
function that is being called is in fact a dictionary.
While writing this answer, and based on your example, I figure out you can actually do this in a "not-so-pretty" way by giving explicitly the dictionary with the settings as the argument. I use html
syntax but you would just have to copy your pdf
settings here:
{
//"keys": ["ctrl+shift+k"],"command": "prompt_pandoc"
"keys": ["ctrl+shift+k"],
"command": "pandoc",
"args":
{
"transformation":
{
"new-buffer": 1,
"scope": {
"text.html.markdown": "markdown",
"text.html": "html",
},
"out-ext": "html",
"pandoc-arguments": [
"--to=html5",
"--no-highlight",
"--output=output.html",
"--self-contained",
"--standalone"
]
}
}
},
I would also love to be able to do this. It seems like there's a fork that has solved this problem: https://github.com/geniusupgrader/Spandoc, maybe someone could look into how much work it is to port their solution?
It seems quite easy, this is the commit: https://github.com/geniusupgrader/Spandoc/commit/438abafc8bb99d0cda96538875b8685cd1bb029f
Hello,
Right now I'm using this to convert markdown to PDF. This is the only way I'm using this.
Is there a way to avoid the dropdown option every time? As I want to convert to PDF every time I use this.
Also, is there a way I can link this into the build system? So I can just click Ctrl+B when editing markdown and auto generate the PDF?
Maybe I'm using this extension incorrectly or there's an alternative. I've had a quick look at the settings file and couldn't find an option.
I've tried setting up a hotkey:
However this fails with: