Skip to content

Commit

Permalink
Improve size threshold warning (#2258)
Browse files Browse the repository at this point in the history
Previously, it would show just the HTML file path, which is not useful
when you want to e.g. set size_threshold_ignore. Now it shows the page
mane, but also separately prints the path to the HTML.
  • Loading branch information
mortenpi authored Sep 15, 2023
1 parent c9b77f4 commit 3cb575d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/html/HTMLWriter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1769,10 +1769,11 @@ function write_html(ctx::HTMLContext, navnode::Documenter.NavNode, page_html::DO
isdir(dirname(path)) || mkpath(dirname(path))
file_size = open(io -> write(io, take!(buf)), path; write=true)
size_threshold_msg(var::Symbol) = """
Generated HTML over $(var) limit: $(page_path)
Generated HTML over $(var) limit: $(navnode.page)
Generated file size: $(file_size) (bytes)
size_threshold_warn: $(ctx.settings.size_threshold_warn) (bytes)
size_threshold: $(ctx.settings.size_threshold) (bytes)"""
size_threshold: $(ctx.settings.size_threshold) (bytes)
HTML file: $(page_path)"""
if navnode.page in ctx.settings.size_threshold_ignore
if file_size > ctx.settings.size_threshold_warn
@debug """
Expand Down

0 comments on commit 3cb575d

Please sign in to comment.