Skip to content

Commit

Permalink
haddock: make CSS path absolute, use it for index generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ozkutuk authored and Mikolaj committed Dec 15, 2024
1 parent 33b19e4 commit e2dd95b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cabal/src/Distribution/Simple/Haddock.hs
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ fromHaddockProjectFlags flags =
, argInterfaces = fromFlagOrDefault [] (haddockProjectInterfaces flags)
, argLinkedSource = Flag True
, argResourcesDir = haddockProjectResourcesDir flags
, argCssFile = haddockProjectCss flags
}

fromPackageDescription :: HaddockTarget -> PackageDescription -> HaddockArgs
Expand Down
3 changes: 2 additions & 1 deletion cabal-install/src/Distribution/Client/CmdHaddock.hs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ mkFlagsAbsolute :: NixStyleFlags ClientHaddockFlags -> IO (NixStyleFlags ClientH
mkFlagsAbsolute relFlags = do
let relHaddockFlags = haddockFlags relFlags
absHaddockOutputDir <- traverse makeAbsolute (haddockOutputDir relHaddockFlags)
return (relFlags{haddockFlags = relHaddockFlags{haddockOutputDir = absHaddockOutputDir}})
absHaddockCss <- traverse makeAbsolute (haddockCss relHaddockFlags)
return (relFlags{haddockFlags = relHaddockFlags{haddockOutputDir = absHaddockOutputDir, haddockCss = absHaddockCss}})

-- | The @haddock@ command is TODO.
--
Expand Down
11 changes: 11 additions & 0 deletions changelog.d/pr-10637
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
synopsis: Fix Haddock CSS handling in multi-package projects
packages: [cabal-install, Cabal]
prs: 10637
issues: [10636]
---

When `--css=<css-file>` flag is provided to `cabal haddock-project`:

- the Haddock index is now properly styled by the provided CSS file
- each package in the project now has their docs properly styled by the provided CSS file

0 comments on commit e2dd95b

Please sign in to comment.