Module CurryDoc.Main

Implementation of CurryDoc, a utility for the automatic generation of HTML documentation from Curry programs.

Author: Michael Hanus, Jan Tikovsky

Version: December 2018

Summary of exported operations:

:: String   
includeDir :: String   
main :: IO ()   
processArgs :: DocOptions -> [String] -> IO ()   
processOpts :: DocOptions -> IO DocOptions   
printUsageMessage :: IO ()   
createDir :: String -> IO ()   
copyDirectory :: String -> String -> IO ()   
Recursively copies a directory structure.
makeCompleteDoc :: DocOptions -> Bool -> String -> String -> IO ()   
The main function of the CurryDoc utility.
makeAbsolute :: String -> IO String   
Transform a file path into an absolute file path:
makeIndexPages :: DocOptions -> String -> [String] -> IO ()   
Generate only the index pages for a list of (already compiled!) modules:
makeSystemLibsIndex :: DocOptions -> String -> [String] -> IO ()   
Generate a system library index page categorizing the given (already compiled!) modules
getModInfo :: String -> IO (Category,String,String)   
prepareDocDir :: DocType -> String -> IO ()   
copyIncludeIfPresent :: String -> String -> IO ()   
readAnaInfo :: String -> IO AnaInfo   
makeDoc :: DocOptions -> Bool -> String -> String -> IO ()   
makeDocWithComments :: DocType -> DocOptions -> Bool -> String -> AnaInfo -> String -> String -> [(SourceLine,String)] -> IO ()   
makeDocIfNecessary :: DocOptions -> Bool -> String -> String -> IO ()   
Generates the documentation for a module if it is necessary.
getImports :: String -> IO [String]   
copyOrMakeDoc :: DocOptions -> Bool -> String -> String -> IO ()   
copyDocIfPossible :: DocOptions -> String -> String -> IO Bool   
Copy the documentation file from standard documentation directoy "CDOC" (used for documentation of system libraries) if possible.
readTypesFuncsWithImports :: String -> IO ([TypeDecl],[FuncDecl])   
fileExtension :: DocType -> String   
writeOutfile :: DocOptions -> Bool -> String -> String -> IO String -> IO ()   

Exported operations:

includeDir :: String   

main :: IO ()   

processArgs :: DocOptions -> [String] -> IO ()   

printUsageMessage :: IO ()   

createDir :: String -> IO ()   

copyDirectory :: String -> String -> IO ()   

Recursively copies a directory structure.

makeCompleteDoc :: DocOptions -> Bool -> String -> String -> IO ()   

The main function of the CurryDoc utility.

Example call:
(makeCompleteDoc docopts recursive docdir modname)
Parameters:
  • docopts : the options for CurryDoc
  • recursive : True if the documentation for the imported modules should be also generated (if necessary)
  • docdir : the directory name containing all documentation files
  • modname : the name of the main module to be documented

makeAbsolute :: String -> IO String   

Transform a file path into an absolute file path:

makeIndexPages :: DocOptions -> String -> [String] -> IO ()   

Generate only the index pages for a list of (already compiled!) modules:

makeSystemLibsIndex :: DocOptions -> String -> [String] -> IO ()   

Generate a system library index page categorizing the given (already compiled!) modules

getModInfo :: String -> IO (Category,String,String)   

prepareDocDir :: DocType -> String -> IO ()   

copyIncludeIfPresent :: String -> String -> IO ()   

readAnaInfo :: String -> IO AnaInfo   

makeDoc :: DocOptions -> Bool -> String -> String -> IO ()   

makeDocWithComments :: DocType -> DocOptions -> Bool -> String -> AnaInfo -> String -> String -> [(SourceLine,String)] -> IO ()   

makeDocIfNecessary :: DocOptions -> Bool -> String -> String -> IO ()   

Generates the documentation for a module if it is necessary. I.e., the documentation is generated if no previous documentation file exists or if the existing documentation file is older than the FlatCurry file.

getImports :: String -> IO [String]   

copyOrMakeDoc :: DocOptions -> Bool -> String -> String -> IO ()   

copyDocIfPossible :: DocOptions -> String -> String -> IO Bool   

Copy the documentation file from standard documentation directoy "CDOC" (used for documentation of system libraries) if possible. Returns true if the copy was possible.

readTypesFuncsWithImports :: String -> IO ([TypeDecl],[FuncDecl])   

fileExtension :: DocType -> String   

Further infos:
  • solution complete, i.e., able to compute all solutions

writeOutfile :: DocOptions -> Bool -> String -> String -> IO String -> IO ()