mirror of https://github.com/mpastell/Weave.jl
First version of template for plotly
parent
93f9e9ac02
commit
901050a32f
|
@ -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`)
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
|
@ -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$
|
||||
|
|
Loading…
Reference in New Issue