Skip to content

Commit ac540f9

Browse files
authored
fix monkey patching
1 parent cd54e3c commit ac540f9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

docs/make.jl

+5-6
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ const GEN_DIR = joinpath(WORK_DIR, "generated")
1212
const ATTRIBUTE_SEARCH = Dict{String,Any}() # search terms
1313

1414
# monkey patch `Documenter` - note that this could break on minor `Documenter` releases
15-
@eval Documenter.Writers.HTMLWriter domify(ctx, navnode) = begin
16-
# github.com/JuliaDocs/Documenter.jl/blob/327d155f992ec7c63e35fa2cb08f7f7c2d33409a/src/Writers/HTMLWriter.jl#L1448-L1455
17-
page = getpage(ctx, navnode)
18-
map(page.elements) do elem
19-
rec = SearchRecord(ctx, navnode, elem)
15+
@eval Documenter.Writers.HTMLWriter domify(dctx::DCtx) = begin
16+
ctx, navnode = dctx.ctx, dctx.navnode
17+
return map(getpage(ctx, navnode).mdast.children) do node
18+
rec = SearchRecord(ctx, navnode, node, node.element)
2019
############################################################
2120
# begin addition
2221
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
4342
end
4443
# end addition
4544
############################################################
46-
domify(ctx, navnode, page.mapping[elem])
45+
domify(dctx, node, node.element)
4746
end
4847
end
4948

0 commit comments

Comments
 (0)