
Oleg Grenrus pushed to branch wip/shorter-this-module-links at Glasgow Haskell Compiler / GHC Commits: cf26a2e3 by Oleg Grenrus at 2025-09-14T23:33:54+03:00 Use showUnique in internalAnchorIdent Showing the key of Unique as a number is generally not a great idea. GHC Unique has a tag in high bits, so the raw number is unnecessarily big. So now we have ```html <a href="#l-rvgK"><span class="hs-identifier hs-var hs-var">bar</span></a> ``` instead of ```html <a href="#local-6989586621679015689"><span class="hs-identifier hs-var hs-var">bar</span></a> ``` Together with previous changes of shorter intra-module links the effect on compressed files is not huge, that is expected as we simply remove repetitive contents which pack well. ``` 12_694_206 Agda-2.9.0-docs-orig.tar.gz 12_566_065 Agda-2.9.0-docs.tar.gz ``` However when unpacked, the difference can be significant, e.g. Agda's largest module source got 5% reduction: ``` 14_230_117 Agda.Syntax.Parser.Parser.html 13_422_109 Agda.Syntax.Parser.Parser.html ``` The whole hyperlinked source code directory got similar reduction ``` 121M Agda-2.9.0-docs-orig/src 114M Agda-2.9.0-docs/src ``` For the reference, sources are about 2/3 of the generated haddocks ``` 178M Agda-2.9.0-docs-old 172M Agda-2.9.0-docs ``` so we get around 3.5% size reduction overall. Not bad for a small local changes. - - - - - 16 changed files: - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs - utils/haddock/hypsrc-test/ref/src/CPP.html - utils/haddock/hypsrc-test/ref/src/Classes.html - utils/haddock/hypsrc-test/ref/src/Constructors.html - utils/haddock/hypsrc-test/ref/src/Identifiers.html - utils/haddock/hypsrc-test/ref/src/LinkingIdentifiers.html - utils/haddock/hypsrc-test/ref/src/Literals.html - utils/haddock/hypsrc-test/ref/src/Operators.html - utils/haddock/hypsrc-test/ref/src/Polymorphism.html - utils/haddock/hypsrc-test/ref/src/PositionPragmas.html - utils/haddock/hypsrc-test/ref/src/Quasiquoter.html - utils/haddock/hypsrc-test/ref/src/Records.html - utils/haddock/hypsrc-test/ref/src/TemplateHaskellQuasiquotes.html - utils/haddock/hypsrc-test/ref/src/TemplateHaskellSplices.html - utils/haddock/hypsrc-test/ref/src/Types.html - utils/haddock/hypsrc-test/ref/src/UsingQuasiquotes.html The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cf26a2e3ddc17e729a0685aab1e1e717... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cf26a2e3ddc17e729a0685aab1e1e717... You're receiving this email because of your account on gitlab.haskell.org.