Pandoc can convert documents in markdown etc. to HTML etc..
It can be worked well in cmd or bat file.
I want to use Pandoc in Mathematica 10 on Windows7, but it doesn't work.
Method 1:
Export["E:/test.md", "# abcd", "Text"];
Export["E:/test.bat", "pandoc test.md -f markdown -t html -s -o test.html", "Text"];
Run["E:/test.bat"];(*Nothing is done*)
Patch: It workes well, if I run "test.bat" on Windows.
Method 2:
process = StartProcess[$SystemShell];
WriteLine[process, "E:"];
WriteLine[process, "md abcd"];
WriteLine[process, "cd abcd"];
WriteLine[process, "echo # abcd >> test.md"];
WriteLine[process, "pandoc test.md -f markdown -t html -s -o test.html"];(*Nothing is done*)
WriteLine[process, "exit"];
KillProcess /@ Processes[];
Patch: The path of Pandoc is in Environment["PATH"]
.
The Right Way for Method 2:
SetDirectory["E:/"];
process = StartProcess[$SystemShell];
WriteLine[process, "E:"];
WriteLine[process, "md abcd"];
WriteLine[process, "cd abcd"];
WriteLine[process, "echo # abcd >> test.md"];
WriteLine[process, "pandoc test.md -f markdown -t html -s -o test.html"];(*This is Worked*)
WriteLine[process, "exit"];
KillProcess /@ Processes[];
Method 1 (Corrected):
SetDirectory["E:/"];
Export["E:/test.md", "# abcd", "Text"];
Export["E:/test.bat", "pandoc test.md -f markdown -t html -s -o test.html", "Text"];
Run["E:/test.bat"];