From ac540f95ea0fc5d659c44b8142fc68f802225f1c Mon Sep 17 00:00:00 2001 From: t-bltg Date: Wed, 13 Nov 2024 18:46:17 +0100 Subject: [PATCH] fix monkey patching --- docs/make.jl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index 05c0f28851..745abf5f92 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -12,11 +12,10 @@ const GEN_DIR = joinpath(WORK_DIR, "generated") const ATTRIBUTE_SEARCH = Dict{String,Any}() # search terms # monkey patch `Documenter` - note that this could break on minor `Documenter` releases -@eval Documenter.Writers.HTMLWriter domify(ctx, navnode) = begin - # github.com/JuliaDocs/Documenter.jl/blob/327d155f992ec7c63e35fa2cb08f7f7c2d33409a/src/Writers/HTMLWriter.jl#L1448-L1455 - page = getpage(ctx, navnode) - map(page.elements) do elem - rec = SearchRecord(ctx, navnode, elem) +@eval Documenter.Writers.HTMLWriter domify(dctx::DCtx) = begin + ctx, navnode = dctx.ctx, dctx.navnode + return map(getpage(ctx, navnode).mdast.children) do node + rec = SearchRecord(ctx, navnode, node, node.element) ############################################################ # begin addition info = "[src=$(rec.src) fragment=$(rec.fragment) title=$(rec.title) page_title=$(rec.page_title)]" @@ -43,7 +42,7 @@ const ATTRIBUTE_SEARCH = Dict{String,Any}() # search terms end # end addition ############################################################ - domify(ctx, navnode, page.mapping[elem]) + domify(dctx, node, node.element) end end