git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Remove hierarchy options
commit446d7c153a1e1d804683f4db0cd3368b8a264278 authorGary Burgess <gary.burgess@gmail.com> dateSat 21 Feb 2015, 01:23 (12 years ago) parent732e60e
1 file changed+9−16
psc-docs/Main.hs+9−16
psc-docs/Main.hs+9−16
@@ -31,19 +31,18 @@ import System.Exit (exitSuccess, exitFailure)
3131import System.IO (hPutStrLn, stderr)
3232
3333data PSCDocsOptions = PSCDocsOptions
34− { pscdIncludeHeir :: Bool
35− , pscdInputFiles :: [FilePath]
34+ { pscdInputFiles :: [FilePath]
3635 }
3736
3837docgen :: PSCDocsOptions -> IO ()
39−docgen (PSCDocsOptions showHierarchy input) = do
38+docgen (PSCDocsOptions input) = do
4039 e <- P.parseModulesFromFiles (fromMaybe "") <$> mapM (fmap (first Just) . parseFile) (nub input)
4140 case e of
4241 Left err -> do
4342 hPutStrLn stderr $ show err
4443 exitFailure
4544 Right ms -> do
46− putStrLn . runDocs $ renderModules showHierarchy (map snd ms)
45+ putStrLn . runDocs $ renderModules (map snd ms)
4746 exitSuccess
4847
4948parseFile :: FilePath -> IO (FilePath, String)
@@ -71,14 +70,14 @@ atIndent indent text =
7170ticks :: String -> String
7271ticks = ("`" ++) . (++ "`")
7372
74−renderModules :: Bool -> [P.Module] -> Docs
75−renderModules showHierarchy ms = do
73+renderModules :: [P.Module] -> Docs
74+renderModules ms = do
7675 headerLevel 1 "Module Documentation"
7776 spacer
78− mapM_ (renderModule showHierarchy) ms
77+ mapM_ renderModule ms
7978
80−renderModule :: Bool -> P.Module -> Docs
81−renderModule showHierarchy mdl@(P.Module moduleName _ exps) = do
79+renderModule :: P.Module -> Docs
80+renderModule mdl@(P.Module moduleName _ exps) = do
8281 headerLevel 2 $ "Module " ++ P.runModuleName moduleName
8382 spacer
8483 renderTopLevel exps (P.exportedDeclarations mdl)
@@ -212,14 +211,8 @@ inputFile = strArgument $
212211 metavar "FILE"
213212 <> help "The input .purs file(s)"
214213
215−includeHierarcy :: Parser Bool
216−includeHierarcy = switch $
217− long "hierarchy-images"
218− <> help "Include markdown for type class hierarchy images in the output."
219−
220214pscDocsOptions :: Parser PSCDocsOptions
221−pscDocsOptions = PSCDocsOptions <$> includeHierarcy
222− <*> many inputFile
215+pscDocsOptions = PSCDocsOptions <$> many inputFile
223216
224217main :: IO ()
225218main = execParser opts >>= docgen