mirror of
https://github.com/Haskell-Things/ImplicitCAD.git
synced 2024-11-04 01:26:48 +03:00
Whitespace cleanup
This commit is contained in:
parent
8478f7346c
commit
9c1bfc77c4
@ -74,7 +74,6 @@ defaultFunctionsSpecial =
|
||||
("map", toOObj $ flip
|
||||
(map :: (OVal -> OVal) -> [OVal] -> [OVal] )
|
||||
)
|
||||
|
||||
]
|
||||
|
||||
defaultModules :: [(String, OVal)]
|
||||
|
@ -24,7 +24,6 @@ import Graphics.Implicit.ExtOpenScad.Eval.Expr (evalExpr, matchPat)
|
||||
import Graphics.Implicit.ExtOpenScad.Parser.Statement (parseProgram)
|
||||
|
||||
import Data.Maybe(fromMaybe)
|
||||
|
||||
import qualified Data.Map as Map
|
||||
import Control.Monad (forM_, forM, mapM_)
|
||||
import Control.Monad.State (get, liftIO, mapM, runStateT, (>>))
|
||||
|
54
docgen.hs
54
docgen.hs
@ -17,34 +17,34 @@ isArgument (ArgumentDoc _ _ _) = True
|
||||
isArgument _ = False
|
||||
|
||||
main = do
|
||||
let names = map fst primitives
|
||||
docs <- sequence $ map (getArgParserDocs.($ []).snd) primitives
|
||||
let names = map fst primitives
|
||||
docs <- sequence $ map (getArgParserDocs.($ []).snd) primitives
|
||||
|
||||
forM_ (zip names docs) $ \(moduleName, moduleDocList) -> do
|
||||
let
|
||||
examples = filter isExample moduleDocList
|
||||
arguments = filter isArgument moduleDocList
|
||||
putStrLn moduleName
|
||||
putStrLn (map (const '-') moduleName)
|
||||
putStrLn ""
|
||||
if not $ null examples then putStrLn "**Examples:**\n" else return ()
|
||||
forM_ examples $ \(ExampleDoc example) -> do
|
||||
putStrLn $ " * `" ++ example ++ "`"
|
||||
putStrLn ""
|
||||
putStrLn "**Arguments:**\n"
|
||||
forM_ arguments $ \(ArgumentDoc name posfallback description) ->
|
||||
case (posfallback, description) of
|
||||
(Nothing, "") -> do
|
||||
putStrLn $ " * `" ++ name ++ "`"
|
||||
(Just fallback, "") -> do
|
||||
putStrLn $ " * `" ++ name ++ " = " ++ fallback ++ "`"
|
||||
(Nothing, _) -> do
|
||||
putStrLn $ " * `" ++ name ++ "`"
|
||||
putStrLn $ " " ++ description
|
||||
(Just fallback, _) -> do
|
||||
putStrLn $ " * `" ++ name ++ " = " ++ fallback ++ "`"
|
||||
putStrLn $ " " ++ description
|
||||
putStrLn ""
|
||||
forM_ (zip names docs) $ \(moduleName, moduleDocList) -> do
|
||||
let
|
||||
examples = filter isExample moduleDocList
|
||||
arguments = filter isArgument moduleDocList
|
||||
putStrLn moduleName
|
||||
putStrLn (map (const '-') moduleName)
|
||||
putStrLn ""
|
||||
if not $ null examples then putStrLn "**Examples:**\n" else return ()
|
||||
forM_ examples $ \(ExampleDoc example) -> do
|
||||
putStrLn $ " * `" ++ example ++ "`"
|
||||
putStrLn ""
|
||||
putStrLn "**Arguments:**\n"
|
||||
forM_ arguments $ \(ArgumentDoc name posfallback description) ->
|
||||
case (posfallback, description) of
|
||||
(Nothing, "") -> do
|
||||
putStrLn $ " * `" ++ name ++ "`"
|
||||
(Just fallback, "") -> do
|
||||
putStrLn $ " * `" ++ name ++ " = " ++ fallback ++ "`"
|
||||
(Nothing, _) -> do
|
||||
putStrLn $ " * `" ++ name ++ "`"
|
||||
putStrLn $ " " ++ description
|
||||
(Just fallback, _) -> do
|
||||
putStrLn $ " * `" ++ name ++ " = " ++ fallback ++ "`"
|
||||
putStrLn $ " " ++ description
|
||||
putStrLn ""
|
||||
|
||||
-- | We need a format to extract documentation into
|
||||
data Doc = Doc String [DocPart]
|
||||
|
Loading…
Reference in New Issue
Block a user