Home Download Buy Blog Forum Support

Pandoc build system

Pandoc build system

Postby quodlibet on Wed Feb 15, 2012 8:36 am

I can use Pandoc on the commandline to convert .md files to .html but I would like to have a build system for this.

My attempt at a build system is as follows:

Code: Select all
   "cmd": ["pandoc", "-S -s -f markdown -t html -o $file_base_name.html $file"],
   "source": "md"


This works but it ignores the "-S -s" options and I can't figure out why.

I have had similar problems setting up multimarkdown and textile, which means I am doing something silly, but I can't figure out what it is.

I have also looked at the "Pandoc (Markdown)" package which is available through Package Control, but it fails to find a "template.html".

Any help would be much appreciated.

Alex
quodlibet
 
Posts: 554
Joined: Sat Jun 18, 2011 5:53 pm

Re: Pandoc build system

Postby jps on Wed Feb 15, 2012 11:51 am

You need to pass arguments as separate strings, rather than as a single space separated string
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm

Re: Pandoc build system

Postby quodlibet on Wed Feb 15, 2012 1:04 pm

Thanks for the quick answer. I should have found the docs at: http://sublimetext.info/docs/en/core/build_systems.html

Now I've encountered this:

Code: Select all
Running Q:\APPS\Pandoc\bin\pandoc.exe -S -s -f markdown -t html -o C:\EN2305-C-4.md.html C:\EN2305-C-4.md
Traceback (most recent call last):
  File ".\sublime_plugin.py", line 325, in run_
  File ".\exec.py", line 145, in run
TypeError: __init__() got an unexpected keyword argument 'source'


I've tried to be as explicit as possible and have kept the paths simple because pandoc was choking up.

Any ideas on what's causing the error?

I may be missing something very obvious, because I am giddy at the fact that it was Jon that replied.

(I am using build 2178, if that makes any difference.)
quodlibet
 
Posts: 554
Joined: Sat Jun 18, 2011 5:53 pm

Re: Pandoc build system

Postby bizoo on Wed Feb 15, 2012 1:29 pm

FWIK, there's no "source" parameter for the buld command.
Do you mean "selector" ?

Like you already said, look at the doc and the existing build system files.
bizoo
 
Posts: 889
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Pandoc build system

Postby quodlibet on Wed Feb 15, 2012 2:46 pm

Thank you bizoo!

The following seems to work:

Code: Select all
   "cmd": ["pandoc", "-S", "-s", "-f", "markdown", "-t", "html", "-o", "$file_base_name.html", "$file_name"],
   "selector": "text.html.markdown"
quodlibet
 
Posts: 554
Joined: Sat Jun 18, 2011 5:53 pm


Return to General Discussion

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 19 guests