Skip to content

[release-1.10] Backports for 1.10.2 #2687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Version [v1.10.2] - 2025-04-25

### Fixed

* `@meta`, `@setup`, and `@docs` blocks no longer generate spurious entries in the search index. ([#1929], [#2675])
* Fixed a performance regression introduced in v1.10.0 as part of the code clearing out the sandbox modules to save memory and caused by calling `GC.gc()` too often. ([#2685])

## Version [v1.10.1] - 2025-03-31

### Fixed
Expand Down Expand Up @@ -1462,6 +1469,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[v1.8.1]: https://github.com/JuliaDocs/Documenter.jl/releases/tag/v1.8.1
[v1.9.0]: https://github.com/JuliaDocs/Documenter.jl/releases/tag/v1.9.0
[v1.10.0]: https://github.com/JuliaDocs/Documenter.jl/releases/tag/v1.10.0
[v1.10.1]: https://github.com/JuliaDocs/Documenter.jl/releases/tag/v1.10.1
[v1.10.2]: https://github.com/JuliaDocs/Documenter.jl/releases/tag/v1.10.2
[#198]: https://github.com/JuliaDocs/Documenter.jl/issues/198
[#245]: https://github.com/JuliaDocs/Documenter.jl/issues/245
[#487]: https://github.com/JuliaDocs/Documenter.jl/issues/487
Expand Down Expand Up @@ -1831,6 +1840,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#1912]: https://github.com/JuliaDocs/Documenter.jl/issues/1912
[#1919]: https://github.com/JuliaDocs/Documenter.jl/issues/1919
[#1924]: https://github.com/JuliaDocs/Documenter.jl/issues/1924
[#1929]: https://github.com/JuliaDocs/Documenter.jl/issues/1929
[#1930]: https://github.com/JuliaDocs/Documenter.jl/issues/1930
[#1931]: https://github.com/JuliaDocs/Documenter.jl/issues/1931
[#1932]: https://github.com/JuliaDocs/Documenter.jl/issues/1932
Expand Down Expand Up @@ -2006,6 +2016,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#2659]: https://github.com/JuliaDocs/Documenter.jl/issues/2659
[#2662]: https://github.com/JuliaDocs/Documenter.jl/issues/2662
[#2674]: https://github.com/JuliaDocs/Documenter.jl/issues/2674
[#2675]: https://github.com/JuliaDocs/Documenter.jl/issues/2675
[#2685]: https://github.com/JuliaDocs/Documenter.jl/issues/2685
[JuliaLang/julia#36953]: https://github.com/JuliaLang/julia/issues/36953
[JuliaLang/julia#38054]: https://github.com/JuliaLang/julia/issues/38054
[JuliaLang/julia#39841]: https://github.com/JuliaLang/julia/issues/39841
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Documenter"
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
version = "1.10.1"
version = "1.10.2"

[deps]
ANSIColoredPrinters = "a4c015fc-c6ff-483c-b24f-f7ea428134e9"
Expand Down
1 change: 0 additions & 1 deletion src/expander_pipeline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ function clear_modules!(d::Dict{Symbol, Any})
startswith(String(k), "__atexample__") || continue
v isa Module && clear_module!(v)
end
GC.gc()
return
end

Expand Down
20 changes: 18 additions & 2 deletions src/html/HTMLWriter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,20 @@ function SearchRecord(ctx, navnode, node::Node, ::MarkdownAST.AbstractElement)
return SearchRecord(ctx, navnode; text = mdflatten(node))
end

# Returns nothing for nodes that shouldn't be indexed in search
const _SEARCHRECORD_IGNORED_BLOCK_TYPES = Union{
Documenter.MetaNode,
Documenter.DocsNodesBlock,
Documenter.SetupNode,
}
function searchrecord(ctx::HTMLContext, navnode::Documenter.NavNode, node::Node)
# Skip indexing special at-blocks
if node.element isa _SEARCHRECORD_IGNORED_BLOCK_TYPES
return nothing
end
return SearchRecord(ctx, navnode, node, node.element)
end

function JSON.lower(rec::SearchRecord)
# Replace any backslashes in links, if building the docs on Windows
src = replace(rec.src, '\\' => '/')
Expand Down Expand Up @@ -1680,8 +1694,10 @@ end
function domify(dctx::DCtx)
ctx, navnode = dctx.ctx, dctx.navnode
return map(getpage(ctx, navnode).mdast.children) do node
rec = SearchRecord(ctx, navnode, node, node.element)
push!(ctx.search_index, rec)
rec = searchrecord(ctx, navnode, node)
if !isnothing(rec)
push!(ctx.search_index, rec)
end
domify(dctx, node, node.element)
end
end
Expand Down
Loading