tbfisher / sublimetext-Pandoc

A Sublime Text plugin that uses Pandoc to convert text from one markup format into another. Pandoc can convert documents in markdown, reStructuredText, textile, HTML, DocBook, LaTeX, MediaWiki markup, OPML, or Haddock markup to XHTML, HTML5, HTML slide shows using Slidy, reveal.js, Slideous, S5, or DZSlides, Microsoft Word docx, OpenOffice/LibreOffice ODT, OpenDocument XML, EPUB version 2 or 3, FictionBook2, DocBook, GNU TexInfo, Groff man pages, Haddock markup, OPML, LaTeX, ConTeXt, LaTeX Beamer slides, PDF via LaTeX, Markdown, reStructuredText, AsciiDoc, MediaWiki markup, Emacs Org-Mode, Textile, or custom writers can be written in lua.
MIT License
137 stars 26 forks source link

save generated file in current folder #33

Closed mk-uc closed 4 years ago

mk-uc commented 8 years ago

Is there a way to have this automatically save the generated file in same folder as the source file. And also to create it with the same name as the source file? This would make the process much smoother.

vongoh commented 8 years ago

+1

It is generating these files in an /appdata/local/temp folder, can we get some control over that from in this plugin? Where can we pass options and switches to the exe? Thanks

excetara2 commented 8 years ago

+1

I was just looking up if this was possible. It seems it wouldn't be hard to implement but I haven't looked at the code. If I get some time I might try to generate a pull request.

JimAmuro commented 8 years ago

+1 It should be very useful, but it seems the "$file referring to current file" sublime text trick cannot be used in the pandoc arguments... Don't know how to do next.

excetara2 commented 8 years ago

Why can't it be used in the arguments? Yes it can't be added in the settings file. But if you have a setting in the settings file that states output in current folder. I don't see why in the plug in you can't get the current directory and file and append to the cmd argument list and check the argument list to make sure no output file is already specified. It already must append a temporary file if no output is detected so this would just need to be modified. I haven't looked at the code but this is what it seems like.

JimAmuro commented 8 years ago

@excetara2 Sorry, I am new in tweaking ST settings... I just know $file can be used in cmd arguments. And if you use it here in pandoc-arguments it shall be just interpreted as pure string instead of the file path. Hope you can make a PR and I will learn from it. Thanks!

excetara2 commented 8 years ago

Okay I've implemented this but didn't fork it but maybe next weekend as I have a busy week. It was all of two lines. I put two settings: one that can be implemented locally within each function called save-current-folder and then a global setting always-use-current-folder. Even though global, This function is only true when new-buffer or output-path are not explicitly set. I initially had only a local setting but thought some people may prefer never to save to a temporary file.

excetara2 commented 8 years ago

I need to modify this further actually. I must have only edited the section pertaining to output to pdf because that works flawless. Output to any other format doesn't. I have only been outputting to pdf because usually use live preview for viewing html.

f8ttyc8t commented 7 years ago

Sorry for bothering... Improvement mentioned/done by @jhultgre is't already part of this package, right? How could I get this update using packagecontrol.io? Because this would be my preferred way.

Thanks in advance!

MPvHarmelen commented 4 years ago

Fixed. See #64.