1
+ using pandoc_jll
2
+
3
+
1
4
function write_doc (docformat:: Pandoc2HTML , doc, rendered, out_path)
2
5
_, weave_source = splitdir (abspath (doc. source))
3
6
weave_version, weave_date = weave_info ()
@@ -20,21 +23,23 @@ function write_doc(docformat::Pandoc2HTML, doc, rendered, out_path)
20
23
try
21
24
out = basename (out_path)
22
25
highlight_stylesheet = get_highlight_stylesheet (MIME (" text/html" ), docformat. highlight_theme)
23
- cmd = ` pandoc -f markdown+raw_html -s --mathjax=""
24
- $filt $citeproc $(docformat. pandoc_options)
25
- --template $(docformat. template_path)
26
- -H $(docformat. stylesheet_path)
27
- $(self_contained)
28
- -V highlight_stylesheet=$(highlight_stylesheet)
29
- -V weave_version=$(weave_version)
30
- -V weave_date=$(weave_date)
31
- -V weave_source=$(weave_source)
32
- -V headerscript=$(header_script)
33
- -o $(out) `
34
- proc = open (cmd, " r+" )
35
- println (proc. in, rendered)
36
- close (proc. in)
37
- proc_output = read (proc. out, String)
26
+ pandoc () do pandoc_exe
27
+ cmd = ` $(pandoc_exe) -f markdown+raw_html -s --mathjax=""
28
+ $filt $citeproc $(docformat. pandoc_options)
29
+ --template $(docformat. template_path)
30
+ -H $(docformat. stylesheet_path)
31
+ $(self_contained)
32
+ -V highlight_stylesheet=$(highlight_stylesheet)
33
+ -V weave_version=$(weave_version)
34
+ -V weave_date=$(weave_date)
35
+ -V weave_source=$(weave_source)
36
+ -V headerscript=$(header_script)
37
+ -o $(out) `
38
+ proc = open (cmd, " r+" )
39
+ println (proc. in, rendered)
40
+ close (proc. in)
41
+ read (proc. out, String)
42
+ end
38
43
catch
39
44
rethrow () # TODO : just show error content instead of rethrow the err
40
45
finally
@@ -58,14 +63,16 @@ function write_doc(docformat::Pandoc2PDF, doc, rendered, out_path)
58
63
cd (dirname (out_path))
59
64
try
60
65
out = basename (out_path)
61
- cmd = ` pandoc -f markdown+raw_tex -s --pdf-engine=xelatex --highlight-style=tango
62
- $filt $citeproc $(docformat. pandoc_options)
63
- --include-in-header=$(docformat. header_template)
64
- -V fontsize=12pt -o $(out) `
65
- proc = open (cmd, " r+" )
66
- println (proc. in, rendered)
67
- close (proc. in)
68
- proc_output = read (proc. out, String)
66
+ pandoc () do pandoc_exe
67
+ cmd = ` $(pandoc_exe) -f markdown+raw_tex -s --pdf-engine=xelatex --highlight-style=tango
68
+ $filt $citeproc $(docformat. pandoc_options)
69
+ --include-in-header=$(docformat. header_template)
70
+ -V fontsize=12pt -o $(out) `
71
+ proc = open (cmd, " r+" )
72
+ println (proc. in, rendered)
73
+ close (proc. in)
74
+ read (proc. out, String)
75
+ end
69
76
catch
70
77
rethrow ()
71
78
finally
0 commit comments