Generate PDF (using pandoc and LaTeX)

nc13

#1

Hi!
I use a self-developed set of LaTeX and Pandoc templates to generate PDF documents from MD using Pandoc. The document configuration goes into MD document yaml header. This way all I need to generate a PDF from my markdown document is to run single command.

I’ve just installed latest NC on my RaspberryPi3 (using NextCloudPi) and would like to integrate my document workflow into NC.
Is this possible to add a button or keyboard shortcut to the markdown editor app (or even just context menu to NC’s file browser) which will just run the Pandoc command on the current file using Pandoc installed on my Raspbian?
I spend few hours looking for ways of implementing that but seems that accessing shell from NC is not possible.
Could you suggest the simplest solution (I have some programming skills)? I use my NC for internal purposes only.

EDIT: Would it be any easier if I had a local Pandoc server running on my RPi so that I could pack the md file and other resources into tar and run equivalent to:

curl -X POST \
-F "tar=@your-template.tgz" \
-F "tpl=mytemplate.tex" \
-F "m=@my-markdown-content.md" > out.pdf

Thanks!


#2

So finally I developed my own Pandoc interface.
I used Checksum plugin and changed it so that instead of generatig checksum it converts file formats.
I am not a web developer so this is as minimalistic as possible, just to work on my internal server.
I published it here https://github.com/mstankie/nextcloud-pandoc, in case someone may need similar system, but this in just for internal use on own risk.