Merge pull request #49 from tkelman/nopkgdir

Use dirname(@__FILE__) instead of Pkg.dir
pull/55/head
Matti Pastell 2016-10-30 19:00:35 +02:00 committed by GitHub
commit d2fe2a82e2
4 changed files with 16 additions and 15 deletions

View File

@ -1,7 +1,8 @@
language: julia
julia:
- release
- 0.4
- 0.5
- nightly
matrix:
allow_failures:

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"))"""))
include("winston.jl")
rcParams[:plotlib] = "Winston"
elseif l_plotlib == "pyplot"
eval(parse("""include(Pkg.dir("Weave","src","pyplot.jl"))"""))
include("pyplot.jl")
rcParams[:plotlib] = "PyPlot"
elseif l_plotlib == "plots"
eval(parse("""include(Pkg.dir("Weave","src","plots.jl"))"""))
include("plots.jl")
rcParams[:plotlib] = "Plots"
elseif l_plotlib == "gadfly"
eval(parse("""include(Pkg.dir("Weave","src","gadfly.jl"))"""))
include("gadfly.jl")
rcParams[:plotlib] = "Gadfly"
end
end