@@ -89,7 +89,8 @@ const DEFAULT_ENGINE = SearchConfig(index_versions = ["stable", "dev"], engine =
89
89
custom_scripts = [],
90
90
search_engine = SearchConfig(),
91
91
prettyurls = true,
92
- rootpath = "/"
92
+ rootpath = "/",
93
+ hide_previews = true,
93
94
)
94
95
95
96
Aggregates multiple Documenter.jl-based documentation pages `docs` into `outdir`.
@@ -102,7 +103,8 @@ Aggregates multiple Documenter.jl-based documentation pages `docs` into `outdir`
102
103
`Docs.HTML` objects are inserted as the content of inline scripts.
103
104
- `search_engine` inserts a global search bar if not `false`. See [`SearchConfig`](@ref) for more details.
104
105
- `prettyurls` removes all `index.html` suffixes from links in the global navigation.
105
- -`rootpath` is the path your site ends up being deployed at, e.g. `/foo/` if it's hosted at `https://bar.com/foo`
106
+ - `rootpath` is the path your site ends up being deployed at, e.g. `/foo/` if it's hosted at `https://bar.com/foo`
107
+ - `hide_previews` removes preview builds from the aggregated documentation.
106
108
"""
107
109
function make (
108
110
outdir,
@@ -114,10 +116,11 @@ function make(
114
116
search_engine = DEFAULT_ENGINE,
115
117
prettyurls = true ,
116
118
rootpath = " /" ,
119
+ hide_previews = true ,
117
120
)
118
121
maybe_clone (flatten_multidocrefs (docs))
119
122
120
- dir = make_output_structure (flatten_multidocrefs (docs), prettyurls)
123
+ dir = make_output_structure (flatten_multidocrefs (docs), prettyurls, hide_previews )
121
124
out_assets = joinpath (dir, " assets" )
122
125
if assets_dir != = nothing && isdir (assets_dir)
123
126
cp (assets_dir, out_assets)
@@ -189,7 +192,7 @@ function maybe_clone(docs::Vector{MultiDocRef})
189
192
end
190
193
end
191
194
192
- function make_output_structure (docs:: Vector{MultiDocRef} , prettyurls)
195
+ function make_output_structure (docs:: Vector{MultiDocRef} , prettyurls, hide_previews )
193
196
dir = mktempdir ()
194
197
195
198
for doc in docs
@@ -202,6 +205,11 @@ function make_output_structure(docs::Vector{MultiDocRef}, prettyurls)
202
205
if isdir (gitpath)
203
206
rm (gitpath, recursive = true )
204
207
end
208
+
209
+ previewpath = joinpath (outpath, " previews" )
210
+ if hide_previews && isdir (previewpath)
211
+ rm (previewpath, recursive = true )
212
+ end
205
213
end
206
214
207
215
open (joinpath (dir, " index.html" ), " w" ) do io
0 commit comments