From 0e76d051bff48ea6ca0a3a32c49fa71f514f3bdc Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Tue, 17 Apr 2018 17:27:50 +0200 Subject: [PATCH] don't include release- folder in version selector --- src/Writers/HTMLWriter.jl | 7 +------ test/htmlwriter.jl | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Writers/HTMLWriter.jl b/src/Writers/HTMLWriter.jl index 3dcdb49a39..bc9b2e842f 100644 --- a/src/Writers/HTMLWriter.jl +++ b/src/Writers/HTMLWriter.jl @@ -479,23 +479,18 @@ end function generate_version_file(dir::AbstractString) named_folders = [] - release_folders = [] tag_folders = [] for each in readdir(dir) each in ("stable", "latest") ? push!(named_folders, each) : - occursin(r"release\-\d+\.\d+", each) ? push!(release_folders, each) : occursin(Base.VERSION_REGEX, each) ? push!(tag_folders, each) : nothing end # put stable before latest sort!(named_folders, rev = true) # sort tags by version number sort!(tag_folders, lt = (x, y) -> VersionNumber(x) < VersionNumber(y), rev = true) - # sort release- folders by version number - vnum(x) = VersionNumber(match(r"release\-(\d+\.\d+)", x)[1]) - sort!(release_folders, lt = (x, y) -> vnum(x) < vnum(y), rev = true) open(joinpath(dir, "versions.js"), "w") do buf println(buf, "var DOC_VERSIONS = [") - for group in (named_folders, tag_folders, release_folders) + for group in (named_folders, tag_folders) for folder in group println(buf, " \"", folder, "\",") end diff --git a/test/htmlwriter.jl b/test/htmlwriter.jl index ae22623e51..a9dddd3269 100644 --- a/test/htmlwriter.jl +++ b/test/htmlwriter.jl @@ -21,7 +21,7 @@ import Documenter.Writers.HTMLWriter: jsescape, generate_version_file @test jsescape("policy to
 delete.") == "policy to\\u2028 delete." mktempdir() do tmpdir - versions = ["stable", "latest", "v0.2.6", "v0.1.1", "v0.1.0", "release-0.2", "release-0.1"] + versions = ["stable", "latest", "v0.2.6", "v0.1.1", "v0.1.0"] cd(tmpdir) do mkdir("foobar") for version in versions