Skip to content

Commit 39de94e

Browse files
authored
Merge pull request #714 from haskell/gb/doc-index
move doc index link
2 parents 6ede407 + b807e5f commit 39de94e

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Distribution/Server/Pages/Package.hs

Lines changed: 10 additions & 8 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)
@@ -313,19 +314,20 @@ moduleSection render mdocIndex docURL quickNav =
313314
, renderModuleForest docURL s ]
314315
else []) ++
315316
(if not (null m)
316-
then [ h2 << "Modules"
317-
, renderModuleForest docURL m ]
318-
else []) ++
319-
[renderDocIndexLink]
320-
renderDocIndexLink
321-
| isJust mdocIndex =
322-
let docIndexURL = docURL </> "doc-index.html"
317+
then [ h2 << "Modules"] ++
318+
[renderDocIndexLink] ++
319+
[renderModuleForest docURL m ]
320+
else [])
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)