Graphalyze-0.3: Graph-Theoretic Analysis library.Source codeContentsIndex
Data.Graph.Analysis.Reporting
MaintainerIvan.Miljenovic@gmail.com
Contents
Document representation
Helper functions
Description
This module defines the report framework used.
Synopsis
data Document = Doc {
rootDirectory :: FilePath
fileFront :: String
title :: DocInline
author :: String
date :: String
content :: [DocElement]
}
class DocumentGenerator dg where
createDocument :: dg -> Document -> IO (Maybe FilePath)
docExtension :: dg -> String
data Location
= URL String
| File FilePath
data DocElement
= Section DocInline [DocElement]
| Paragraph [DocInline]
| Enumeration [DocElement]
| Itemized [DocElement]
| Definition DocInline DocElement
| DocImage DocInline Location
| GraphImage DocGraph
data DocInline
= Text String
| BlankSpace
| Grouping [DocInline]
| Bold DocInline
| Emphasis DocInline
| DocLink DocInline Location
type DocGraph = (FilePath, DocInline, DotGraph)
today :: IO String
tryCreateDirectory :: FilePath -> IO Bool
createGraph :: FilePath -> DocGraph -> IO (Maybe DocElement)
Document representation
Document is the simplified representation of a document. Note that this just specifies a document layout, and not an implementation. To actually create a "physical" document, you must use an instance of DocumentGenerator.
data Document Source
Representation of a document. The document is to be stored in the directory rootDirectory, and the main file is to have a filename of fileFront <.> (docExtension dg), where dg is an instance of DocumentGenerator.
Constructors
Doc
rootDirectory :: FilePathDocument location
fileFront :: String
title :: DocInlinePre-matter
author :: String
date :: String
content :: [DocElement]Main-matter
class DocumentGenerator dg whereSource
Represents the class of document generators.
Methods
createDocument :: dg -> Document -> IO (Maybe FilePath)Source
Convert idealised Document values into actual documents, returning the document file created.
docExtension :: dg -> StringSource
The extension of all document-style files created. Note that this doesn't preclude the creation of other files, e.g. images.
show/hide Instances
data Location Source
Representation of a location, either on the internet or locally.
Constructors
URL String
File FilePath
show/hide Instances
data DocElement Source
Elements of a document.
Constructors
Section DocInline [DocElement]
Paragraph [DocInline]
Enumeration [DocElement]
Itemized [DocElement]
Definition DocInline DocElement
DocImage DocInline Location
GraphImage DocGraph
data DocInline Source
Constructors
Text String
BlankSpace
Grouping [DocInline]
Bold DocInline
Emphasis DocInline
DocLink DocInline Location
type DocGraph = (FilePath, DocInline, DotGraph)Source
Helper functions
Utility functions to help with document creation.
today :: IO StringSource
Return today's date as a string, e.g. "Monday 1 January, 2000". This arbitrary format is chosen as there doesn't seem to be a way of determining the correct format as per the user's locale settings.
tryCreateDirectory :: FilePath -> IO BoolSource
Attempts to create the specified directly, returning True if successful (or if the directory already exists), False if an error occurred.
createGraph :: FilePath -> DocGraph -> IO (Maybe DocElement)Source
Attempts to creates a png file (with the given filename in the given directory) and - if successful - returns a DocImage link.
Produced by Haddock version 2.1.0