drasil-lang-0.1.60.0: A framework for code and document generation for scientific software - Language SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Drasil.Document.Core

Description

Contains types and functions common to aspects of generating documents.

Synopsis

Lists

data ListType Source #

Denotes the different possible types that can be used as a list.

Constructors

Bullet [(ItemType, Maybe String)]

Bulleted list.

Numeric [(ItemType, Maybe String)]

Enumerated list.

Simple [ListTuple]

Simple list with items denoted by :. Renders as "Title: Item"

Desc [ListTuple]

Descriptive list, renders as "Title: Item" (see ListTuple).

Definitions [ListTuple]

Renders a list of "Title is the Item".

data ItemType Source #

Denotes how something should behave in a list (ListType).

Constructors

Flat Sentence

Standard singular item.

Nested Header ListType

Nest a list (ListType) as an item.

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.

type Header Source #

Arguments

 = Sentence

Used when creating sublists.

type Depth = Int Source #

type ListTuple Source #

Arguments

 = (Title, ItemType, Maybe String)

Formats as Title: Item. For use in lists.

type Lbl Source #

Arguments

 = Sentence

Label.

Contents

data Contents Source #

Contents may be labelled or unlabelled.

Instances

Instances details
HasContents Contents Source #

Access the RawContent within Contents.

Instance details

Defined in Language.Drasil.Document.Core

data DType Source #

Types of definitions (general, instance, theory, or data).

Constructors

General 
Instance 
Theory 
Data 

data HasCaption Source #

Indicates whether a figure has a caption or not.

Constructors

NoCaption 
WithCaption 

Instances

Instances details
Eq HasCaption Source # 
Instance details

Defined in Language.Drasil.Document.Core

data RawContent Source #

Types of layout objects we deal with explicitly.

Constructors

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 RawContent.

Enumeration ListType

For enumerated lists.

Defini DType [(Identifier, [Contents])]

Defines something with a type, identifier, and Contents.

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 (Sentences), maybe a width and height, and a label (Sentence).

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.

Constructors

LblC 

Instances

Instances details
HasContents LabelledContent Source #

Access the RawContent within the LabelledContent.

Instance details

Defined in Language.Drasil.Document.Core

HasRefAddress LabelledContent Source #

Finds the reference address contained in the Reference of LabelledContent.

Instance details

Defined in Language.Drasil.Document.Core

Referable LabelledContent Source #

Finds the reference information of LabelledContent.

Instance details

Defined in Language.Drasil.Document.Core

HasShortName LabelledContent Source #

Find the shortname of the reference address used for the LabelledContent.

Instance details

Defined in Language.Drasil.Document.Core

HasUID LabelledContent Source #

Finds UID of the LabelledContent.

Instance details

Defined in Language.Drasil.Document.Core

Methods

uid :: Getter LabelledContent UID Source #

Eq LabelledContent Source #

LabelledContents are equal if their reference UIDs are equal.

Instance details

Defined in Language.Drasil.Document.Core

newtype UnlabelledContent Source #

Only contains RawContent.

Constructors

UnlblC 

Fields

Instances

Instances details
HasContents UnlabelledContent Source #

Access the RawContent within the UnlabelledContent.

Instance details

Defined in Language.Drasil.Document.Core

class HasContents c where Source #

Members of this class must have RawContent.

Methods

accessContents :: Lens' c RawContent Source #

Provides a Lens to the RawContent.

Helper

prependLabel :: RawContent -> IRefProg Source #

Helper to prepend labels to LabelledContent when referencing.