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

Rename SphinxMode constructors

parent 41f4e4fb
......@@ -10,7 +10,7 @@
-----------------------------------------------------------------------------
module Hadrian.Builder.Sphinx (SphinxMode (..), args) where
import Development.Shake hiding (Verbosity(..))
import Development.Shake
import Development.Shake.Classes
import GHC.Generics
import Hadrian.Expression
......@@ -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 = Info | Html | Latex | Man deriving (Eq, Generic, Show)
data SphinxMode = InfoM | HtmlM | LatexM | ManM deriving (Eq, Generic, Show)
instance Binary SphinxMode
instance Hashable SphinxMode
......@@ -36,7 +36,7 @@ args mode = do
, arg outPath ]
where
modeString = case mode of
Info -> "texinfo"
Html -> "html"
Latex -> "latex"
Man -> "man"
InfoM -> "texinfo"
HtmlM -> "html"
LatexM -> "latex"
ManM -> "man"
......@@ -172,7 +172,7 @@ buildSphinxHtml path = do
rstFilesDir = pathPath path
rstFiles <- getDirectoryFiles rstFilesDir ["**/*.rst"]
need (map (rstFilesDir -/-) rstFiles)
build $ target docContext (Sphinx Html) [pathPath path] [dest]
build $ target docContext (Sphinx HtmlM) [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 Latex) [pathPath path] [dir]
build $ target docContext (Sphinx LatexM) [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 Info) [pathPath path] [dir]
build $ target docContext (Sphinx InfoM) [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 Man) ["docs/users_guide"] [dir]
build $ target docContext (Sphinx ManM) ["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 Html ) ? Hadrian.Builder.Sphinx.args Html
, builder (Sphinx Latex) ? Hadrian.Builder.Sphinx.args Latex
, builder (Sphinx Man ) ? Hadrian.Builder.Sphinx.args Man
, builder (Sphinx Info ) ? Hadrian.Builder.Sphinx.args Info
, 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 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 ]
-- | 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