Skip to content

Commit c42aebd

Browse files
authored
Merge pull request #13 from JuliaComputing/sp/exclusive-index-paths
Make index_versions argument exclusive per sub-docpage
2 parents 64ec777 + 1ce911f commit c42aebd

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/MultiDocumenter.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ import Gumbo, AbstractTrees
55
"""
66
SearchConfig(index_versions = ["stable"], engine = MultiDocumenter.FlexSearch)
77
8-
`index_versions` is a vector of relative paths used for generating the search index.
8+
`index_versions` is a vector of relative paths used for generating the search index. Only
9+
the first matching path is considered.
910
`engine` may be `MultiDocumenter.FlexSearch`, `MultiDocumenter.Stork`, or a module that conforms
10-
to the expected API.
11+
to the expected API (which is currently undocumented).
1112
"""
1213
Base.@kwdef mutable struct SearchConfig
13-
index_versions = ["stable"]
14+
index_versions = ["stable", "dev"]
1415
engine = FlexSearch
1516
end
1617

@@ -43,14 +44,15 @@ function walk_outputs(f, root, docs::Vector{MultiDocRef}, dirs::Vector{String})
4344
f(chop(r, head = length(root), tail = 0), joinpath(r, file))
4445
end
4546
end
47+
break
4648
end
4749
end
4850
end
4951

5052
include("search/flexsearch.jl")
5153
include("search/stork.jl")
5254

53-
const DEFAULT_ENGINE = SearchConfig(index_versions = ["stable"], engine = FlexSearch)
55+
const DEFAULT_ENGINE = SearchConfig(index_versions = ["stable", "dev"], engine = FlexSearch)
5456

5557
"""
5658
make(

test/runtests.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ using Test
2222
outpath,
2323
collect(last.(docs));
2424
search_engine = MultiDocumenter.SearchConfig(
25-
index_versions = ["stable"],
25+
index_versions = ["stable", "dev"],
2626
engine = MultiDocumenter.FlexSearch
2727
)
2828
)
@@ -42,6 +42,8 @@ using Test
4242
@test !isempty(store_content)
4343
@test occursin("Infiltrator.jl", store_content)
4444
@test occursin("@infiltrate", store_content)
45+
@test occursin("/inf/stable/", store_content)
46+
@test !occursin("/inf/dev/", store_content)
4547
end
4648

4749
rm(outpath, recursive=true, force=true)

0 commit comments

Comments
 (0)