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
"""
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")
weavedir = dirname(@__FILE__)
html_template = joinpath(weavedir, "../templates/pandoc_skeleton.html")
css_template = joinpath(weavedir, "../templates/pandoc_skeleton.css")
path, wsource = splitdir(abspath(doc.source))
wversion = string(Pkg.installed("Weave"))
@ -53,8 +54,8 @@ end
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")
weavedir = dirname(@__FILE__)
header_template = joinpath(weavedir, "../templates/pandoc_header.txt")
path, wsource = splitdir(abspath(doc.source))
wversion = string(Pkg.installed("Weave"))

View File

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