Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e2dd95b

Browse files
ozkutukMikolaj
authored andcommittedDec 15, 2024·
haddock: make CSS path absolute, use it for index generation
1 parent 33b19e4 commit e2dd95b

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed
 

‎Cabal/src/Distribution/Simple/Haddock.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ fromHaddockProjectFlags flags =
617617
, argInterfaces = fromFlagOrDefault [] (haddockProjectInterfaces flags)
618618
, argLinkedSource = Flag True
619619
, argResourcesDir = haddockProjectResourcesDir flags
620+
, argCssFile = haddockProjectCss flags
620621
}
621622

622623
fromPackageDescription :: HaddockTarget -> PackageDescription -> HaddockArgs

‎cabal-install/src/Distribution/Client/CmdHaddock.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ mkFlagsAbsolute :: NixStyleFlags ClientHaddockFlags -> IO (NixStyleFlags ClientH
136136
mkFlagsAbsolute relFlags = do
137137
let relHaddockFlags = haddockFlags relFlags
138138
absHaddockOutputDir <- traverse makeAbsolute (haddockOutputDir relHaddockFlags)
139-
return (relFlags{haddockFlags = relHaddockFlags{haddockOutputDir = absHaddockOutputDir}})
139+
absHaddockCss <- traverse makeAbsolute (haddockCss relHaddockFlags)
140+
return (relFlags{haddockFlags = relHaddockFlags{haddockOutputDir = absHaddockOutputDir, haddockCss = absHaddockCss}})
140141

141142
-- | The @haddock@ command is TODO.
142143
--

‎changelog.d/pr-10637

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
synopsis: Fix Haddock CSS handling in multi-package projects
3+
packages: [cabal-install, Cabal]
4+
prs: 10637
5+
issues: [10636]
6+
---
7+
8+
When `--css=<css-file>` flag is provided to `cabal haddock-project`:
9+
10+
- the Haddock index is now properly styled by the provided CSS file
11+
- each package in the project now has their docs properly styled by the provided CSS file

0 commit comments

Comments
 (0)
Please sign in to comment.