Module CurryDoc.Html

Operations to generate documentation in HTML format.

Author: Michael Hanus, Jan Tikovsky

Version: December 2020

Summary of exported operations:

generateHtmlDocs :: DocOptions -> AnaInfo -> String -> String -> [(SourceLine,String)] -> IO String   
attachProperties2Funcs :: [CFuncDecl] -> [(SourceLine,String)] -> [(String,[(FuncAttachment,String,[BaseHtml])])]   
docComment2HTML :: DocOptions -> String -> [BaseHtml]   
Translate a documentation comment to HTML and use markdown translation if necessary
replaceIdLinks :: DocOptions -> String -> String   
genHtmlExportIndex :: [String] -> [String] -> [String] -> [String] -> BaseHtml   
tName :: CTypeDecl -> String   
fName :: CFuncDecl -> String   
cName :: CConsDecl -> String   
fldName :: CFieldDecl -> String   
isExportedType :: CTypeDecl -> Bool   
isExportedCons :: CConsDecl -> Bool   
isExportedFun :: CFuncDecl -> Bool   
isExportedField :: CFieldDecl -> Bool   
getExportedCons :: [CTypeDecl] -> [String]   
getExportedFields :: [CTypeDecl] -> [String]   
isProperty :: CFuncDecl -> Bool   
isSpecFunc :: CFuncDecl -> Bool   
genHtmlModule :: DocOptions -> String -> [BaseHtml]   
generate HTML documentation for a module:
ulistOrEmpty :: [[BaseHtml]] -> [BaseHtml]   
ifNotNull :: [a] -> ([a] -> [b]) -> [b]   
genHtmlType :: DocOptions -> [(SourceLine,String)] -> CTypeDecl -> [BaseHtml]   
generate HTML documentation for a datatype if it is exported:
genHtmlCons :: DocOptions -> [(String,String)] -> String -> [(Int,String)] -> [(String,String)] -> CConsDecl -> [BaseHtml]   
generate HTML documentation for a constructor if it is exported:
genHtmlField :: DocOptions -> [String] -> String -> [(String,String)] -> CFieldDecl -> [BaseHtml]   
genHtmlFuncShort :: DocOptions -> [(SourceLine,String)] -> AnaInfo -> CFuncDecl -> [[BaseHtml]]   
genHtmlFunc :: DocOptions -> String -> [(SourceLine,String)] -> [(String,[(FuncAttachment,String,[BaseHtml])])] -> AnaInfo -> [COpDecl] -> CFuncDecl -> BaseHtml   
removeDash :: String -> String   
removeTopPar :: [BaseHtml] -> [BaseHtml]   
genFuncPropIcons :: AnaInfo -> (String,String) -> [BaseHtml]   
Generates icons for particular properties of functions.
genFuncPropComments :: AnaInfo -> (String,String) -> [CRule] -> [COpDecl] -> [[BaseHtml]]   
Generates further textual infos about particular properties of a function.
genFixityInfo :: (String,String) -> [COpDecl] -> [BaseHtml]   
Generates a comment about the associativity and precedence if the name is defined as an infix operator.
showQualType :: DocOptions -> String -> CQualTypeExpr -> String   
showContext :: DocOptions -> String -> CContext -> String   
showConstraint :: DocOptions -> String -> ((String,String),CTypeExpr) -> String   
Pretty-print a single class constraint.
showType :: DocOptions -> String -> Bool -> CTypeExpr -> String   
showTConsType :: DocOptions -> String -> Bool -> (String,String) -> [CTypeExpr] -> String   
showTypeCons :: DocOptions -> String -> (String,String) -> String   
translateSource2ColoredHtml :: String -> String -> IO ()   
translateSource2AnchoredHtml :: String -> String -> IO ()   
addFuncAnchors :: [String] -> [String] -> String   
genMainIndexPage :: DocOptions -> String -> [String] -> IO ()   
allConsFuncsMenu :: [[BaseHtml]]   
indexPage :: [String] -> [BaseHtml]   
explainIcons :: BaseHtml   
genFunctionIndexPage :: DocOptions -> String -> [FuncDecl] -> IO ()   
htmlFuncIndex :: DocOptions -> [(String,String)] -> [BaseHtml]   
showModNameRef :: DocOptions -> (String,String) -> (String,[BaseHtml])   
sortNames :: [(a,String)] -> [(a,String)]   
genConsIndexPage :: DocOptions -> String -> [TypeDecl] -> IO ()   
htmlConsIndex :: DocOptions -> [(String,String)] -> [BaseHtml]   
genSystemLibsPage :: String -> [Category] -> [[(Category,String,String)]] -> IO ()   
syslibsLeftTopMenu :: [[BaseHtml]]   
syslibsRightTopMenu :: [[BaseHtml]]   
syslibsSideMenu :: [Category] -> [BaseHtml]   
infoTxt :: BaseHtml   
genCatLink :: Category -> String   
genHtmlLibCats :: [[(Category,String,String)]] -> [BaseHtml]   
genHtmlLibCat :: [(Category,String,String)] -> [BaseHtml]   
mainPage :: String -> [BaseHtml] -> [[BaseHtml]] -> [[BaseHtml]] -> [BaseHtml] -> [BaseHtml] -> IO String   
Generate the main page with the default documentation style.
cssIncludes :: [String]   
homeBrand :: (String,[BaseHtml])   
showPageWithDocStyle :: String -> [BaseHtml] -> String   
Generate a page with the default documentation style.
rightTopMenu :: [[BaseHtml]]   
The standard right top menu.
extLinkIcon :: BaseHtml   
detIcon :: BaseHtml   
nondetIcon :: BaseHtml   
withTitle :: BaseHtml -> String -> BaseHtml   
curryDocFooter :: CalendarTime -> [BaseHtml]   
curryHomeItem :: [BaseHtml]   
simplePage :: String -> Maybe [BaseHtml] -> [[BaseHtml]] -> [BaseHtml] -> IO String   
Generate a simple page with the default documentation style.
anchoredSection :: String -> [BaseHtml] -> BaseHtml   
An anchored section in the document:
anchored :: String -> [BaseHtml] -> BaseHtml   
An anchored element in the document:
anchoredDiv :: String -> [BaseHtml] -> BaseHtml   
An anchored element in the document:
borderedTable :: [[[BaseHtml]]] -> BaseHtml   
A bordered table:
ehref :: String -> [BaseHtml] -> BaseHtml   
An external reference
leqList :: Eq a => (a -> a -> Bool) -> [a] -> [a] -> Bool   
Less-or-equal on lists.
leqCharIgnoreCase :: Char -> Char -> Bool   
Less-or-equal on characters ignoring case considerations.
leqStringIgnoreCase :: String -> String -> Bool   
Less-or-equal on strings ignoring case considerations.
stripSpaces :: String -> String   
explainCat :: String -> BaseHtml   
opnameDoc :: [BaseHtml] -> BaseHtml   
sortStrings :: [String] -> [String]   
firstSentence :: String -> String   
firstPassage :: String -> String   

Exported datatypes:


FuncAttachment

Constructors:

  • Property :: FuncAttachment
  • PreCond :: FuncAttachment
  • PostCond :: FuncAttachment
  • SpecFun :: FuncAttachment

Exported operations:

generateHtmlDocs :: DocOptions -> AnaInfo -> String -> String -> [(SourceLine,String)] -> IO String   

attachProperties2Funcs :: [CFuncDecl] -> [(SourceLine,String)] -> [(String,[(FuncAttachment,String,[BaseHtml])])]   

docComment2HTML :: DocOptions -> String -> [BaseHtml]   

Translate a documentation comment to HTML and use markdown translation if necessary

Returns:
: either a paragraph (<p>) element or an empty list.

genHtmlExportIndex :: [String] -> [String] -> [String] -> [String] -> BaseHtml   

tName :: CTypeDecl -> String   

fName :: CFuncDecl -> String   

cName :: CConsDecl -> String   

fldName :: CFieldDecl -> String   

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

isExportedType :: CTypeDecl -> Bool   

isExportedCons :: CConsDecl -> Bool   

isExportedFun :: CFuncDecl -> Bool   

isExportedField :: CFieldDecl -> Bool   

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

getExportedCons :: [CTypeDecl] -> [String]   

getExportedFields :: [CTypeDecl] -> [String]   

isProperty :: CFuncDecl -> Bool   

isSpecFunc :: CFuncDecl -> Bool   

genHtmlModule :: DocOptions -> String -> [BaseHtml]   

generate HTML documentation for a module:

ulistOrEmpty :: [[BaseHtml]] -> [BaseHtml]   

ifNotNull :: [a] -> ([a] -> [b]) -> [b]   

genHtmlType :: DocOptions -> [(SourceLine,String)] -> CTypeDecl -> [BaseHtml]   

generate HTML documentation for a datatype if it is exported:

genHtmlCons :: DocOptions -> [(String,String)] -> String -> [(Int,String)] -> [(String,String)] -> CConsDecl -> [BaseHtml]   

generate HTML documentation for a constructor if it is exported:

genHtmlField :: DocOptions -> [String] -> String -> [(String,String)] -> CFieldDecl -> [BaseHtml]   

genHtmlFuncShort :: DocOptions -> [(SourceLine,String)] -> AnaInfo -> CFuncDecl -> [[BaseHtml]]   

genHtmlFunc :: DocOptions -> String -> [(SourceLine,String)] -> [(String,[(FuncAttachment,String,[BaseHtml])])] -> AnaInfo -> [COpDecl] -> CFuncDecl -> BaseHtml   

removeDash :: String -> String   

removeTopPar :: [BaseHtml] -> [BaseHtml]   

genFuncPropIcons :: AnaInfo -> (String,String) -> [BaseHtml]   

Generates icons for particular properties of functions.

genFuncPropComments :: AnaInfo -> (String,String) -> [CRule] -> [COpDecl] -> [[BaseHtml]]   

Generates further textual infos about particular properties of a function. The result is a list of HTML expressions to be formatted (if not empty) as some HTML list.

genFixityInfo :: (String,String) -> [COpDecl] -> [BaseHtml]   

Generates a comment about the associativity and precedence if the name is defined as an infix operator.

showQualType :: DocOptions -> String -> CQualTypeExpr -> String   

showContext :: DocOptions -> String -> CContext -> String   

showConstraint :: DocOptions -> String -> ((String,String),CTypeExpr) -> String   

Pretty-print a single class constraint.

showType :: DocOptions -> String -> Bool -> CTypeExpr -> String   

showTConsType :: DocOptions -> String -> Bool -> (String,String) -> [CTypeExpr] -> String   

showTypeCons :: DocOptions -> String -> (String,String) -> String   

translateSource2ColoredHtml :: String -> String -> IO ()   

translateSource2AnchoredHtml :: String -> String -> IO ()   

addFuncAnchors :: [String] -> [String] -> String   

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

allConsFuncsMenu :: [[BaseHtml]]   

indexPage :: [String] -> [BaseHtml]   

genFunctionIndexPage :: DocOptions -> String -> [FuncDecl] -> IO ()   

htmlFuncIndex :: DocOptions -> [(String,String)] -> [BaseHtml]   

showModNameRef :: DocOptions -> (String,String) -> (String,[BaseHtml])   

sortNames :: [(a,String)] -> [(a,String)]   

genConsIndexPage :: DocOptions -> String -> [TypeDecl] -> IO ()   

htmlConsIndex :: DocOptions -> [(String,String)] -> [BaseHtml]   

genSystemLibsPage :: String -> [Category] -> [[(Category,String,String)]] -> IO ()   

infoTxt :: BaseHtml   

genHtmlLibCats :: [[(Category,String,String)]] -> [BaseHtml]   

genHtmlLibCat :: [(Category,String,String)] -> [BaseHtml]   

mainPage :: String -> [BaseHtml] -> [[BaseHtml]] -> [[BaseHtml]] -> [BaseHtml] -> [BaseHtml] -> IO String   

Generate the main page with the default documentation style.

Example call:
(mainPage title htmltitle lefttopmenu righttopmenu sidemenu maindoc)
Parameters:
  • title : the title of the page
  • htmltitle : the title in HTML format (shown as h1)
  • lefttopmenu : the menu shown at left of the top
  • righttopmenu : the menu shown at right of the top
  • sidemenu : the menu shown at the left-hand side
  • maindoc : the main contents of the page

cssIncludes :: [String]   

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

homeBrand :: (String,[BaseHtml])   

showPageWithDocStyle :: String -> [BaseHtml] -> String   

Generate a page with the default documentation style.

Example call:
(showPageWithDocStyle title body)
Parameters:
  • title : the title of the page
  • body : the main contents of the page

rightTopMenu :: [[BaseHtml]]   

The standard right top menu.

detIcon :: BaseHtml   

nondetIcon :: BaseHtml   

withTitle :: BaseHtml -> String -> BaseHtml   

Further infos:
  • defined as left-associative infix operator with precedence 0

curryHomeItem :: [BaseHtml]   

simplePage :: String -> Maybe [BaseHtml] -> [[BaseHtml]] -> [BaseHtml] -> IO String   

Generate a simple page with the default documentation style.

Example call:
(simplePage title htmltitle lefttopmenu doc)
Parameters:
  • title : the title of the page
  • htmltitle : maybe a specific title for h1 header
  • lefttopmenu : the menu shown at left of the top
  • doc : the main contents of the page

anchoredSection :: String -> [BaseHtml] -> BaseHtml   

An anchored section in the document:

anchored :: String -> [BaseHtml] -> BaseHtml   

An anchored element in the document:

anchoredDiv :: String -> [BaseHtml] -> BaseHtml   

An anchored element in the document:

borderedTable :: [[[BaseHtml]]] -> BaseHtml   

A bordered table:

ehref :: String -> [BaseHtml] -> BaseHtml   

An external reference

leqList :: Eq a => (a -> a -> Bool) -> [a] -> [a] -> Bool   

Less-or-equal on lists.

leqCharIgnoreCase :: Char -> Char -> Bool   

Less-or-equal on characters ignoring case considerations.

leqStringIgnoreCase :: String -> String -> Bool   

Less-or-equal on strings ignoring case considerations.

stripSpaces :: String -> String   

explainCat :: String -> BaseHtml   

opnameDoc :: [BaseHtml] -> BaseHtml   

sortStrings :: [String] -> [String]   

firstSentence :: String -> String   

firstPassage :: String -> String