Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Contains types and functions common to aspects of generating documents.
Synopsis
- data ListType
- data ItemType
- type MaxWidthPercent = Float
- type Title = Sentence
- type Author = Sentence
- type Header = Sentence
- type Depth = Int
- type Width = Float
- type Height = Float
- type ListTuple = (Title, ItemType, Maybe String)
- type Filepath = String
- type Lbl = Sentence
- data Contents
- data DType
- data HasCaption
- data RawContent
- = Table [Sentence] [[Sentence]] Title Bool
- | Paragraph Sentence
- | EqnBlock ModelExpr
- | DerivBlock Sentence [RawContent]
- | Enumeration ListType
- | Defini DType [(Identifier, [Contents])]
- | Figure Lbl Filepath MaxWidthPercent HasCaption
- | Bib BibRef
- | Graph [(Sentence, Sentence)] (Maybe Width) (Maybe Height) Lbl
- | CodeBlock CodeExpr
- type Identifier = String
- data LabelledContent = LblC {
- _ref :: Reference
- _ctype :: RawContent
- newtype UnlabelledContent = UnlblC {}
- ref :: Lens' LabelledContent Reference
- ctype :: Lens' LabelledContent RawContent
- cntnts :: Iso' UnlabelledContent RawContent
- class HasContents c where
- accessContents :: Lens' c RawContent
- prependLabel :: RawContent -> IRefProg
Lists
Denotes the different possible types that can be used as a list.
Bullet [(ItemType, Maybe String)] | Bulleted list. |
Numeric [(ItemType, Maybe String)] | Enumerated list. |
Simple [ListTuple] | Simple list with items denoted by |
Desc [ListTuple] | Descriptive list, renders as "Title: Item" (see |
Definitions [ListTuple] | Renders a list of " |
Denotes how something should behave in a list (ListType
).
type MaxWidthPercent = Float Source #
MaxWidthPercent should be kept in the range 1-100.
Values outside this range may have unexpected results.
Used for specifying max figure width as
pagewidth*MaxWidthPercent/100
.
Contents
Contents may be labelled or unlabelled.
Instances
HasContents Contents Source # | Access the |
Defined in Language.Drasil.Document.Core accessContents :: Lens' Contents RawContent Source # |
Types of definitions (general, instance, theory, or data).
data HasCaption Source #
Indicates whether a figure has a caption or not.
Instances
Eq HasCaption Source # | |
Defined in Language.Drasil.Document.Core (==) :: HasCaption -> HasCaption -> Bool # (/=) :: HasCaption -> HasCaption -> Bool # |
data RawContent Source #
Types of layout objects we deal with explicitly.
Table [Sentence] [[Sentence]] Title Bool | table has: header-row, data(rows), label/caption, and a bool that determines whether or not to show label. |
Paragraph Sentence | Paragraphs are just sentences. |
EqnBlock ModelExpr | Block of Equations holds an expression. |
DerivBlock Sentence [RawContent] | Grants the ability to label a group of |
Enumeration ListType | For enumerated lists. |
Defini DType [(Identifier, [Contents])] | Defines something with a type, identifier, and |
Figure Lbl Filepath MaxWidthPercent HasCaption | For creating figures in a document includes whether the figure has a caption. |
Bib BibRef | Grants the ability to reference something. |
Graph [(Sentence, Sentence)] (Maybe Width) (Maybe Height) Lbl | Contain a graph with coordinates ( |
CodeBlock CodeExpr | Block for codes TODO: Fill this one in. |
type Identifier = String Source #
An identifier is just a String
.
data LabelledContent Source #
Contains a Reference
and RawContent
.
LblC | |
|
Instances
newtype UnlabelledContent Source #
Only contains RawContent
.
Instances
HasContents UnlabelledContent Source # | Access the |
Defined in Language.Drasil.Document.Core accessContents :: Lens' UnlabelledContent RawContent Source # |
ref :: Lens' LabelledContent Reference Source #
ctype :: Lens' LabelledContent RawContent Source #
cntnts :: Iso' UnlabelledContent RawContent Source #
class HasContents c where Source #
Members of this class must have RawContent
.
accessContents :: Lens' c RawContent Source #
Provides a Lens
to the RawContent
.
Instances
HasContents Contents Source # | Access the |
Defined in Language.Drasil.Document.Core accessContents :: Lens' Contents RawContent Source # | |
HasContents LabelledContent Source # | Access the |
Defined in Language.Drasil.Document.Core accessContents :: Lens' LabelledContent RawContent Source # | |
HasContents UnlabelledContent Source # | Access the |
Defined in Language.Drasil.Document.Core accessContents :: Lens' UnlabelledContent RawContent Source # |
Helper
prependLabel :: RawContent -> IRefProg Source #
Helper to prepend labels to LabelledContent
when referencing.