Remove use of Pkg.dir

pull/66/head
Matti Pastell 2016-12-12 19:25:51 +02:00
parent 6a68be5161
commit 76bec5c438
2 changed files with 10 additions and 8 deletions

View File

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

View File

@ -274,6 +274,7 @@ end
function init_plotting(plotlib) function init_plotting(plotlib)
srcdir = dirname(@__FILE__)
rcParams[:plotlib_set] = true rcParams[:plotlib_set] = true
if plotlib == nothing if plotlib == nothing
rcParams[:plotlib] = nothing rcParams[:plotlib] = nothing
@ -281,16 +282,16 @@ function init_plotting(plotlib)
l_plotlib = lowercase(plotlib) l_plotlib = lowercase(plotlib)
rcParams[:chunk_defaults][:fig] = true rcParams[:chunk_defaults][:fig] = true
if l_plotlib == "winston" if l_plotlib == "winston"
eval(parse("""include(Pkg.dir("Weave","src","winston.jl"))""")) eval(parse("""include("$srcdir/winston.jl")"""))
rcParams[:plotlib] = "Winston" rcParams[:plotlib] = "Winston"
elseif l_plotlib == "pyplot" elseif l_plotlib == "pyplot"
eval(parse("""include(Pkg.dir("Weave","src","pyplot.jl"))""")) eval(parse("""include("$srcdir/pyplot.jl")"""))
rcParams[:plotlib] = "PyPlot" rcParams[:plotlib] = "PyPlot"
elseif l_plotlib == "plots" elseif l_plotlib == "plots"
eval(parse("""include(Pkg.dir("Weave","src","plots.jl"))""")) eval(parse("""include("$srcdir/plots.jl")"""))
rcParams[:plotlib] = "Plots" rcParams[:plotlib] = "Plots"
elseif l_plotlib == "gadfly" elseif l_plotlib == "gadfly"
eval(parse("""include(Pkg.dir("Weave","src","gadfly.jl"))""")) eval(parse("""include("$srcdir/gadfly.jl")"""))
rcParams[:plotlib] = "Gadfly" rcParams[:plotlib] = "Gadfly"
end end
end end