Skip to content
Snippets Groups Projects
Unverified Commit 89f3c30e authored by Marcin Szamotulski's avatar Marcin Szamotulski
Browse files

haddock: added argComponentName to HaddockArgs

Haddock should know the sublibrary name rather than just the package.
For sublibraries `package_name:sublib_name` is used. The name is
recorded in the `.haddock` file and used when haddock creates the
`index.html` file, e.g. when called by `haddock-project` command.
parent 446975f8
No related branches found
No related tags found
No related merge requests found
......@@ -107,6 +107,9 @@ data HaddockArgs = HaddockArgs
-- ^ Path to the interface file, relative to argOutputDir, required.
, argPackageName :: Flag PackageIdentifier
-- ^ Package name, required.
, argComponentName :: Flag String
-- ^ Optional name used to construct haddock's `--package-name` option for
-- various components (tests suites, sublibriaries, etc).
, argHideModules :: (All, [ModuleName.ModuleName])
-- ^ (Hide modules ?, modules to hide)
, argIgnoreExports :: Any
......@@ -723,6 +726,7 @@ fromLibrary verbosity haddockArtifactsDirs lbi clbi htmlTemplate haddockTarget p
args'
{ argHideModules = (mempty, otherModules (libBuildInfo lib))
, argTitle = Flag $ haddockPackageLibraryName pkg_descr lib
, argComponentName = toFlag (haddockPackageLibraryName' (pkgName (package pkg_descr)) (libName lib))
, -- we need to accommodate for `argOutputDir`, see `haddockLibraryPath`
argBaseUrl = case (libName lib, argBaseUrl args') of
(LSubLibName _, Flag url) -> Flag $ ".." </> url
......@@ -1048,7 +1052,10 @@ renderPureArgs version comp platform args =
maybe
[]
( \pkg ->
[ "--package-name=" ++ prettyShow (pkgName pkg)
[ "--package-name="
++ case argComponentName args of
Flag name -> name
_ -> prettyShow (pkgName pkg)
, "--package-version=" ++ prettyShow (pkgVersion pkg)
]
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment