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
136 stars 26 forks source link

Custom format configuration to render html with table of contents #9

Closed py closed 11 years ago

py commented 11 years ago

I am attempting to recreate this pandoc command:

pandoc -i input.md -s --toc -o output.html

by editing the Pandoc.sublime-settings, and I cannot get it to work. Ideally, I would like to create a new output format (html_toc), but have not been able to successfully generate the html with toc.

I tried this, to no avail:

  "format_html": {
    "scope": "text.html",
    "syntax_file": "Packages/HTML/HTML.tmLanguage",
    "to": ["-s", "--toc", "-o"]
  }

Any suggestions? Thank you for this plugin - I use it daily.

tbfisher commented 11 years ago

Don't add any of the Pandoc General options in the "to" list. Try

"format_html": {
  "scope": "text.html",
  "syntax_file": "Packages/HTML/HTML.tmLanguage",
  "to": ["-s", "--toc"]
}