diff options
Diffstat (limited to 'haddock-api/src/Haddock.hs')
-rw-r--r-- | haddock-api/src/Haddock.hs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index ea664bcf..f4bc355e 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -36,6 +36,7 @@ import Haddock.Backends.Xhtml.Themes (getThemes) import Haddock.Backends.LaTeX import Haddock.Backends.Hoogle import Haddock.Backends.Hyperlinker +import Haddock.Backends.Org import Haddock.Interface import Haddock.Interface.Json import Haddock.Parser @@ -66,7 +67,7 @@ import System.FilePath import System.Environment (getExecutablePath) #else import qualified GHC.Paths as GhcPaths -import Paths_haddock_api (getDataDir) +import Paths_haddorg_api (getDataDir) #endif import System.Directory (doesDirectoryExist, getTemporaryDirectory) @@ -221,7 +222,7 @@ haddockWithGhc ghc args = handleTopExceptions $ do liftIO $ renderStep logger dflags unit_state flags sinceQual qual packages ifaces else do - when (any (`elem` [Flag_Html, Flag_Hoogle, Flag_LaTeX]) flags) $ + when (any (`elem` [Flag_Html, Flag_Hoogle, Flag_LaTeX, Flag_Org]) flags) $ throwE "No input file(s)." -- Get packages supplied with --read-interface. @@ -510,6 +511,11 @@ render log' dflags unit_state flags sinceQual qual ifaces packages extSrcMap = d ppLaTeX title pkgStr visibleIfaces odir (fmap _doc prologue) opt_latex_style libDir return () + when (Flag_Org `elem` flags) $ do + withTiming logger dflags' "ppOrg" (const ()) $ do + _ <- {-# SCC ppOrg #-} + ppOrg title pkgStr odir (_doc <$> prologue) visibleIfaces + return () when (Flag_HyperlinkedSource `elem` flags && not (null ifaces)) $ do withTiming logger "ppHyperlinkedSource" (const ()) $ do |