First version of template for plotly

pull/66/head
Matti Pastell 2016-11-02 09:54:45 +02:00
parent 93f9e9ac02
commit 901050a32f
3 changed files with 10 additions and 9 deletions

View File

@ -20,7 +20,7 @@ function pandoc2html(formatted::AbstractString, doc::WeaveDoc, outname::Abstract
outname = basename(outname)
try
pandoc_out, pandoc_in, proc = readandwrite(`pandoc -R -s --mathjax="" --self-contained --highlight-style=tango
pandoc_out, pandoc_in, proc = readandwrite(`pandoc -R -s --mathjax --highlight-style=tango
--template $html_template -c $css_template
-V wversion=$wversion -V wtime=$wtime -V wsource=$wsource
-o $outname`)
@ -59,7 +59,7 @@ function pandoc2pdf(formatted::AbstractString, doc::WeaveDoc, outname::AbstractS
try
pandoc_out, pandoc_in, proc = readandwrite(`pandoc -R -s --latex-engine=xelatex --highlight-style=tango
--include-in-header=$header_template
-V fontsize=12pt -o $outname`)
-V fontsize=12pt -o $outname`)
println(pandoc_in, formatted)
close(pandoc_in)

View File

@ -17,7 +17,10 @@ function Base.display(report::Report, m::MIME"image/svg+xml", data::Plots.Plot{P
splitted = split(s, "\n")
start = split(splitted[1], r"(?=<div)")
#script = lstrip(start[1]) #local
script = "<script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>"
#TODO insert into header
#script = "<script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>"
script = ""
div = lstrip(start[2])
plot = join(map(lstrip, splitted[2:end]), "\n")

View File

@ -15,12 +15,10 @@ $if(keywords)$
$endif$
<title>$if(title-prefix)$$title-prefix$ $endif$$pagetitle$</title>
<script type="text/javascript">
var fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript")
fileref.setAttribute("src", "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML")
document.getElementsByTagName("head")[0].appendChild(fileref)
</script>
<!-- TODO check if math works with plotly -->
<!-- Need to load plotly before Mathjax or pandoc equations don't work -->
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
$if(math)$
$math$