Skip to content

Commit f177dd7

Browse files
GuillaumeGomezsyphar
authored andcommitted
Add information on how crate sizes are computed
1 parent 80cf2ca commit f177dd7

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

templates/crate/details.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,17 @@
4040
{%- if let Some(source_size) = source_size -%}
4141
<li class="pure-menu-heading">Size</li>
4242
<li class="pure-menu-item">
43-
<span class="documented-info">Source code size: {{(*source_size)|filesizeformat}}</span>
43+
<span class="documented-info">Source code size: {{(*source_size)|filesizeformat}} <span class="size" tabindex=0>
44+
{{- crate::icons::IconCircleInfo.render_solid(false, false, "") -}}
45+
<span class="info">This is the summed size of all the files inside the crates.io package for this release.</span>
46+
</span>
4447
</li>
4548
{%- if let Some(doc_size) = documentation_size -%}
4649
<li class="pure-menu-item">
47-
<span class="documented-info">Documentation size: {{(*doc_size)|filesizeformat}}</span>
50+
<span class="documented-info">Documentation size: {{(*doc_size)|filesizeformat}} <span class="size" tabindex=0>
51+
{{- crate::icons::IconCircleInfo.render_solid(false, false, "") -}}
52+
<span class="info">This is the summed size of all files generated by rustdoc for all configured targets</span>
53+
</span>
4854
</li>
4955
{%- endif -%}
5056
{%- endif -%}

templates/style/style.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,20 @@ div.package-page-container {
479479
width: 100%;
480480
}
481481

482+
.documented-info .size .info {
483+
display: none;
484+
position: absolute;
485+
top: 90%;
486+
background: var(--color-background-code);
487+
z-index: 1;
488+
border: 1px solid var(--color-menu-border);
489+
}
490+
491+
.documented-info .size:hover .info,
492+
.documented-info .size:focus .info {
493+
display: block;
494+
}
495+
482496
li.pure-menu-heading:first-child {
483497
margin-top: 0;
484498
}

0 commit comments

Comments
 (0)