Skip to content

Commit b807e5f

Browse files
committed
re-enable doc-index-All with tests
1 parent 19e406d commit b807e5f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Distribution/Server/Pages/Package.hs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import Distribution.Server.Packages.ModuleForest
3232
import Distribution.Server.Packages.Render
3333
import Distribution.Server.Users.Types (userStatus, userName, isActiveAccount)
3434
import Data.TarIndex (TarIndex)
35+
import qualified Data.TarIndex as Tar
3536

3637
import qualified Distribution.ModuleName as Module
3738
import Distribution.ModuleName (ModuleName)
@@ -317,15 +318,16 @@ moduleSection render mdocIndex docURL quickNav =
317318
[renderDocIndexLink] ++
318319
[renderModuleForest docURL m ]
319320
else [])
320-
renderDocIndexLink
321-
| isJust mdocIndex =
322-
let docIndexURL = docURL </> "doc-index.html"
321+
renderDocIndexLink = case mdocIndex of
322+
Just tindex ->
323+
let docIndexURL | isJust (Tar.lookup tindex "doc-index-All.html") = docURL </> "doc-index-All.html"
324+
| otherwise = docURL </> "doc-index.html"
323325
in paragraph ! [thestyle "font-size: small"]
324326
<< ("[" +++ anchor ! [href docIndexURL] << "Index" +++ "]" +++
325327
(if quickNav
326328
then " [" +++ anchor ! [identifier "quickjump-trigger", href "#"] << "Quick Jump" +++ "]"
327329
else mempty))
328-
| otherwise = mempty
330+
Nothing -> mempty
329331

330332
propertySection :: [(String, Html)] -> [Html]
331333
propertySection sections =

0 commit comments

Comments
 (0)