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

ST3 user setting `transformations` not applied #70

Closed select closed 4 years ago

select commented 5 years ago

I added a new transform in the user settings file as follows

{
  "transformations": {
    "Media Wiki": {
      "new-buffer": 1,
      "scope": {
        "text.html": "html",
        "text.html.markdown": "markdown"
      },
      "pandoc-arguments": ["-t", "mediawiki"]
    }
  }
}

This setting however is completely ignored and not displayed in the transformation list. When I add this setting in the zipped package that sublime uses the transform appears and works without a problem.

In addition I would like to mention that there should be a lot more transforms available by default. Is there any reason why so little transforms are available?

MPvHarmelen commented 4 years ago

Firstly about your final question: I don't think there is any particular reason, except that no one has written them :) Feel free to submit a pull-request with any transformations you feel are missing.

About your problem: I think you are missing the user key. I have the following in User/Pandoc.sublime-settings, and that works for adding extra transformations:

{
    // 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.
    "user": {
        // transformations
        "transformations": {
            // label of transformation, to appear in sublime quick panel. This should
            // be a name related to the format of the output.