joostkremers / pandoc-mode

An Emacs minor mode for interacting with Pandoc.
https://joostkremers.github.io/pandoc-mode/
177 stars 14 forks source link

Passing custom options to pandoc from the menu #54

Closed japhir closed 8 years ago

japhir commented 8 years ago

Hi there!

This might be me, who hasn't figured out the weird directives correctly yet, but I'd like to be able to pass extra arguments to pandoc from the hydra menu. Because right now I need to create a separate makefile with the correct options, meaning I have to go to the command line, cd to the directory and run the file in stead of C-c / r.

The option I want to pass is --filter=pandoc-fignos (to implement figure numbering in the way that will probably be added to pandoc in the future, see pandoc fignos on github).

Is this already possible and am I missing something or is this currently not possible?

Kind regards

joostkremers commented 8 years ago

Filters can be specified in the reader options submenu (C-/ o r).

I don't use filters myself, so I've never actually tested this functionality very thoroughly. If it does not work as advertised, please let me know so I can fix it.

japhir commented 8 years ago

Awesome, it works even though the option asks for a file in stead of a string. But when passing "pandoc-fignos" as an argument it does work.

On 12 October 2015 at 12:30, Joost Kremers notifications@github.com wrote:

Filters can be specified in the reader options submenu (C-/ o r).

I don't use filters myself, so I've never actually tested this functionality very thoroughly. If it does not work as advertised, please let me know so I can fix it.

— Reply to this email directly or view it on GitHub https://github.com/joostkremers/pandoc-mode/issues/54#issuecomment-147360474 .

joostkremers commented 8 years ago

Hmm, perhaps I should change the type of that option from file to string, since Pandoc expects a filter to be the name of an executable and searches for it in $PATH. If a user wants to specify a file path, that would still be possible, there just wouldn't be any file name completion.

japhir commented 8 years ago

I'm not sure, this was also the first time I used a filter and I don't know if people usually install them and just pass the string-argument or put them in a folder and pass the location argument.

joostkremers commented 8 years ago

I've made some changes to the way file options are handled that should improve this situation. Now, file options are stored as relative file paths and not expanded. Setting a filter should now be easier.