Browse Source

Change the folder from "latest" to "dev" (#56)

This changes the folder variable to "dev" instead of "latest" when `travis_tag` is empty,
Documenter uses "dev" not instead of "latest", whilst latest is currently symlinked by
Documenter to provide some backward compatibility, it still breaks some things like using `__NBVIEWER_ROOT_URL__`
pull/57/head
Ben J. Ward 7 years ago committed by Fredrik Ekre
parent
commit
d272f0eafb
  1. 2
      src/Literate.jl
  2. 6
      test/runtests.jl

2
src/Literate.jl

@ -171,7 +171,7 @@ function replace_default(content, sym;
## use same logic as Documenter to figure out the deploy folder ## use same logic as Documenter to figure out the deploy folder
travis_tag = get(ENV, "TRAVIS_TAG", "TRAVIS_TAG") travis_tag = get(ENV, "TRAVIS_TAG", "TRAVIS_TAG")
if isempty(travis_tag) if isempty(travis_tag)
folder = "latest" folder = "dev"
else else
# use the versioned directory for links, even for the stable and release- # use the versioned directory for links, even for the stable and release-
# folders since this will never change # folders since this will never change

6
test/runtests.jl

@ -250,7 +250,7 @@ content = """
Literate.script(inputfile, outdir) Literate.script(inputfile, outdir)
end end
script = read(joinpath(outdir, "inputfile.jl"), String) script = read(joinpath(outdir, "inputfile.jl"), String)
@test occursin("fredrikekre/Literate.jl/blob/gh-pages/latest/", script) @test occursin("fredrikekre/Literate.jl/blob/gh-pages/dev/", script)
# pre- and post-processing # pre- and post-processing
Literate.script(inputfile, outdir, Literate.script(inputfile, outdir,
@ -378,7 +378,7 @@ end
Literate.markdown(inputfile, outdir) Literate.markdown(inputfile, outdir)
end end
markdown = read(joinpath(outdir, "inputfile.md"), String) markdown = read(joinpath(outdir, "inputfile.md"), String)
@test occursin("fredrikekre/Literate.jl/blob/gh-pages/latest/", markdown) @test occursin("fredrikekre/Literate.jl/blob/gh-pages/dev/", markdown)
# pre- and post-processing # pre- and post-processing
Literate.markdown(inputfile, outdir, Literate.markdown(inputfile, outdir,
@ -562,7 +562,7 @@ end
Literate.notebook(inputfile, outdir, execute = false) Literate.notebook(inputfile, outdir, execute = false)
end end
notebook = read(joinpath(outdir, "inputfile.ipynb"), String) notebook = read(joinpath(outdir, "inputfile.ipynb"), String)
@test occursin("fredrikekre/Literate.jl/blob/gh-pages/latest/", notebook) @test occursin("fredrikekre/Literate.jl/blob/gh-pages/dev/", notebook)
# pre- and post-processing # pre- and post-processing
function post(nb) function post(nb)

Loading…
Cancel
Save