Right now, file links to local files encode the size of the file in bytes and as a site-wide percentile as 2 data-attributes, in LinkMetadata.hs:
addSizeToLinks :: SizeDB -> Inline -> Inline
addSizeToLinks sdb x@(Link _ _ (url,_)) = if hasClass "filesize-not" x || hasKey "filesize-bytes" x || hasKey "filesize-percentage" x then x
else case M.lookup (T.unpack url) sdb of
Nothing -> x
Just (byte,percentile) -> addKey ("filesize-bytes", T.pack $ show byte) $ addKey ("filesize-percentage", T.pack $ show percentile) x
addSizeToLinks _ x = x
A live example:
<p>...<a href="/doc/www/arxiv.org/6e5b0ee1866f92d76b124e192060bf7e32d4d2c0.pdf" id="russakovsky-et-al-2014" class="link-live link-annotated" data-link-icon="𝛘" data-link-icon-type="text" data-link-icon-color="#b31b1b" data-href-mobile="https://arxiv.org/html/1409.0575?fallback=original" data-url-archive="/doc/www/arxiv.org/6e5b0ee1866f92d76b124e192060bf7e32d4d2c0.pdf" data-url-original="https://arxiv.org/abs/1409.0575" title="‘ImageNet Large Scale Visual Recognition Challenge’, Russakovsky et al 2014"
data-filesize-bytes="1826689" data-filesize-percentage="61"
title="'ImageNet Large Scale Visual Recognition Challenge', Russakovsky et al 2014">ImageNet</a>, which classifies 1m photos into 1000 categories.
The intent is to reuse our ordinal icon indicators CSS to help indicate the rough size of a file from 'very small' to 'very large!', to warn users about large files, similar to our '10 MB' size warnings in file transclusion blocks, or to help indicate a rough 'word count' of an essay.
The ordinal donut icons are not free and we already have a lot of clutter, so thy should probably be displayed only on hover / when a link is 'active' due to a popup/popover.
Right now, file links to local files encode the size of the file in bytes and as a site-wide percentile as 2 data-attributes, in
LinkMetadata.hs:A live example:
The intent is to reuse our ordinal icon indicators CSS to help indicate the rough size of a file from 'very small' to 'very large!', to warn users about large files, similar to our '10 MB' size warnings in file transclusion blocks, or to help indicate a rough 'word count' of an essay.
The ordinal donut icons are not free and we already have a lot of clutter, so thy should probably be displayed only on hover / when a link is 'active' due to a popup/popover.