rhysd / nyaovim-markdown-preview

Live Markdown Preview on NyaoVim
https://github.com/rhysd/NyaoVim
45 stars 8 forks source link

Pandoc #4

Open sencer opened 8 years ago

sencer commented 8 years ago

Would be awesome if it worked with pandoc --and perhaps also displays pdf.

rhysd commented 8 years ago

I think pdf.js is the easiest way for PDF preview and it should be a new plugin as nyaovim-pdf-preview. I want to make it but I'm working on making NyaoVim more stable.

About pandoc, I don't know because I'm not using pandoc. But child_process module is available in JavaScript and it is possible to execute pandoc command. It is executed in JavaScript context and does not block Neovim.

sencer commented 8 years ago

Perhaps then, there might be a variable like g:markdown_preview_command that is executed in the child_process module. I have seen some modules wrapping also pandoc, but I am not experienced with node, and not sure if they would do the job.

rhysd commented 8 years ago

Are you supposing that the command accepts file contents to stdin and outputs html to stdout? If so, I think I can add the variable to configure. If not, could you please describe more about the spec of the variable?

sencer commented 8 years ago

Yes, pandoc accepts stdin, and writes to stdout by default. So cat some.md|pandoc will output proper html.

It would be nice, though, to be able to use commandline arguments, like cat some.md|pandoc -F pandoc-citeproc.

Even better would be pandoc -F pandoc-citeproc some.md, since several pandoc related stuff, like panzer can write to stdout but do not read stdin as input.