Skip to content

Commit 69c633b

Browse files
committed
chore: formatting, cleanup
1 parent 7713a29 commit 69c633b

File tree

7 files changed

+38
-32
lines changed

7 files changed

+38
-32
lines changed

src/MultiDocumenter.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ end
2828
"""
2929
abstract type DropdownComponent
3030
31-
The supertype for any component that can be put in a dropdown column and
32-
rendered using `MultiDocumenter.render(::YourComponent, thispagepath, dir, prettyurls)`.
31+
The supertype for any component that can be put in a dropdown column and
32+
rendered using `MultiDocumenter.render(::YourComponent, thispagepath, dir, prettyurls)`.
3333
3434
All `DropdownComponent`s go in [`Column`](@ref)s, which go in [`MegaDropdownNav`](@ref).
3535
@@ -128,7 +128,7 @@ function walk_outputs(f, root, docs::Vector, dirs::Vector{String})
128128
break
129129
end
130130
end
131-
return
131+
return nothing
132132
end
133133

134134
include("renderers.jl")
@@ -342,7 +342,7 @@ function maybe_clone(docs::Vector)
342342
end
343343
end
344344
end
345-
return
345+
return nothing
346346
end
347347

348348
function make_output_structure(
@@ -553,7 +553,7 @@ function inject_styles_and_global_navigation(
553553
end
554554
end
555555

556-
return
556+
return nothing
557557
end
558558

559559
end

src/canonical.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ function fix_canonical_url!(
66
root_dir::AbstractString,
77
)
88
# If the user didn't set `canonical`, then we don't need to do anything
9-
isnothing(canonical) && return
9+
isnothing(canonical) && return nothing
1010
# The user can also disable the canonical URL fixing on a per-package basis
11-
doc.fix_canonical_url || return
11+
doc.fix_canonical_url || return nothing
1212
# Determine the canonical URL and fix them in the HTML files
1313
documenter_directory_root = joinpath(root_dir, doc.path)
1414
try
@@ -21,5 +21,5 @@ function fix_canonical_url!(
2121
(e, catch_backtrace())
2222
end
2323

24-
return
24+
return nothing
2525
end

src/documentertools/canonical_urls.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function update_canonical_links_for_version(
6666
@error "Multiple canonical tags!" file = fileinfo.relpath
6767
end
6868
end
69-
return
69+
return nothing
7070
end
7171

7272
is_canonical_element(e) =
@@ -124,7 +124,7 @@ function update_canonical_links(docs_directory::AbstractString; canonical::Abstr
124124
@debug "Updating canonical URLs for a version" path canonical_full_root
125125
update_canonical_links_for_version(path; canonical = canonical_full_root)
126126
end
127-
return
127+
return nothing
128128
end
129129

130130
function canonical_directory_from_redirect_index_html(docs_directory::AbstractString)
@@ -241,7 +241,8 @@ function extract_versions_list(versions_js::AbstractString)
241241
ArgumentError(
242242
"""
243243
Could not find DOC_VERSIONS in $(versions_js):
244-
$(versions_js_content)"""
244+
$(versions_js_content)
245+
"""
245246
)
246247
)
247248
end
@@ -252,7 +253,8 @@ function extract_versions_list(versions_js::AbstractString)
252253
ArgumentError(
253254
"""
254255
DOC_VERSIONS empty in $(versions_js):
255-
$(versions_js_content)"""
256+
$(versions_js_content)
257+
"""
256258
)
257259
)
258260
end

src/search/flexsearch.jl

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
module FlexSearch
2-
import Gumbo, JSON, AbstractTrees
2+
3+
using Gumbo: Gumbo
4+
using JSON: JSON
5+
using AbstractTrees: AbstractTrees
36
using NodeJS_22_jll: node
4-
using HypertextLiteral
7+
using HypertextLiteral: @htl
8+
59
import ..walk_outputs
610

711
const ID = Ref(0)
@@ -62,7 +66,7 @@ function add_fragment(doc, el)
6266
current.content = string(current.content, ' ', Gumbo.text(e))
6367
end
6468
end
65-
return
69+
return nothing
6670
end
6771

6872
function add_to_index!(index, ref, file)
@@ -84,7 +88,7 @@ function add_to_index!(index, ref, file)
8488
end
8589
end
8690
push!(index.documents, doc)
87-
return
91+
return nothing
8892
end
8993

9094
function generate_index(root, docs, config, rootpath)
@@ -104,12 +108,12 @@ function inject_script!(custom_scripts, rootpath)
104108
custom_scripts,
105109
Docs.HTML("window.MULTIDOCUMENTER_ROOT_PATH = '$(rootpath)'"),
106110
)
107-
return
111+
return nothing
108112
end
109113

110114
function inject_styles!(custom_styles)
111115
pushfirst!(custom_styles, joinpath("assets", "default", "flexsearch.css"))
112-
return
116+
return nothing
113117
end
114118

115119
function render()
@@ -147,7 +151,7 @@ function to_json_index(index::SearchIndex, file)
147151
end
148152
JSON.end_array(writer)
149153
end
150-
return
154+
return nothing
151155
end
152156

153157
function build_search_index(root, docs, config, rootpath)
@@ -159,6 +163,6 @@ function build_search_index(root, docs, config, rootpath)
159163
cd(root) do
160164
run(`$(node()) $(joinpath(@__DIR__, "..", "..", "flexsearch", file))`)
161165
end
162-
return
166+
return nothing
163167
end
164168
end

src/search/pagefind.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ function inject_script!(custom_scripts, rootpath)
99
custom_scripts,
1010
Docs.HTML("window.MULTIDOCUMENTER_ROOT_PATH = '$(rootpath)'"),
1111
)
12-
return
12+
return nothing
1313
end
1414

1515
function inject_styles!(custom_styles)
1616
pushfirst!(custom_styles, joinpath("assets", "default", "pagefind.css"))
17-
return
17+
return nothing
1818
end
1919

2020
function render()
@@ -39,7 +39,7 @@ function build_search_index(root, docs, config, rootpath)
3939
pattern = "*/{$(join(config.index_versions, ","))}/**/*.{html}"
4040

4141
run(`$(npx) pagefind --site $(root) --glob $(pattern) --root-selector article`)
42-
return
42+
return nothing
4343
end
4444

4545
end

src/search/stork.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@ function add_to_index!(files, ref, path)
6161
end
6262

6363
push!(files, Dict("path" => path, "url" => ref, "title" => title))
64-
return
64+
return nothing
6565
end
6666

6767
function inject_script!(custom_scripts, _)
6868
pushfirst!(custom_scripts, joinpath("assets", "default", "stork.js"))
6969
pushfirst!(custom_scripts, joinpath("assets", "default", "stork_integration.js"))
70-
return
70+
return nothing
7171
end
7272

7373
function inject_styles!(custom_styles)
7474
pushfirst!(custom_styles, joinpath("assets", "default", "stork.css"))
75-
return
75+
return nothing
7676
end
7777

7878
function render()

src/sitemap.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function Base.showerror(io::IO, e::SitemapTooLargeError)
2222
println(io, " limit is $(e.limit), but sitemap has $(e.value)")
2323
print(io, SITEMAP_LIMIT_MSG)
2424

25-
return
25+
return nothing
2626
end
2727
function check_sitemap_size_limit(msg::AbstractString, value::Integer, limit::Integer)
2828
if value > limit
@@ -32,7 +32,7 @@ function check_sitemap_size_limit(msg::AbstractString, value::Integer, limit::In
3232
@warn "Sitemap too large: $(msg) (> 80% soft limit)\n$(SITEMAP_LIMIT_MSG)"
3333
end
3434

35-
return
35+
return nothing
3636
end
3737

3838
function make_sitemap(;
@@ -44,13 +44,13 @@ function make_sitemap(;
4444
sitemap_urls = find_sitemap_urls(; docs_root_directory, sitemap_root)
4545
if length(sitemap_urls) == 0
4646
@error "No sitemap URLs found"
47-
return
47+
return nothing
4848
end
4949
sitemap_bytes = make_sitemap_bytes(sitemap_urls)
5050
# Write the actual sitemap.xml file into the output directory
5151
write(joinpath(docs_root_directory, sitemap_filename), sitemap_bytes)
5252

53-
return
53+
return nothing
5454
end
5555

5656
function make_sitemap_bytes(sitemap_urls)::Vector{UInt8}
@@ -96,13 +96,13 @@ function find_sitemap_urls(;
9696
if DocumenterTools.get_meta_redirect_url(html) === nothing
9797
@warn "Canonical URL missing: $(fileinfo.relpath)"
9898
end
99-
return
99+
return nothing
100100
end
101101
# Check that the canonincal URL is correct.
102102
# First, we check that the root part is actually what we expect it to be.
103103
if !startswith(canonical_href, sitemap_root)
104104
@warn "Invalid canonical URL, excluded from sitemap." canonical_href fileinfo.fullpath
105-
return
105+
return nothing
106106
end
107107
# Let's make sure we're not adding duplicates, but first we must normalize the URL
108108
canonical_href = normalize_canonical_url(canonical_href)

0 commit comments

Comments
 (0)