drasil-lang-0.1.60.0: A framework for code and document generation for scientific software - Language SubPackage
Safe HaskellNone
LanguageGHC2024

Language.Drasil.Document

Description

Document Description Language.

Synopsis

Documentation

data Citation Source #

All citations require a unique identifier used by the Drasil chunk. We will re-use the UID part as an EntryID (String) used for creating reference links. Finally we will have the reference information (CitationKind, CiteFields, and a ShortName).

Ex. A reference to a thesis paper like Koothoor's "Document driven approach to certifying scientific computing software" would include the affiliated university, publishing year, and city.

Instances

Instances details
HasChunkRefs Citation Source # 
Instance details

Defined in Language.Drasil.Document.Citation.Core

Methods

chunkRefs :: Citation -> Set UID #

HasUID Citation Source #

Finds UID of the Citation.

Instance details

Defined in Language.Drasil.Document.Citation.Core

Methods

uid :: Getter Citation UID #

HasFields Citation Source #

Finds Fields of the Citation.

Instance details

Defined in Language.Drasil.Document.Citation.Core

Methods

getFields :: Lens' Citation [CiteField] Source #

HasRefAddress Citation Source #

Gets the reference address of a Citation.

Instance details

Defined in Language.Drasil.Document.Citation.Core

Referable Citation Source #

Gets the reference information of a Citation.

Instance details

Defined in Language.Drasil.Document.Citation.Core

HasShortName Citation Source #

Finds ShortName of the Citation.

Instance details

Defined in Language.Drasil.Document.Citation.Core

Generic Citation Source # 
Instance details

Defined in Language.Drasil.Document.Citation.Core

Associated Types

type Rep Citation 
Instance details

Defined in Language.Drasil.Document.Citation.Core

type Rep Citation = D1 ('MetaData "Citation" "Language.Drasil.Document.Citation.Core" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'False) (C1 ('MetaCons "Cite" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_citeKind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CitationKind) :*: S1 ('MetaSel ('Just "_fields") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [CiteField])) :*: (S1 ('MetaSel ('Just "_citeID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UID) :*: S1 ('MetaSel ('Just "sn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ShortName))))

Methods

from :: Citation -> Rep Citation x #

to :: Rep Citation x -> Citation #

type Rep Citation Source # 
Instance details

Defined in Language.Drasil.Document.Citation.Core

type Rep Citation = D1 ('MetaData "Citation" "Language.Drasil.Document.Citation.Core" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'False) (C1 ('MetaCons "Cite" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_citeKind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 CitationKind) :*: S1 ('MetaSel ('Just "_fields") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [CiteField])) :*: (S1 ('MetaSel ('Just "_citeID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UID) :*: S1 ('MetaSel ('Just "sn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ShortName))))

type BibRef = [Citation] Source #

A list of Citations.

type EntryID = String Source #

A String that should contain no spaces.

class HasCitation c where Source #

Some documents, as well as some pieces of knowledge, have citations.

Methods

getCitations :: Lens' c [Citation] Source #

Provides a Lens to the citations.

cArticle :: People -> String -> String -> Int -> [CiteField] -> String -> Citation Source #

Article citation requires author(s), title, journal, year. Optional fields can be: volume, number, pages, month, and note. Implicitly uses the EntryID as the chunk id.

cBookA :: People -> String -> String -> Int -> [CiteField] -> String -> Citation Source #

Book citation requires author or editor, title, publisher, year. Optional fields can be volume or number, series, address, edition, month, and note. Implicitly uses the EntryID as the chunk id.

Book citation by author.

cBookE :: People -> String -> String -> Int -> [CiteField] -> String -> Citation Source #

Book citation requires author or editor, title, publisher, year. Optional fields can be volume or number, series, address, edition, month, and note. Implicitly uses the EntryID as the chunk id.

Book citation by editor.

cBooklet :: String -> [CiteField] -> String -> Citation Source #

Booklet citation requires title. Optional fields can be author, how published, address, month, year, note. Implicitly uses the EntryID as the chunk id.

cInBookACP :: People -> String -> Int -> [Int] -> String -> Int -> [CiteField] -> String -> Citation Source #

InBook citation requires author or editor, title, chapter and/or pages, publisher, year. Optional fields can be volume or number, series, type, address, edition, month, and note. Implicitly uses the EntryID as the chunk id. This smart constructor includes both chapter and page numbers.

InBook citation by author.

cInBookECP :: People -> String -> Int -> [Int] -> String -> Int -> [CiteField] -> String -> Citation Source #

InBook citation requires author or editor, title, chapter and/or pages, publisher, year. Optional fields can be volume or number, series, type, address, edition, month, and note. Implicitly uses the EntryID as the chunk id. This smart constructor includes both chapter and page numbers.

InBook citation by editor.

cInBookAC :: People -> String -> Int -> String -> Int -> [CiteField] -> String -> Citation Source #

InBook citation excluding page numbers.

Otherwise identical to cInBookACP.

cInBookEC :: People -> String -> Int -> String -> Int -> [CiteField] -> String -> Citation Source #

InBook citation excluding page numbers.

Otherwise identical to cInBookECP.

cInBookAP :: People -> String -> [Int] -> String -> Int -> [CiteField] -> String -> Citation Source #

InBook citation excluding chapter.

Otherwise identical to cInBookACP.

cInBookEP :: People -> String -> [Int] -> String -> Int -> [CiteField] -> String -> Citation Source #

InBook citation excluding chapter.

Otherwise identical to cInBookECP.

cInCollection :: People -> String -> String -> String -> Int -> [CiteField] -> String -> Citation Source #

InCollection citation requires author, title, bookTitle, publisher, year. Optional fields can be editor, volume or number, series, type, chapter, pages, address, edition, month, and note. Implicitly uses the EntryID as the chunk id.

cInProceedings :: People -> String -> String -> Int -> [CiteField] -> String -> Citation Source #

InProceedings citation requires author, title, bookTitle, year. Optional fields can be editor, volume or number, series, pages, address, month, organization, publisher, and note. Implicitly uses the EntryID as the chunk id.

cManual :: String -> [CiteField] -> String -> Citation Source #

Manual (technical documentation) citation requires title. Optional fields can be author, organization, address, edition, month, year, and note. Implicitly uses the EntryID as the chunk id.

cMThesis :: People -> String -> String -> Int -> [CiteField] -> String -> Citation Source #

Master's Thesis citation requires author, title, school, and year. Optional fields can be type, address, month, and note. Implicitly uses the EntryID as the chunk id.

cMisc :: [CiteField] -> String -> Citation Source #

Misc citation requires nothing. Optional fields can be author, title, howpublished, month, year, and note. Implicitly uses the EntryID as the chunk id.

cPhDThesis :: People -> String -> String -> Int -> [CiteField] -> String -> Citation Source #

PhD Thesis citation requires author, title, school, and year. Optional fields can be type, address, month, and note. Implicitly uses the EntryID as the chunk id.

cProceedings :: String -> Int -> [CiteField] -> String -> Citation Source #

Proceedings citation requires title and year. Optional fields can be editor, volume or number, series, address, publisher, note, month, and organization. Implicitly uses the EntryID as the chunk id.

cTechReport :: People -> String -> String -> Int -> [CiteField] -> String -> Citation Source #

Technical Report citation requires author, title, institution, and year. Optional fields can be type, number, address, month, and note. Implicitly uses the EntryID as the chunk id.

cUnpublished :: People -> String -> String -> [CiteField] -> String -> Citation Source #

Unpublished citation requires author, title, and note. Optional fields can be month and year. Implicitly uses the EntryID as the chunk id.

data CiteField Source #

Fields used in citations.

Constructors

Address String 
Author People 
BookTitle String

Used for InCollection references only.

Chapter Int 
Edition Int 
Editor People 
HowPublished HP

Can be published via URL or something else.

Institution String 
Journal String 
Month Month 
Note String 
Number Int 
Organization String 
Pages [Int]

Range of pages (ex1. 1-32; ex2. 7,31,52-55).

Publisher String 
School String 
Series String 
Title String 
Type String

BibTeX "type" field.

Volume Int 
Year Int 

Instances

Instances details
HasChunkRefs CiteField Source # 
Instance details

Defined in Language.Drasil.Document.Citation.Components

Methods

chunkRefs :: CiteField -> Set UID #

Generic CiteField Source # 
Instance details

Defined in Language.Drasil.Document.Citation.Components

Associated Types

type Rep CiteField 
Instance details

Defined in Language.Drasil.Document.Citation.Components

type Rep CiteField = D1 ('MetaData "CiteField" "Language.Drasil.Document.Citation.Components" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'False) ((((C1 ('MetaCons "Address" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: C1 ('MetaCons "Author" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 People))) :+: (C1 ('MetaCons "BookTitle" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: (C1 ('MetaCons "Chapter" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "Edition" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))) :+: ((C1 ('MetaCons "Editor" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 People)) :+: C1 ('MetaCons "HowPublished" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HP))) :+: (C1 ('MetaCons "Institution" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: (C1 ('MetaCons "Journal" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: C1 ('MetaCons "Month" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Month)))))) :+: (((C1 ('MetaCons "Note" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: C1 ('MetaCons "Number" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))) :+: (C1 ('MetaCons "Organization" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: (C1 ('MetaCons "Pages" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Int])) :+: C1 ('MetaCons "Publisher" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String))))) :+: ((C1 ('MetaCons "School" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: (C1 ('MetaCons "Series" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: C1 ('MetaCons "Title" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)))) :+: (C1 ('MetaCons "Type" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: (C1 ('MetaCons "Volume" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "Year" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))))))
type Rep CiteField Source # 
Instance details

Defined in Language.Drasil.Document.Citation.Components

type Rep CiteField = D1 ('MetaData "CiteField" "Language.Drasil.Document.Citation.Components" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'False) ((((C1 ('MetaCons "Address" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: C1 ('MetaCons "Author" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 People))) :+: (C1 ('MetaCons "BookTitle" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: (C1 ('MetaCons "Chapter" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "Edition" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))) :+: ((C1 ('MetaCons "Editor" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 People)) :+: C1 ('MetaCons "HowPublished" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HP))) :+: (C1 ('MetaCons "Institution" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: (C1 ('MetaCons "Journal" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: C1 ('MetaCons "Month" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Month)))))) :+: (((C1 ('MetaCons "Note" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: C1 ('MetaCons "Number" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))) :+: (C1 ('MetaCons "Organization" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: (C1 ('MetaCons "Pages" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Int])) :+: C1 ('MetaCons "Publisher" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String))))) :+: ((C1 ('MetaCons "School" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: (C1 ('MetaCons "Series" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: C1 ('MetaCons "Title" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)))) :+: (C1 ('MetaCons "Type" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: (C1 ('MetaCons "Volume" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "Year" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))))))

data HP Source #

How something is published. Necessary for URLs to work properly.

Constructors

URL String 
Verb String 

Instances

Instances details
HasChunkRefs HP Source # 
Instance details

Defined in Language.Drasil.Document.Citation.Components

Methods

chunkRefs :: HP -> Set UID #

Generic HP Source # 
Instance details

Defined in Language.Drasil.Document.Citation.Components

Associated Types

type Rep HP 
Instance details

Defined in Language.Drasil.Document.Citation.Components

type Rep HP = D1 ('MetaData "HP" "Language.Drasil.Document.Citation.Components" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'False) (C1 ('MetaCons "URL" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: C1 ('MetaCons "Verb" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)))

Methods

from :: HP -> Rep HP x #

to :: Rep HP x -> HP #

type Rep HP Source # 
Instance details

Defined in Language.Drasil.Document.Citation.Components

type Rep HP = D1 ('MetaData "HP" "Language.Drasil.Document.Citation.Components" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'False) (C1 ('MetaCons "URL" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: C1 ('MetaCons "Verb" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)))

data CitationKind Source #

External references come in many flavours. Articles, Books, etc. (we are using the types available in Bibtex).

Instances

Instances details
HasChunkRefs CitationKind Source # 
Instance details

Defined in Language.Drasil.Document.Citation.Components

Generic CitationKind Source # 
Instance details

Defined in Language.Drasil.Document.Citation.Components

Associated Types

type Rep CitationKind 
Instance details

Defined in Language.Drasil.Document.Citation.Components

type Rep CitationKind = D1 ('MetaData "CitationKind" "Language.Drasil.Document.Citation.Components" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'False) (((C1 ('MetaCons "Article" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Book" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Booklet" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "InBook" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "InCollection" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InProceedings" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "Manual" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MThesis" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Misc" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "PhDThesis" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Proceedings" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "TechReport" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Unpublished" 'PrefixI 'False) (U1 :: Type -> Type)))))
type Rep CitationKind Source # 
Instance details

Defined in Language.Drasil.Document.Citation.Components

type Rep CitationKind = D1 ('MetaData "CitationKind" "Language.Drasil.Document.Citation.Components" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'False) (((C1 ('MetaCons "Article" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Book" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Booklet" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "InBook" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "InCollection" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InProceedings" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "Manual" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MThesis" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Misc" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "PhDThesis" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Proceedings" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "TechReport" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Unpublished" 'PrefixI 'False) (U1 :: Type -> Type)))))

class HasFields c where Source #

Citations should have a fields (CiteField).

Methods

getFields :: Lens' c [CiteField] Source #

Provides a Lens to CiteFields.

Instances

Instances details
HasFields Citation Source #

Finds Fields of the Citation.

Instance details

Defined in Language.Drasil.Document.Citation.Core

Methods

getFields :: Lens' Citation [CiteField] Source #

author :: People -> CiteField Source #

Smart field constructor for a CiteField.

editor :: People -> CiteField Source #

Smart field constructor for a CiteField.

address :: String -> CiteField Source #

Smart field constructor for a CiteField.

bookTitle :: String -> CiteField Source #

Smart field constructor for a CiteField.

howPublished :: String -> CiteField Source #

Smart field constructor for a CiteField.

howPublishedU :: String -> CiteField Source #

Smart field constructor for a CiteField.

URL version of howPublished.

institution :: String -> CiteField Source #

Smart field constructor for a CiteField.

journal :: String -> CiteField Source #

Smart field constructor for a CiteField.

note :: String -> CiteField Source #

Smart field constructor for a CiteField.

organization :: String -> CiteField Source #

Smart field constructor for a CiteField.

publisher :: String -> CiteField Source #

Smart field constructor for a CiteField.

school :: String -> CiteField Source #

Smart field constructor for a CiteField.

series :: String -> CiteField Source #

Smart field constructor for a CiteField.

title :: String -> CiteField Source #

Smart field constructor for a CiteField.

typeField :: String -> CiteField Source #

Smart field constructor for a CiteField.

chapter :: Int -> CiteField Source #

Smart field constructor for a CiteField.

edition :: Int -> CiteField Source #

Smart field constructor for a CiteField.

number :: Int -> CiteField Source #

Smart field constructor for a CiteField.

volume :: Int -> CiteField Source #

Smart field constructor for a CiteField.

year :: Int -> CiteField Source #

Smart field constructor for a CiteField.

pages :: [Int] -> CiteField Source #

Smart field constructor for a CiteField.

month :: Month -> CiteField Source #

Smart field constructor for a CiteField.

compareAuthYearTitle :: HasFields c => c -> c -> Ordering Source #

Orders two authors. If given two of the exact same authors, year, and title, returns an error.

data ConceptInstance Source #

Contains a ConceptChunk, reference address, and a ShortName. It is a concept that can be referred to, or rather, a instance of where a concept is applied. Often used in Goal Statements, Assumptions, Requirements, etc.

Ex. Something like the assumption that gravity is 9.81 m/s. When we write our equations, we can then link this assumption so that we do not have to explicitly define that assumption when needed to verify our work.

Instances

Instances details
HasChunkRefs ConceptInstance Source # 
Instance details

Defined in Language.Drasil.Document.ConceptInstance

HasUID ConceptInstance Source #

Finds UID of the ConceptChunk used to make the ConceptInstance.

Instance details

Defined in Language.Drasil.Document.ConceptInstance

Methods

uid :: Getter ConceptInstance UID #

Idea ConceptInstance Source #

Finds the idea contained in the ConceptChunk used to make the ConceptInstance.

Instance details

Defined in Language.Drasil.Document.ConceptInstance

NamedIdea ConceptInstance Source #

Finds term (NP) of the ConceptChunk used to make the ConceptInstance.

Instance details

Defined in Language.Drasil.Document.ConceptInstance

Methods

term :: Lens' ConceptInstance NP Source #

ConceptDomain ConceptInstance Source #

Finds the domain contained in the ConceptChunk used to make the ConceptInstance.

Instance details

Defined in Language.Drasil.Document.ConceptInstance

Definition ConceptInstance Source #

Finds the definition contained in the ConceptChunk used to make the ConceptInstance.

Instance details

Defined in Language.Drasil.Document.ConceptInstance

HasRefAddress ConceptInstance Source #

Finds the reference address contained in a ConceptInstance.

Instance details

Defined in Language.Drasil.Document.ConceptInstance

Referable ConceptInstance Source #

Finds the reference information contained in a ConceptInstance.

Instance details

Defined in Language.Drasil.Document.ConceptInstance

HasShortName ConceptInstance Source #

Finds the ShortName contained in a ConceptInstance.

Instance details

Defined in Language.Drasil.Document.ConceptInstance

Generic ConceptInstance Source # 
Instance details

Defined in Language.Drasil.Document.ConceptInstance

Associated Types

type Rep ConceptInstance 
Instance details

Defined in Language.Drasil.Document.ConceptInstance

type Rep ConceptInstance = D1 ('MetaData "ConceptInstance" "Language.Drasil.Document.ConceptInstance" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'False) (C1 ('MetaCons "ConInst" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_ciuid") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UID) :*: S1 ('MetaSel ('Just "_cc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ConceptChunk)) :*: (S1 ('MetaSel ('Just "ra") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Just "shnm") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ShortName))))
Eq ConceptInstance Source #

Equal if UIDs are equal.

Instance details

Defined in Language.Drasil.Document.ConceptInstance

type Rep ConceptInstance Source # 
Instance details

Defined in Language.Drasil.Document.ConceptInstance

type Rep ConceptInstance = D1 ('MetaData "ConceptInstance" "Language.Drasil.Document.ConceptInstance" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'False) (C1 ('MetaCons "ConInst" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_ciuid") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UID) :*: S1 ('MetaSel ('Just "_cc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ConceptChunk)) :*: (S1 ('MetaSel ('Just "ra") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Just "shnm") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ShortName))))

cic :: Concept c => String -> Sentence -> String -> c -> ConceptInstance Source #

Constructor for a ConceptInstance. Takes in the Reference Address (String), a definition (Sentence), a short name (String), and a domain (for explicit tagging).

enumBullet :: Reference -> [Sentence] -> LabelledContent Source #

Creates a bulleted list.

enumBulletU :: [Sentence] -> Contents Source #

Same as enumBullet but unlabelled.

enumSimple :: Reference -> Integer -> Sentence -> [Sentence] -> LabelledContent Source #

Currently Unused. Creates a simple bulleted list that labels things with a title and number:

  • lb - Reference,
  • s - start index for the enumeration,
  • t - title of the list,
  • l - list to be enumerated.

For example, if we want to create a list of data definitions, we could call the function as follows:

enumSimple _ 2 (S "DD") [def1, def2, ...]

And the resulting LabelledContent would be rendered as:

  • DD2: def1
  • DD3: def2
  • DD4: def3 ...

enumSimpleU :: Integer -> Sentence -> [Sentence] -> Contents Source #

Same as enumSimple but unlabelled.

mkEnumSimpleD :: (Referable c, HasShortName c, Definition c) => [c] -> [Contents] Source #

Convenience function for transforming referable concepts into a bulleted list. Used in drasil-docLang in making the assumptions, goals, and requirements sections. Output is of the kind Concept Name: definition of concept.

lbldExpr :: ModelExpr -> Reference -> LabelledContent Source #

Displays a given expression and attaches a Reference to it.

unlbldExpr :: ModelExpr -> Contents Source #

Same as eqUnR except content is unlabelled (does not attach a Reference).

unlbldCode :: Expr -> Contents Source #

Unlabelled code expression

foldlSP :: [Sentence] -> Contents Source #

Fold sentences then turns into content using foldlSent.

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 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 [(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 Expr

Block for codes

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 LabelledContent Source #

Contains a Reference and RawContent.

Constructors

LblC 

Instances

Instances details
HasChunkRefs LabelledContent Source # 
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 #

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

Eq LabelledContent Source #

LabelledContents are equal if their reference UIDs are equal.

Instance details

Defined in Language.Drasil.Document.Core

type ListTuple Source #

Arguments

 = (Title, ItemType, Maybe String)

Formats as Title: Item. For use in lists.

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.

class HasContents c where Source #

Members of this class must have RawContent.

Methods

accessContents :: Lens' c RawContent Source #

Provides a Lens to the RawContent.

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

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

type Lbl Source #

Arguments

 = Sentence

Label.

data DecRef Source #

For holding a Reference that is decorated with extra information (ex. page numbers, equation sources, etc.).

Constructors

DR 

Fields

Instances

Instances details
HasChunkRefs DecRef Source # 
Instance details

Defined in Language.Drasil.Document.DecoratedReference

Methods

chunkRefs :: DecRef -> Set UID #

HasUID DecRef Source #

Finds the UID of a Reference.

Instance details

Defined in Language.Drasil.Document.DecoratedReference

Methods

uid :: Getter DecRef UID #

HasRefAddress DecRef Source #

Finds the reference address contained in a Reference (through a LblType).

Instance details

Defined in Language.Drasil.Document.DecoratedReference

HasShortName DecRef Source #

Finds the shortname of the reference address used for the Reference.

Instance details

Defined in Language.Drasil.Document.DecoratedReference

Generic DecRef Source # 
Instance details

Defined in Language.Drasil.Document.DecoratedReference

Associated Types

type Rep DecRef 
Instance details

Defined in Language.Drasil.Document.DecoratedReference

type Rep DecRef = D1 ('MetaData "DecRef" "Language.Drasil.Document.DecoratedReference" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'False) (C1 ('MetaCons "DR" 'PrefixI 'True) (S1 ('MetaSel ('Just "_rf") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Reference) :*: S1 ('MetaSel ('Just "refInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RefInfo)))

Methods

from :: DecRef -> Rep DecRef x #

to :: Rep DecRef x -> DecRef #

Eq DecRef Source #

Equal if UIDs are equal.

Instance details

Defined in Language.Drasil.Document.DecoratedReference

Methods

(==) :: DecRef -> DecRef -> Bool #

(/=) :: DecRef -> DecRef -> Bool #

type Rep DecRef Source # 
Instance details

Defined in Language.Drasil.Document.DecoratedReference

type Rep DecRef = D1 ('MetaData "DecRef" "Language.Drasil.Document.DecoratedReference" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'False) (C1 ('MetaCons "DR" 'PrefixI 'True) (S1 ('MetaSel ('Just "_rf") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Reference) :*: S1 ('MetaSel ('Just "refInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 RefInfo)))

class HasDecRef c where Source #

A class that contains a list of decorated references (DecRefs).

Methods

getDecRefs :: Lens' c [DecRef] Source #

Provides a Lens to the DecRefs.

dRef :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> DecRef Source #

Same as ref, but for DecRef instead of Reference.

dRefInfo :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> RefInfo -> DecRef Source #

For creating a decorated reference (DecRef) with extra reference information (RefInfo).

sentToExp :: Sentence -> [ModelExpr] Source #

Extracts all ModelExprs mentioned in a Sentence.

extractMExprs :: HasContents a => a -> [ModelExpr] Source #

Extracts ModelExprs from something that HasContents.

extractSents :: HasContents a => a -> [Sentence] Source #

Extracts Sentences from something that HasContents.

extractSents' :: HasContents a => [a] -> [Sentence] Source #

Extracts Sentences from a list of Contents.

extractChRefs :: HasContents a => [a] -> Set UID Source #

Extracts all referenced UIDs from things that have RawContents.

getSec :: Section -> [Sentence] Source #

Extracts Sentences from a Section.

extractSectionsBib :: ChunkDB -> [Section] -> BibRef Source #

Extract bibliography entries from generated sections. This version extracts from fully expanded Sections, capturing citations that are only created during document generation (like those in orgOfDocIntro).

resolveBibliography :: ChunkDB -> Set UID -> [Citation] Source #

Given a ChunkDB and a set of UIDs, looks up the corresponding Citations and returns them sorted by author, year, and title.

FIXME: This function assumes that all UIDs in the set correspond to Citations in the database. If a UID does not correspond to a Citation, it is simply ignored. This should rather rely on a set of 'UIDRef Citation's.

raw :: String -> IRefProg Source #

Constructor for a String into an IRefProg.

data IRefProg Source #

Created for different forms of references. Used in LblType.

Constructors

Deferred UID

Deferred lookup; done later. Used for domains in a ConceptInstance.

RS String

Lifts a String into a RefProg.

RConcat IRefProg IRefProg

Concatenates with two subprograms.

Name

The Symbol to insert the ShortName directly.

Instances

Instances details
HasChunkRefs IRefProg Source # 
Instance details

Defined in Language.Drasil.Document.Labels

Methods

chunkRefs :: IRefProg -> Set UID #

Generic IRefProg Source # 
Instance details

Defined in Language.Drasil.Document.Labels

Methods

from :: IRefProg -> Rep IRefProg x #

to :: Rep IRefProg x -> IRefProg #

type Rep IRefProg Source # 
Instance details

Defined in Language.Drasil.Document.Labels

data LblType Source #

Applying different pieces of information for a reference. An RP is a decorated internal reference. Citation is a citation. URI is for URLs and other external links.

Instances

Instances details
HasChunkRefs LblType Source # 
Instance details

Defined in Language.Drasil.Document.Labels

Methods

chunkRefs :: LblType -> Set UID #

Generic LblType Source # 
Instance details

Defined in Language.Drasil.Document.Labels

Methods

from :: LblType -> Rep LblType x #

to :: Rep LblType x -> LblType #

type Rep LblType Source # 
Instance details

Defined in Language.Drasil.Document.Labels

class (IsChunk s, HasRefAddress s) => Referable s where Source #

Members of this class have the ability to be referenced.

Methods

refAdd :: s -> String Source #

The referencing address (what we're linking to). Only visible in the source (tex/html).

renderRef :: s -> LblType Source #

Alternate form of reference.

Instances

Instances details
Referable Citation Source #

Gets the reference information of a Citation.

Instance details

Defined in Language.Drasil.Document.Citation.Core

Referable ConceptInstance Source #

Finds the reference information contained in a ConceptInstance.

Instance details

Defined in Language.Drasil.Document.ConceptInstance

Referable LabelledContent Source #

Finds the reference information of LabelledContent.

Instance details

Defined in Language.Drasil.Document.Core

Referable Section Source #

Finds the reference information of a Section.

Instance details

Defined in Language.Drasil.Document.Sections

class HasRefAddress b where Source #

Members must have a reference address.

Methods

getRefAdd :: b -> LblType Source #

Provides the ability to hold a reference address.

Instances

Instances details
HasRefAddress Citation Source #

Gets the reference address of a Citation.

Instance details

Defined in Language.Drasil.Document.Citation.Core

HasRefAddress ConceptInstance Source #

Finds the reference address contained in a ConceptInstance.

Instance details

Defined in Language.Drasil.Document.ConceptInstance

HasRefAddress LabelledContent Source #

Finds the reference address contained in the Reference of LabelledContent.

Instance details

Defined in Language.Drasil.Document.Core

HasRefAddress DecRef Source #

Finds the reference address contained in a Reference (through a LblType).

Instance details

Defined in Language.Drasil.Document.DecoratedReference

HasRefAddress Reference Source #

Finds the reference address contained in a Reference (through a LblType).

Instance details

Defined in Language.Drasil.Document.Reference

HasRefAddress Section Source #

Finds the reference address of a Section.

Instance details

Defined in Language.Drasil.Document.Sections

(+::+) :: IRefProg -> IRefProg -> IRefProg Source #

Constructor that concatenates two subprograms.

defer :: UID -> IRefProg Source #

Constructor to defer a UID lookup; done later.

name :: IRefProg Source #

Constructor that gets the Name of an IRefProg.

getAdd :: LblType -> String Source #

Retrieves the String contained in a LblType.

prepend :: String -> IRefProg Source #

Prepends a String to an IRefProg.

data Reference Source #

A Reference contains the identifier (UID), a reference address (LblType), a human-readable shortname (ShortName), and any extra information about the reference (RefInfo).

Instances

Instances details
HasChunkRefs Reference Source # 
Instance details

Defined in Language.Drasil.Document.Reference

Methods

chunkRefs :: Reference -> Set UID #

HasUID Reference Source #

Finds the UID of a Reference.

Instance details

Defined in Language.Drasil.Document.Reference

Methods

uid :: Getter Reference UID #

HasRefAddress Reference Source #

Finds the reference address contained in a Reference (through a LblType).

Instance details

Defined in Language.Drasil.Document.Reference

HasShortName Reference Source #

Finds the shortname of the reference address used for the Reference.

Instance details

Defined in Language.Drasil.Document.Reference

Generic Reference Source # 
Instance details

Defined in Language.Drasil.Document.Reference

Associated Types

type Rep Reference 
Instance details

Defined in Language.Drasil.Document.Reference

type Rep Reference = D1 ('MetaData "Reference" "Language.Drasil.Document.Reference" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'False) (C1 ('MetaCons "Reference" 'PrefixI 'True) (S1 ('MetaSel ('Just "_ui") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UID) :*: (S1 ('MetaSel ('Just "ra") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 LblType) :*: S1 ('MetaSel ('Just "sn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ShortName))))
Eq Reference Source #

Equal if UIDs are equal.

Instance details

Defined in Language.Drasil.Document.Reference

type Rep Reference Source # 
Instance details

Defined in Language.Drasil.Document.Reference

type Rep Reference = D1 ('MetaData "Reference" "Language.Drasil.Document.Reference" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'False) (C1 ('MetaCons "Reference" 'PrefixI 'True) (S1 ('MetaSel ('Just "_ui") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UID) :*: (S1 ('MetaSel ('Just "ra") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 LblType) :*: S1 ('MetaSel ('Just "sn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ShortName))))

ref :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> Reference Source #

Projector function that creates a Reference from something Referable.

class HasReference c where Source #

A class that contains a list of References.

Methods

getReferences :: Lens' c [Reference] Source #

Provides a Lens to the References.

refS :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> Sentence Source #

Takes the reference UID and wraps it into a Sentence.

namedRef :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> Sentence -> Sentence Source #

Takes a Reference with a name to be displayed and wraps it into a Sentence. Does not overwrite the shortname contained in the reference, but will only display as the given Sentence.

complexRef :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> RefInfo -> Sentence Source #

Takes a Reference with additional display info. Uses the internal shortname for its display name.

namedComplexRef :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> Sentence -> RefInfo -> Sentence Source #

Takes a Reference with a name to be displayed and any additional information and wraps it into a Sentence. Does not overwrite the shortname contained in the reference, but will only display as the given Sentence along with the given RefInfo.

data SecCons Source #

Section Contents are split into subsections or contents, where contents are standard layout objects (see Contents).

Constructors

Sub Section 
Con Contents 

data Section Source #

Sections have a title (Sentence), a list of contents (SecCons) and a shortname (Reference).

Constructors

Section 

Fields

Instances

Instances details
HasChunkRefs Section Source # 
Instance details

Defined in Language.Drasil.Document.Sections

Methods

chunkRefs :: Section -> Set UID #

HasUID Section Source #

Finds the UID of a Section.

Instance details

Defined in Language.Drasil.Document.Sections

Methods

uid :: Getter Section UID #

HasRefAddress Section Source #

Finds the reference address of a Section.

Instance details

Defined in Language.Drasil.Document.Sections

Referable Section Source #

Finds the reference information of a Section.

Instance details

Defined in Language.Drasil.Document.Sections

HasShortName Section Source #

Finds the short name of a Section.

Instance details

Defined in Language.Drasil.Document.Sections

Eq Section Source #

Sections are equal if UIDs are equal.

Instance details

Defined in Language.Drasil.Document.Sections

Methods

(==) :: Section -> Section -> Bool #

(/=) :: Section -> Section -> Bool #

data Document Source #

A Document has a Title (Sentence), Author(s) (Sentence), and Sections which hold the contents of the document.

ulcc :: RawContent -> UnlabelledContent Source #

Smart constructor for unlabelled content chunks (no Reference).

mkParagraph :: Sentence -> Contents Source #

Smart constructor that wraps UnlabelledContent into Contents.

mkRawLC :: RawContent -> Reference -> LabelledContent Source #

Smart constructor similar to llcc, but takes in RawContent first. Takes a Reference to extract UID, LblType, and ShortName for the labelled content.

section :: Sentence -> [Contents] -> [Section] -> Reference -> Section Source #

Smart constructor for creating Sections with a title (Sentence), introductory contents (ie. paragraphs, tables, etc.), a list of subsections, and a shortname (Reference).

fig :: Lbl -> Filepath -> RawContent Source #

Figure smart constructor with a Lbl and a Filepath. Assumes 100% of page width as max width. Defaults to WithCaption.

figNoCap :: Lbl -> Filepath -> RawContent Source #

Figure smart constructor without a caption.

figWithWidth :: Lbl -> Filepath -> MaxWidthPercent -> RawContent Source #

Figure smart constructor that allows for customized max widths. Defaults to WithCaption.

figNoCapWithWidth :: Lbl -> Filepath -> MaxWidthPercent -> RawContent Source #

Figure smart constructor with customized max widths and no caption.

llcc :: UID -> LblType -> ShortName -> RawContent -> LabelledContent Source #

Smart constructor for labelled content chunks. Now builds a Reference using the provided UID instead of extracting it from the Reference.

llccFig :: String -> RawContent -> LabelledContent Source #

Helper for creating labelled content with a figure reference.

llccTab :: String -> RawContent -> LabelledContent Source #

Helper for creating labelled content with a table reference.

llccEqn :: String -> RawContent -> LabelledContent Source #

Helper for creating labelled content with an equation reference.

llccFig' :: UID -> RawContent -> LabelledContent Source #

Helper for creating labelled content with a UID-based figure reference.

llccTab' :: UID -> RawContent -> LabelledContent Source #

Helper for creating labelled content with a UID-based table reference.

llccEqn' :: UID -> RawContent -> LabelledContent Source #

Helper for creating labelled content with a UID-based equation reference.

mkFig :: Reference -> RawContent -> Contents Source #

Smart constructor that wraps LabelledContent into Contents. Takes a Reference to extract UID, LblType, and ShortName for the labelled content.

data ShowTableOfContents Source #

Determines whether or not the table of contents appears on the generated artifacts.

Constructors

ToC 
NoToC 

checkToC :: Document -> Document Source #

Manually removes the first section of a document (table of contents section). temp fix for Notebook (see if we need this in notebook later)

makeTabRef :: String -> Reference Source #

Create a reference for a table. Takes in the name of a table (which will also be used for its shortname).

makeFigRef :: String -> Reference Source #

Create a reference for a figure. Takes in the name of a figure (which will also be used for its shortname).

makeSecRef :: String -> Sentence -> Reference Source #

Create a reference for a section. Takes in the name of a section and a shortname for the section.

makeEqnRef :: String -> Reference Source #

Create a reference for a equation. Takes in the name of the equation (which will also be used for its shortname).

makeURI :: String -> String -> ShortName -> Reference Source #

Create a reference for a URI. Takes in a UID (as a String), a reference address, and a shortname.

makeTabRef' :: UID -> Reference Source #

Variants of makeTabRef that takes a UID instead of a String.

makeFigRef' :: UID -> Reference Source #

Variants of makeFigRef that takes a UID instead of a String.

makeSecRef' :: UID -> Sentence -> Reference Source #

Variants of makeSecRef that takes a UID instead of a String.

makeEqnRef' :: UID -> Reference Source #

Variants of makeEqnRef that takes a UID instead of a String.

makeURI' :: UID -> String -> ShortName -> Reference Source #

Variants of makeURI that takes a UID instead of a String.

fterms :: (NamedIdea c, NamedIdea d) => (NP -> NP -> t) -> c -> d -> t Source #

Apply a binary function to the terms of two named ideas, instead of to the named ideas themselves. Ex. fterms compoundPhrase t1 t2 instead of compoundPhrase (t1 ^. term) (t2 ^. term).

bulletFlat :: [Sentence] -> ListType Source #

Applies Bullet and Flat to a list.

mkEnumAbbrevList :: Integer -> Sentence -> [Sentence] -> [(Sentence, ItemType)] Source #

Zip helper function enumerates abbreviations and zips it with list of ItemType:

  • s - the number from which the enumeration should start from (Integer),
  • t - the title of the list (Sentence),
  • l - the list to be enumerated ([Sentence]).

chgsStart :: (HasShortName x, Referable x) => x -> Sentence -> Sentence Source #

Output is of the form "reference - sentence".

definedIn :: (Referable r, HasShortName r, DefinesQuantity r) => r -> Sentence Source #

Takes a HasSymbol that is also Referable and outputs as a Sentence: "symbol is defined in reference."

definedIn' :: (Referable r, HasShortName r, DefinesQuantity r) => r -> Sentence -> Sentence Source #

Same as definedIn, but allows for additional information to be appended to the Sentence.

definedIn'' :: (Referable r, HasShortName r) => r -> Sentence Source #

Takes a Referable and outputs as a Sentence "defined in reference" (no HasSymbol).

definedIn''' :: (Quantity q, Referable r, HasShortName r) => q -> r -> Sentence Source #

Takes a Symbol and its Reference (does not append a period at the end!). Outputs as "symbol is defined in source".

fromReplace :: (Referable r, HasShortName r, Quantity q) => r -> q -> Sentence Source #

Takes a Referable source and a UnitalChunk and outputs as a Sentence: "From source we can replace symbol:".

fromSource :: (Referable r, HasShortName r) => r -> Sentence Source #

Wraps "from reference" in parentheses.

fromSources :: (Referable r, HasShortName r) => [r] -> Sentence Source #

Similar to fromSource but takes a list of references instead of one.

fmtU :: MayHaveUnit a => Sentence -> a -> Sentence Source #

Takes an amount as a Sentence and appends a unit to it.

follows :: (Referable r, HasShortName r) => Sentence -> r -> Sentence Source #

Appends "following reference" to the end of a Sentence.

makeListRef :: [a] -> Section -> [Sentence] Source #

Takes a list and a Section, then generates a list of that section's reference to match the length of the list.

addPercent :: Show a => a -> Sentence Source #

Converts input to a Sentence and appends %.

maybeChanged :: Sentence -> Sentence -> Sentence Source #

Helper functions for making likely change statements. Uses form likelyFrame parameter1 _ parameter2.

maybeExpanded :: Sentence -> Sentence -> Sentence Source #

Helper functions for making likely change statements. Uses form likelyFrame parameter1 _ parameter2.

maybeWOVerb :: Sentence -> Sentence -> Sentence Source #

Helper functions for making likely change statements. Uses form likelyFrame parameter1 _ parameter2.

showingCxnBw :: NamedIdea c => c -> Sentence -> Sentence Source #

Returns the Sentence "(titleize aNamedIdea) Showing the Connections Between contents".

substitute :: (Referable r, HasShortName r, DefinesQuantity r) => [r] -> Sentence Source #

Takes a list of Referables and Symbols and outputs as a Sentence "By substituting symbols, this can be written as:".

typUncr :: (Double, Maybe Int) -> Sentence Source #

Formats typical uncertainty data to be displayed.

underConsidertn :: ConceptChunk -> Sentence Source #

Returns the Sentence "The chunk under consideration is chunkDefinition".

chWithUnit :: (Quantity a, MayHaveUnit a) => a -> Sentence Source #

Outputs "ch x (unit of x)". For introducing a quantity with its symbol and unit.

unitInParen :: MayHaveUnit a => a -> Sentence Source #

Formats a unit in parentheses. Outputs "(unit)".

unitSym :: MayHaveUnit a => a -> Sentence Source #

Get a unit symbol as a Sentence if one exists.

eqN :: Int -> Sentence Source #

Prepends the word Equation to an Int.

eqnWSource :: (Referable r, HasShortName r) => ModelExpr -> r -> Sentence Source #

Takes an expression and a Referable and outputs as a Sentence "expression (source)".

bulletNested :: [Sentence] -> [ListType] -> ListType Source #

Applies Bullets and headers to a Nested ListType. The first argument is the headers of the Nested lists.

makeTMatrix :: Eq a => [Sentence] -> [[a]] -> [a] -> [[Sentence]] Source #

Makes a traceability matrix from a list of row titles, a list of rows of "checked" columns, and a list of columns.

mkTableFromColumns :: [(Sentence, [Sentence])] -> ([Sentence], [[Sentence]]) Source #

Helper for making a table from a columns.

noRefs :: [ItemType] -> [(ItemType, Maybe String)] Source #

Converts lists of simple ItemTypes into a list which may be used in Contents but is not directly referable.

refineChain :: NamedIdea c => [(c, Section)] -> Sentence Source #

Create a list in the pattern of "The __ are refined to the __". Note: Order matters!

tAndDOnly :: Concept s => s -> ItemType Source #

Helpful combinators for making Sentences into Terminologies with Definitions. Returns of the form: "term - termDefinition".

tAndDWAcc :: Concept s => s -> ItemType Source #

Helpful combinators for making Sentences into Terminologies with Definitions. Returns of the form: "term (abbreviation) - termDefinition".

tAndDWSym :: (Concept s, Quantity a) => s -> a -> ItemType Source #

Helpful combinators for making Sentences into Terminologies with Definitions. Returns of the form: "term (symbol) - termDefinition".

zipSentList :: [[Sentence]] -> [Sentence] -> [[Sentence]] -> [[Sentence]] Source #

Distributes a list of Sentences by prepending individual Sentences once to an existing list of Sentences.

For example:

>>> zipSentList [S "Hi", S "Hey", S "Hi"] [[S "Hello"], [S "World"], [S "Hello", S "World"]]
[[S "Hi", S "Hello"], [S "Hey", S "World"], [S "Hi", S "Hello", S "World"]]

data ShortName Source #

Used for holding the short form of a name (as a Sentence with a wrapper).

Instances

Instances details
HasChunkRefs ShortName Source # 
Instance details

Defined in Language.Drasil.Document.ShortName

Methods

chunkRefs :: ShortName -> Set UID #

Generic ShortName Source # 
Instance details

Defined in Language.Drasil.Document.ShortName

Associated Types

type Rep ShortName 
Instance details

Defined in Language.Drasil.Document.ShortName

type Rep ShortName = D1 ('MetaData "ShortName" "Language.Drasil.Document.ShortName" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'True) (C1 ('MetaCons "ShortNm" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Sentence)))
type Rep ShortName Source # 
Instance details

Defined in Language.Drasil.Document.ShortName

type Rep ShortName = D1 ('MetaData "ShortName" "Language.Drasil.Document.ShortName" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'True) (C1 ('MetaCons "ShortNm" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Sentence)))

class HasShortName s where Source #

A ShortName is the text to be displayed for a link.

Used for referencing within a document that can include symbols and whatnot if required. Visible in the typeset documents (pdf).

Methods

shortname :: s -> ShortName Source #

Instances

Instances details
HasShortName Citation Source #

Finds ShortName of the Citation.

Instance details

Defined in Language.Drasil.Document.Citation.Core

HasShortName ConceptInstance Source #

Finds the ShortName contained in a ConceptInstance.

Instance details

Defined in Language.Drasil.Document.ConceptInstance

HasShortName LabelledContent Source #

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

Instance details

Defined in Language.Drasil.Document.Core

HasShortName DecRef Source #

Finds the shortname of the reference address used for the Reference.

Instance details

Defined in Language.Drasil.Document.DecoratedReference

HasShortName Reference Source #

Finds the shortname of the reference address used for the Reference.

Instance details

Defined in Language.Drasil.Document.Reference

HasShortName Section Source #

Finds the short name of a Section.

Instance details

Defined in Language.Drasil.Document.Sections

shortname' :: Sentence -> ShortName Source #

Smart constructor for making a Sentence into a ShortName.

getSentSN :: ShortName -> Sentence Source #

Pulls the short form (as a Sentence) out of a ShortName.