Skip to content
Open
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: 10 additions & 2 deletions src/html/HTMLWriter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -619,11 +619,13 @@ mutable struct HTMLContext
search_index_js :: String
search_navnode :: Documenter.NavNode
atexample_warnings::Vector{AtExampleFallbackWarning}
external_link_attribs :: Vector{Pair{Symbol,String}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not very important, but in principle, the fields of this struct are meant for mutable state. I think I'd make this a global const for now.

And just a small nitpick:

Suggested change
external_link_attribs :: Vector{Pair{Symbol,String}}
external_link_attributes :: Vector{Pair{Symbol,String}}


HTMLContext(doc, settings=nothing) = new(
doc, settings, [], "", "", "", [], "",
Documenter.NavNode("search", "Search", nothing),
AtExampleFallbackWarning[],
[:referrerpolicy => "no-referrer"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thinking out loud, but I wonder if it should/could be strict-origin. But I'm also not sure it would really make a difference.

)
end

Expand Down Expand Up @@ -958,13 +960,19 @@ function render_head(ctx, navnode)

# Stylesheets.
map(css_links) do each
link[:href => each, :rel => "stylesheet", :type => "text/css"]
link[
:href => each,
:rel => "stylesheet",
:type => "text/css",
ctx.external_link_attribs...
]
end,

script("documenterBaseURL=\"$(relhref(src, "."))\""),
script[
:src => RD.requirejs_cdn,
Symbol("data-main") => relhref(src, ctx.documenter_js)
Symbol("data-main") => relhref(src, ctx.documenter_js),
ctx.external_link_attribs...
],
script[:src => relhref(src, ctx.search_index_js)],

Expand Down