Commit e1c9afa3 authored by Zhen Zhang's avatar Zhen Zhang Committed by Andrey Mokhov

Build man page (#424)

parent c6d7b2a3
......@@ -22,12 +22,17 @@ documentationRules = do
buildHtmlDocumentation
buildPdfDocumentation
buildDocumentationArchives
buildManPage
"docs" ~> do
root <- buildRoot
let html = htmlRoot -/- "index.html"
archives = map pathArchive docPaths
pdfs = map pathPdf $ docPaths \\ [ "libraries" ]
need $ map (root -/-) $ [html] ++ archives ++ pdfs
need [manPagePath]
manPagePath :: FilePath
manPagePath = "_build/docs/users_guide/build-man/ghc.1"
-- TODO: Add support for Documentation Packages so we can
-- run the builders without this hack.
......@@ -176,3 +181,13 @@ buildArchive path = do
src = root -/- pathIndex path
need [src]
build $ target context (Tar Create) [takeDirectory src] [file]
-- | build man page
buildManPage :: Rules ()
buildManPage = do
manPagePath %> \file -> do
need ["docs/users_guide/ghc.rst"]
let context = vanillaContext Stage0 docPackage
withTempDir $ \dir -> do
build $ target context (Sphinx Man) ["docs/users_guide"] [dir]
copyFileUntracked (dir -/- "ghc.1") file
......@@ -16,7 +16,7 @@ sphinxBuilderArgs = do
, arg =<< getInput
, arg outPath ]
, builder (Sphinx Man) ? mconcat
[ arg "-b", arg "latex"
[ arg "-b", arg "man"
, arg "-d", arg $ outPath -/- ".doctrees-man"
, arg =<< getInput
, arg outPath ] ]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment