@@ -5,9 +5,9 @@ using HypertextLiteral
55import Git: git
66
77module DocumenterTools
8- import Gumbo, AbstractTrees
9- include (" documentertools/walkdocs.jl" )
10- include (" documentertools/canonical_urls.jl" )
8+ import Gumbo, AbstractTrees
9+ include (" documentertools/walkdocs.jl" )
10+ include (" documentertools/canonical_urls.jl" )
1111end
1212
1313"""
@@ -72,14 +72,14 @@ struct MultiDocRef <: DropdownComponent
7272end
7373
7474function MultiDocRef (;
75- upstream,
76- name,
77- path,
78- giturl = " " ,
79- branch = " gh-pages" ,
80- fix_canonical_url = true ,
81- )
82- MultiDocRef (upstream, path, name, fix_canonical_url, giturl, branch)
75+ upstream,
76+ name,
77+ path,
78+ giturl = " " ,
79+ branch = " gh-pages" ,
80+ fix_canonical_url = true ,
81+ )
82+ return MultiDocRef (upstream, path, name, fix_canonical_url, giturl, branch)
8383end
8484
8585"""
@@ -128,6 +128,7 @@ function walk_outputs(f, root, docs::Vector, dirs::Vector{String})
128128 break
129129 end
130130 end
131+ return
131132end
132133
133134include (" renderers.jl" )
@@ -175,22 +176,22 @@ Aggregates multiple Documenter.jl-based documentation pages `docs` into `outdir`
175176- `sitemap_filename` can be used to override the default sitemap filename (`sitemap.xml`)
176177"""
177178function make (
178- outdir,
179- docs:: Vector ;
180- assets_dir = nothing ,
181- brand_image:: Union{Nothing,BrandImage} = nothing ,
182- custom_stylesheets = [],
183- custom_scripts = [],
184- search_engine = DEFAULT_ENGINE,
185- prettyurls = true ,
186- rootpath = " /" ,
187- hide_previews = true ,
188- canonical_domain:: Union{AbstractString,Nothing} = nothing ,
189- sitemap:: Bool = false ,
190- sitemap_filename:: AbstractString = " sitemap.xml" ,
191- # This keyword is for internal test use only:
192- _override_windows_isinteractive_check:: Bool = false ,
193- )
179+ outdir,
180+ docs:: Vector ;
181+ assets_dir = nothing ,
182+ brand_image:: Union{Nothing, BrandImage} = nothing ,
183+ custom_stylesheets = [],
184+ custom_scripts = [],
185+ search_engine = DEFAULT_ENGINE,
186+ prettyurls = true ,
187+ rootpath = " /" ,
188+ hide_previews = true ,
189+ canonical_domain:: Union{AbstractString, Nothing} = nothing ,
190+ sitemap:: Bool = false ,
191+ sitemap_filename:: AbstractString = " sitemap.xml" ,
192+ # This keyword is for internal test use only:
193+ _override_windows_isinteractive_check:: Bool = false ,
194+ )
194195 if Sys. iswindows () && ! isinteractive ()
195196 if _override_windows_isinteractive_check || isinteractive ()
196197 @warn """
@@ -214,9 +215,13 @@ function make(
214215 else
215216 ! isnothing (canonical_domain)
216217 if ! startswith (canonical_domain, r" ^https?://" )
217- throw (ArgumentError ("""
218- Invalid value for canonical_domain: $(canonical_domain)
219- Must start with http:// or https://""" ))
218+ throw (
219+ ArgumentError (
220+ """
221+ Invalid value for canonical_domain: $(canonical_domain)
222+ Must start with http:// or https://"""
223+ )
224+ )
220225 end
221226 # We'll strip any trailing /-s though, in case the user passed something like
222227 # https://example.org/, because we want to concatenate the file paths with `/`
@@ -337,15 +342,15 @@ function maybe_clone(docs::Vector)
337342 end
338343 end
339344 end
340- return nothing
345+ return
341346end
342347
343348function make_output_structure (
344- docs:: Vector{DropdownComponent} ,
345- prettyurls,
346- hide_previews;
347- canonical:: Union{AbstractString,Nothing} ,
348- )
349+ docs:: Vector{DropdownComponent} ,
350+ prettyurls,
351+ hide_previews;
352+ canonical:: Union{AbstractString, Nothing} ,
353+ )
349354 dir = mktempdir ()
350355
351356 for doc in Iterators. filter (x -> x isa MultiDocRef, docs)
@@ -381,13 +386,13 @@ function make_output_structure(
381386end
382387
383388function make_global_nav (
384- dir,
385- docs:: Vector ,
386- thispagepath,
387- brand_image,
388- search_engine,
389- prettyurls,
390- )
389+ dir,
390+ docs:: Vector ,
391+ thispagepath,
392+ brand_image,
393+ search_engine,
394+ prettyurls,
395+ )
391396 nav = @htl """
392397 <nav id="multi-page-nav">
393398 $(render (brand_image, dir, thispagepath))
@@ -464,15 +469,15 @@ end
464469
465470
466471function inject_styles_and_global_navigation (
467- dir,
468- docs:: Vector ,
469- brand_image,
470- custom_stylesheets,
471- custom_scripts,
472- search_engine,
473- prettyurls,
474- rootpath,
475- )
472+ dir,
473+ docs:: Vector ,
474+ brand_image,
475+ custom_stylesheets,
476+ custom_scripts,
477+ search_engine,
478+ prettyurls,
479+ rootpath,
480+ )
476481
477482 if search_engine != false
478483 search_engine. engine. inject_script! (custom_scripts, rootpath)
@@ -491,9 +496,9 @@ function inject_styles_and_global_navigation(
491496 isfile (path) || continue
492497 page = read (path, String)
493498 if startswith (
494- page,
495- " <!--This file is automatically generated by Documenter.jl-->" ,
496- )
499+ page,
500+ " <!--This file is automatically generated by Documenter.jl-->" ,
501+ )
497502 continue
498503 end
499504
@@ -521,7 +526,7 @@ function inject_styles_and_global_navigation(
521526 elseif Gumbo. tag (el) == :body && ! isempty (el. children)
522527 documenter_div = first (el. children)
523528 if documenter_div isa Gumbo. HTMLElement &&
524- Gumbo. getattr (documenter_div, " id" , " " ) == " documenter"
529+ Gumbo. getattr (documenter_div, " id" , " " ) == " documenter"
525530 @debug " Could not detect Documenter page layout in $path . This may be due to an old version of Documenter."
526531 end
527532 # inject global navigation as first element in body
@@ -547,6 +552,8 @@ function inject_styles_and_global_navigation(
547552 end
548553 end
549554 end
555+
556+ return
550557end
551558
552559end
0 commit comments