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

Running Pandoc ST3 fails #59

Open colinbes opened 7 years ago

colinbes commented 7 years ago

I am running MacOS Sierra 10.12.3, Sublimetext 3 build 3126 and have install Pandoc plugin in order to convert markdown to PDF.

I have installed Pandoc .19.2.1 via Homebrew.

If I open Pandoc (using shift+CMD+P), typing 'pandoc' to select pandoc and then hit enter I get error message in console stating:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 797, in run_
    return self.run()
  File "Pandoc in /Users/cb/Library/Application Support/Sublime Text 3/Installed Packages/Pandoc.sublime-package", line 45, in run
  File "Pandoc in /Users/cb/Library/Application Support/Sublime Text 3/Installed Packages/Pandoc.sublime-package", line 54, in transformations
  File "Pandoc in /Users/cb/Library/Application Support/Sublime Text 3/Installed Packages/Pandoc.sublime-package", line 215, in _s
KeyError: 'transformations'

I am pretty sure I have had this running before.

Assistance appreciated.

Colin

MariannaAtPlay commented 6 years ago

I am having a similar issue - Just trying to install the package for the first time. Windows 10. Installed through Package Control. When I try to run the command from the palette, there is no output. But there is an error in the console:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 797, in run_
    return self.run()
  File "Pandoc in C:\Users\marianna.shvartsapel\AppData\Roaming\Sublime Text 3\Installed Packages\Pandoc.sublime-package", line 45, in run
  File "Pandoc in C:\Users\marianna.shvartsapel\AppData\Roaming\Sublime Text 3\Installed Packages\Pandoc.sublime-package", line 54, in transformations
  File "Pandoc in C:\Users\marianna.shvartsapel\AppData\Roaming\Sublime Text 3\Installed Packages\Pandoc.sublime-package", line 215, in _s
KeyError: 'transformations'

My settings file:

{

  // There are 2 possible top level settings keys, "user" and "default". If you
  // use "default" in your user settings file, the default settings will be
  // overwritten, but if you use "user" your settings will be merged into the
  // default settings.
  "default": {

    // path to the pandoc binary. Default locations per platform:
    // -  mac
    //    "pandoc-path": "/usr/local/bin/pandoc",
    // -  windows
    //    "pandoc-path": "C:/Users/[username]/AppData/Local/Pandoc/pandoc.exe",
    "pandoc-path": "C:/Users/marianna.shvartsapel/AppData/Local/Pandoc/pandoc.exe"
  }
}
antonio-gil commented 6 years ago

I also have this issue too. And as the the same as @MariannaAtPlay I installed the plug-in through Package Control.

Console Output:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 797, in run_
    return self.run()
  File "Pandoc in C:\Users\a-gil\AppData\Roaming\Sublime Text 3\Installed Packages\Pandoc.sublime-package", line 45, in run
  File "Pandoc in C:\Users\a-gil\AppData\Roaming\Sublime Text 3\Installed Packages\Pandoc.sublime-package", line 54, in transformations
  File "Pandoc in C:\Users\a-gil\AppData\Roaming\Sublime Text 3\Installed Packages\Pandoc.sublime-package", line 215, in _s
KeyError: 'transformations'

Also, I have the same configuration (sans the username) as @MariannaAtPlay .


antonio-gil commented 6 years ago

Well, I tried something to understand what is happening...

I copied all the settings into the user settings file (not only the config for the executable path) and it worked as intended: it showed the format selection dialog, and generated the expected file. So, I guess that the plugin reads either the default settings OR the user settings, not both (as with other plugins).

Not sure if @MariannaAtPlay and @colinbes are still interested in testing this workaround, but if anyone else is having the same issue, I hope this can be of some help.

Regards.

runxel commented 4 years ago

I had the same issue. All you have to do is change the default into user. Then it will work. (or do as @antonio-gil suggested)

This is strange behaviour indeed and very "un-sublimy". Never seen anything like this.