@@ -38,6 +38,11 @@ main = do
3838 flags <- cmdArgs defaultFlags
3939 mapM parseFile (files flags)
4040
41+config = Config { confIndent = 2, confCompare = keyOrder keys }
42+ where
43+ keys = ["name","document","comment","raw","aliases","datatypes"
44+ ,"values","typeVariables","type","constructors"]
45+
4146parseFile path = do
4247 source <- readFile path
4348 case iParse docs "" source of
@@ -45,7 +50,7 @@ parseFile path = do
4550 putStrLn $ "Documenting " ++ path
4651 let docPath = "docs" </> replaceExtension path ".json"
4752 createDirectoryIfMissing True (dropFileName docPath)
48− BS.writeFile docPath (encodePretty' (defConfig { confIndent = 2 }) json)
53+ BS.writeFile docPath (encodePretty' config json)
4954 Left err -> do
5055 putStrLn $ "Parse error in " ++ path ++ " at " ++ show err
5156 exitFailure