Commit a8f7ecd5 authored by Josh Meredith's avatar Josh Meredith 🇦🇺 Committed by Marge Bot

Use *Mode suffix instead of *M

parent 4374983a
Pipeline #13851 failed with stages
in 466 minutes and 34 seconds
......@@ -18,7 +18,7 @@ import Hadrian.Utilities
-- | Sphinx can be used in three different modes to convert reStructuredText
-- documents into HTML, LaTeX or Man pages.
data SphinxMode = InfoM | HtmlM | LatexM | ManM deriving (Eq, Generic, Show)
data SphinxMode = InfoMode | HtmlMode | LatexMode | ManMode deriving (Eq, Generic, Show)
instance Binary SphinxMode
instance Hashable SphinxMode
......@@ -36,7 +36,7 @@ args mode = do
, arg outPath ]
where
modeString = case mode of
InfoM -> "texinfo"
HtmlM -> "html"
LatexM -> "latex"
ManM -> "man"
InfoMode -> "texinfo"
HtmlMode -> "html"
LatexMode -> "latex"
ManMode -> "man"
......@@ -172,7 +172,7 @@ buildSphinxHtml path = do
rstFilesDir = pathPath path
rstFiles <- getDirectoryFiles rstFilesDir ["**/*.rst"]
need (map (rstFilesDir -/-) rstFiles)
build $ target docContext (Sphinx HtmlM) [pathPath path] [dest]
build $ target docContext (Sphinx HtmlMode) [pathPath path] [dest]
checkSphinxWarnings dest
------------------------------------ Haddock -----------------------------------
......@@ -285,7 +285,7 @@ buildSphinxPdf path = do
let rstFilesDir = pathPath path
rstFiles <- getDirectoryFiles rstFilesDir ["**/*.rst"]
need (map (rstFilesDir -/-) rstFiles)
build $ target docContext (Sphinx LatexM) [pathPath path] [dir]
build $ target docContext (Sphinx LatexMode) [pathPath path] [dir]
checkSphinxWarnings dir
build $ target docContext Xelatex [path <.> "tex"] [dir]
copyFileUntracked (dir -/- path <.> "pdf") file
......@@ -302,7 +302,7 @@ buildSphinxInfoGuide = do
let rstFilesDir = pathPath path
rstFiles <- getDirectoryFiles rstFilesDir ["**/*.rst"]
need (map (rstFilesDir -/-) rstFiles)
build $ target docContext (Sphinx InfoM) [pathPath path] [dir]
build $ target docContext (Sphinx InfoMode) [pathPath path] [dir]
checkSphinxWarnings dir
-- Sphinx outputs texinfo source and a makefile, the
-- default target of which actually produces the target
......@@ -334,7 +334,7 @@ buildManPage = do
root -/- manPageBuildPath %> \file -> do
need ["docs/users_guide/ghc.rst"]
withTempDir $ \dir -> do
build $ target docContext (Sphinx ManM) ["docs/users_guide"] [dir]
build $ target docContext (Sphinx ManMode) ["docs/users_guide"] [dir]
checkSphinxWarnings dir
copyFileUntracked (dir -/- "ghc.1") file
......
......@@ -249,14 +249,14 @@ defaultBuilderArgs = mconcat
, validateBuilderArgs
, xelatexBuilderArgs
-- Generic builders from the Hadrian library:
, builder (Ar Pack ) ? Hadrian.Builder.Ar.args Pack
, builder (Ar Unpack ) ? Hadrian.Builder.Ar.args Unpack
, builder (Sphinx HtmlM ) ? Hadrian.Builder.Sphinx.args HtmlM
, builder (Sphinx LatexM) ? Hadrian.Builder.Sphinx.args LatexM
, builder (Sphinx ManM ) ? Hadrian.Builder.Sphinx.args ManM
, builder (Sphinx InfoM ) ? Hadrian.Builder.Sphinx.args InfoM
, builder (Tar Create ) ? Hadrian.Builder.Tar.args Create
, builder (Tar Extract ) ? Hadrian.Builder.Tar.args Extract ]
, builder (Ar Pack ) ? Hadrian.Builder.Ar.args Pack
, builder (Ar Unpack ) ? Hadrian.Builder.Ar.args Unpack
, builder (Sphinx HtmlMode ) ? Hadrian.Builder.Sphinx.args HtmlMode
, builder (Sphinx LatexMode) ? Hadrian.Builder.Sphinx.args LatexMode
, builder (Sphinx ManMode ) ? Hadrian.Builder.Sphinx.args ManMode
, builder (Sphinx InfoMode ) ? Hadrian.Builder.Sphinx.args InfoMode
, builder (Tar Create ) ? Hadrian.Builder.Tar.args Create
, builder (Tar Extract ) ? Hadrian.Builder.Tar.args Extract ]
-- | All 'Package'-dependent command line arguments.
defaultPackageArgs :: Args
......
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