Use dirname(@__FILE__) instead of Pkg.dir

so that the package can be installed elsewhere
pull/49/head
Tony Kelman 2016-07-30 16:54:11 -04:00
parent f48b61c776
commit 3ad6d7ae56
3 changed files with 14 additions and 14 deletions

View File

@ -1,22 +1,22 @@
using Weave
weave(Pkg.dir("Weave","examples","gadfly_md_sample.jmd"),
weave(joinpath(dirname(@__FILE__),"..","examples","gadfly_md_sample.jmd"),
informat="markdown", out_path = "build/examples", doctype = "pandoc")
weave(Pkg.dir("Weave","examples","gadfly_md_sample.jmd"),
weave(joinpath(dirname(@__FILE__),"..","examples","gadfly_md_sample.jmd"),
informat="markdown", out_path = "build/examples", doctype = "md2html")
weave(Pkg.dir("Weave","examples","gadfly_md_sample.jmd"),
weave(joinpath(dirname(@__FILE__),"..","examples","gadfly_md_sample.jmd"),
informat="markdown", out_path = "build/examples", doctype = "md2pdf")
cp(Pkg.dir("Weave","examples","gadfly_md_sample.jmd"),
cp(joinpath(dirname(@__FILE__),"..","examples","gadfly_md_sample.jmd"),
"build/examples/gadfly_md_sample.jmd", remove_destination = true)
cp("build/examples/gadfly_md_sample.md",
"build/examples/gadfly_md_sample.txt", remove_destination = true)
weave(Pkg.dir("Weave","examples","FIR_design.jl"), out_path = "build/examples")
weave(Pkg.dir("Weave","examples","FIR_design.jl"), doctype = "md2pdf", out_path = "build/examples")
cp(Pkg.dir("Weave","examples","FIR_design.jl"),
weave(joinpath(dirname(@__FILE__),"..","examples","FIR_design.jl"), out_path = "build/examples")
weave(joinpath(dirname(@__FILE__),"..","examples","FIR_design.jl"), doctype = "md2pdf", out_path = "build/examples")
cp(joinpath(dirname(@__FILE__),"..","examples","FIR_design.jl"),
"build/examples/FIR_design.jl", remove_destination = true)

View File

@ -6,8 +6,8 @@
Convert output from pandoc markdown to html using Weave.jl template
"""
function pandoc2html(formatted::AbstractString, doc::WeaveDoc, outname::AbstractString)
html_template = joinpath(Pkg.dir("Weave"), "templates/pandoc_skeleton.html")
css_template = joinpath(Pkg.dir("Weave"), "templates/pandoc_skeleton.css")
html_template = joinpath(dirname(@__FILE__), "../templates/pandoc_skeleton.html")
css_template = joinpath(dirname(@__FILE__), "../templates/pandoc_skeleton.css")
path, wsource = splitdir(abspath(doc.source))
wversion = string(Pkg.installed("Weave"))
@ -43,7 +43,7 @@ Convert output from pandoc markdown to pdf using Weave.jl template
"""
function pandoc2pdf(formatted::AbstractString, doc::WeaveDoc, outname::AbstractString)
header_template = joinpath(Pkg.dir("Weave"), "templates/pandoc_header.txt")
header_template = joinpath(dirname(@__FILE__), "../templates/pandoc_header.txt")
path, wsource = splitdir(abspath(doc.source))
wversion = string(Pkg.installed("Weave"))

View File

@ -279,16 +279,16 @@ function init_plotting(plotlib)
l_plotlib = lowercase(plotlib)
rcParams[:chunk_defaults][:fig] = true
if l_plotlib == "winston"
eval(parse("""include(Pkg.dir("Weave","src","winston.jl"))"""))
eval(parse("""include(joinpath(dirname(@__FILE__),"winston.jl"))"""))
rcParams[:plotlib] = "Winston"
elseif l_plotlib == "pyplot"
eval(parse("""include(Pkg.dir("Weave","src","pyplot.jl"))"""))
eval(parse("""include(joinpath(dirname(@__FILE__),"pyplot.jl"))"""))
rcParams[:plotlib] = "PyPlot"
elseif l_plotlib == "plots"
eval(parse("""include(Pkg.dir("Weave","src","plots.jl"))"""))
eval(parse("""include(joinpath(dirname(@__FILE__),"plots.jl"))"""))
rcParams[:plotlib] = "Plots"
elseif l_plotlib == "gadfly"
eval(parse("""include(Pkg.dir("Weave","src","gadfly.jl"))"""))
eval(parse("""include(joinpath(dirname(@__FILE__),"gadfly.jl"))"""))
rcParams[:plotlib] = "Gadfly"
end
end