@@ -84,6 +84,30 @@ docs = [
84
84
# giturl = "[email protected] :JuliaComputing/DataSets.jl.git",
85
85
),
86
86
]
87
+
88
+ # We do not support deploying docs on Windows at the moment, and MultiDocumenter
89
+ # should throw an error if it's being run on Windows (in a non-interactive session).
90
+ # See also: https://github.com/JuliaComputing/MultiDocumenter.jl/issues/70
91
+ if Sys. iswindows () && ! isinteractive ()
92
+ @test_throws ErrorException MultiDocumenter. make (
93
+ outpath,
94
+ docs;
95
+ search_engine = MultiDocumenter. SearchConfig (
96
+ index_versions = [" stable" , " dev" ],
97
+ engine = MultiDocumenter. FlexSearch,
98
+ ),
99
+ custom_scripts = [
100
+ " foo/bar.js" ,
101
+ " https://foo.com/bar.js" ,
102
+ Docs. HTML (" const foo = 'bar';" ),
103
+ ],
104
+ rootpath = rootpath,
105
+ canonical_domain = " https://example.org/" ,
106
+ sitemap = true ,
107
+ sitemap_filename = " sitemap-mydocs.xml" ,
108
+ )
109
+ end
110
+
87
111
MultiDocumenter. make (
88
112
outpath,
89
113
docs;
@@ -100,15 +124,25 @@ MultiDocumenter.make(
100
124
canonical_domain = " https://example.org/" ,
101
125
sitemap = true ,
102
126
sitemap_filename = " sitemap-mydocs.xml" ,
127
+ # The following keyword is not standard:
128
+ _override_windows_isinteractive_check = Sys. iswindows (),
103
129
)
104
130
105
131
@testset " MultiDocumenter.jl" begin
106
132
107
133
@testset " structure" begin
108
134
@test isdir (outpath, " inf" )
109
135
@test ! isdir (outpath, " inf" , " previews" )
110
- @test isdir (outpath, " inf" , " stable" )
111
- @test isfile (outpath, " inf" , " stable" , " index.html" )
136
+ if Sys. iswindows ()
137
+ # On Windows, symlinks are either kept as simple files, or are in fact
138
+ # symlinks, but then you would run into permission errors with isdir().
139
+ # So we need to have platform-specific test logic here.
140
+ path = joinpath (outpath, " inf" , " stable" )
141
+ @test islink (path) || isfile (path)
142
+ else
143
+ @test isdir (outpath, " inf" , " stable" )
144
+ @test isfile (outpath, " inf" , " stable" , " index.html" )
145
+ end
112
146
113
147
@test read (joinpath (outpath, " inf" , " index.html" ), String) == """
114
148
<!--This file is automatically generated by Documenter.jl-->
@@ -122,8 +156,7 @@ MultiDocumenter.make(
122
156
123
157
124
158
@testset " custom scripts" begin
125
- index = read (joinpath (outpath, " inf" , " stable" , " index.html" ), String)
126
-
159
+ index = read (joinpath (outpath, " inf" , " v1.6.4" , " index.html" ), String)
127
160
@test occursin (
128
161
""" <script charset="utf-8" type="text/javascript">window.MULTIDOCUMENTER_ROOT_PATH = '$rootpath '</script>""" ,
129
162
index,
@@ -140,12 +173,36 @@ MultiDocumenter.make(
140
173
""" <script charset="utf-8" type="text/javascript">const foo = 'bar';</script>""" ,
141
174
index,
142
175
)
176
+
177
+ if ! Sys. iswindows ()
178
+ # Going through symlinks does not work on Windows
179
+ index = read (joinpath (outpath, " inf" , " stable" , " index.html" ), String)
180
+ @test occursin (
181
+ """ <script charset="utf-8" type="text/javascript">window.MULTIDOCUMENTER_ROOT_PATH = '$rootpath '</script>""" ,
182
+ index,
183
+ )
184
+ @test occursin (
185
+ """ <script charset="utf-8" src="../../foo/bar.js" type="text/javascript"></script>""" ,
186
+ index,
187
+ )
188
+ @test occursin (
189
+ """ <script charset="utf-8" src="https://foo.com/bar.js" type="text/javascript"></script>""" ,
190
+ index,
191
+ )
192
+ @test occursin (
193
+ """ <script charset="utf-8" type="text/javascript">const foo = 'bar';</script>""" ,
194
+ index,
195
+ )
196
+ end
143
197
end
144
198
145
199
@testset " canonical URLs" begin
146
- index = read (joinpath (outpath, " inf" , " stable" , " index.html" ), String)
147
- canonical_href = " <link href=\" https://example.org/MultiDocumenter.jl/inf/stable/\" rel=\" canonical\" />"
148
- @test occursin (canonical_href, index)
200
+ # We can't traverse symlinks on Windows, so we ignore this case
201
+ if ! Sys. iswindows ()
202
+ index = read (joinpath (outpath, " inf" , " stable" , " index.html" ), String)
203
+ canonical_href = " <link href=\" https://example.org/MultiDocumenter.jl/inf/stable/\" rel=\" canonical\" />"
204
+ @test occursin (canonical_href, index)
205
+ end
149
206
150
207
index = read (joinpath (outpath, " inf" , " v1.6.0" , " index.html" ), String)
151
208
canonical_href = " <link href=\" https://example.org/MultiDocumenter.jl/inf/stable/\" rel=\" canonical\" />"
@@ -158,9 +215,17 @@ MultiDocumenter.make(
158
215
@test ! isempty (store_content)
159
216
@test occursin (" Infiltrator.jl" , store_content)
160
217
@test occursin (" @infiltrate" , store_content)
161
- @test occursin (" $(rootpath) inf/stable/" , store_content)
162
- @test occursin (" $(rootpath) inf/stable/" , store_content)
163
- @test ! occursin (" /inf/dev/" , store_content)
218
+ # We can't traverse symlinks on Windows, so stable/ things do not get
219
+ # written into the search index. Instead, it looks like we write dev/
220
+ if Sys. iswindows ()
221
+ @test ! occursin (" $(rootpath) inf/stable/" , store_content)
222
+ @test ! occursin (" $(rootpath) inf/stable/" , store_content)
223
+ @test occursin (" /inf/dev/" , store_content)
224
+ else
225
+ @test occursin (" $(rootpath) inf/stable/" , store_content)
226
+ @test occursin (" $(rootpath) inf/stable/" , store_content)
227
+ @test ! occursin (" /inf/dev/" , store_content)
228
+ end
164
229
end
165
230
166
231
@testset " sitemap" begin
0 commit comments