| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Language.Drasil.Document
Description
Document Description Language.
Synopsis
- data Citation
- type BibRef = [Citation]
- type EntryID = String
- class HasCitation c where
- getCitations :: Lens' c [Citation]
- citeID :: Lens' Citation UID
- citeKind :: Lens' Citation CitationKind
- cArticle :: People -> String -> String -> Int -> [CiteField] -> String -> Citation
- cBookA :: People -> String -> String -> Int -> [CiteField] -> String -> Citation
- cBookE :: People -> String -> String -> Int -> [CiteField] -> String -> Citation
- cBooklet :: String -> [CiteField] -> String -> Citation
- cInBookACP :: People -> String -> Int -> [Int] -> String -> Int -> [CiteField] -> String -> Citation
- cInBookECP :: People -> String -> Int -> [Int] -> String -> Int -> [CiteField] -> String -> Citation
- cInBookAC :: People -> String -> Int -> String -> Int -> [CiteField] -> String -> Citation
- cInBookEC :: People -> String -> Int -> String -> Int -> [CiteField] -> String -> Citation
- cInBookAP :: People -> String -> [Int] -> String -> Int -> [CiteField] -> String -> Citation
- cInBookEP :: People -> String -> [Int] -> String -> Int -> [CiteField] -> String -> Citation
- cInCollection :: People -> String -> String -> String -> Int -> [CiteField] -> String -> Citation
- cInProceedings :: People -> String -> String -> Int -> [CiteField] -> String -> Citation
- cManual :: String -> [CiteField] -> String -> Citation
- cMThesis :: People -> String -> String -> Int -> [CiteField] -> String -> Citation
- cMisc :: [CiteField] -> String -> Citation
- cPhDThesis :: People -> String -> String -> Int -> [CiteField] -> String -> Citation
- cProceedings :: String -> Int -> [CiteField] -> String -> Citation
- cTechReport :: People -> String -> String -> Int -> [CiteField] -> String -> Citation
- cUnpublished :: People -> String -> String -> [CiteField] -> String -> Citation
- data CiteField
- = Address String
- | Author People
- | BookTitle String
- | Chapter Int
- | Edition Int
- | Editor People
- | HowPublished HP
- | Institution String
- | Journal String
- | Month Month
- | Note String
- | Number Int
- | Organization String
- | Pages [Int]
- | Publisher String
- | School String
- | Series String
- | Title String
- | Type String
- | Volume Int
- | Year Int
- data HP
- data CitationKind
- class HasFields c where
- author :: People -> CiteField
- editor :: People -> CiteField
- address :: String -> CiteField
- bookTitle :: String -> CiteField
- howPublished :: String -> CiteField
- howPublishedU :: String -> CiteField
- institution :: String -> CiteField
- journal :: String -> CiteField
- note :: String -> CiteField
- organization :: String -> CiteField
- publisher :: String -> CiteField
- school :: String -> CiteField
- series :: String -> CiteField
- title :: String -> CiteField
- typeField :: String -> CiteField
- chapter :: Int -> CiteField
- edition :: Int -> CiteField
- number :: Int -> CiteField
- volume :: Int -> CiteField
- year :: Int -> CiteField
- pages :: [Int] -> CiteField
- month :: Month -> CiteField
- compareAuthYearTitle :: HasFields c => c -> c -> Ordering
- data ConceptInstance
- cic :: Concept c => String -> Sentence -> String -> c -> ConceptInstance
- enumBullet :: Reference -> [Sentence] -> LabelledContent
- enumBulletU :: [Sentence] -> Contents
- enumSimple :: Reference -> Integer -> Sentence -> [Sentence] -> LabelledContent
- enumSimpleU :: Integer -> Sentence -> [Sentence] -> Contents
- mkEnumSimpleD :: (Referable c, HasShortName c, Definition c) => [c] -> [Contents]
- lbldExpr :: ModelExpr -> Reference -> LabelledContent
- unlbldExpr :: ModelExpr -> Contents
- unlbldCode :: Expr -> Contents
- foldlSP :: [Sentence] -> Contents
- foldlSP_ :: [Sentence] -> Contents
- foldlSPCol :: [Sentence] -> Contents
- data ListType
- data RawContent
- = Table [Sentence] [[Sentence]] Title Bool
- | Paragraph Sentence
- | EqnBlock ModelExpr
- | DerivBlock Sentence [RawContent]
- | Enumeration ListType
- | Defini [(Identifier, [Contents])]
- | Figure Lbl Filepath MaxWidthPercent HasCaption
- | Bib BibRef
- | Graph [(Sentence, Sentence)] (Maybe Width) (Maybe Height) Lbl
- | CodeBlock Expr
- data Contents
- data LabelledContent = LblC {}
- type ListTuple = (Title, ItemType, Maybe String)
- data ItemType
- type MaxWidthPercent = Float
- class HasContents c where
- accessContents :: Lens' c RawContent
- newtype UnlabelledContent = UnlblC {}
- data HasCaption
- type Lbl = Sentence
- type Filepath = String
- type Author = Sentence
- type Title = Sentence
- data DecRef = DR {}
- class HasDecRef c where
- getDecRefs :: Lens' c [DecRef]
- dRef :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> DecRef
- dRefInfo :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> RefInfo -> DecRef
- sentToExp :: Sentence -> [ModelExpr]
- extractMExprs :: HasContents a => a -> [ModelExpr]
- extractSents :: HasContents a => a -> [Sentence]
- extractSents' :: HasContents a => [a] -> [Sentence]
- extractChRefs :: HasContents a => [a] -> Set UID
- getSec :: Section -> [Sentence]
- extractSectionsBib :: ChunkDB -> [Section] -> BibRef
- resolveBibliography :: ChunkDB -> Set UID -> [Citation]
- raw :: String -> IRefProg
- data IRefProg
- data LblType
- class (IsChunk s, HasRefAddress s) => Referable s where
- class HasRefAddress b where
- (+::+) :: IRefProg -> IRefProg -> IRefProg
- defer :: UID -> IRefProg
- name :: IRefProg
- getAdd :: LblType -> String
- prepend :: String -> IRefProg
- data Reference = Reference UID LblType ShortName
- ref :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> Reference
- class HasReference c where
- getReferences :: Lens' c [Reference]
- refS :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> Sentence
- namedRef :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> Sentence -> Sentence
- complexRef :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> RefInfo -> Sentence
- namedComplexRef :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> Sentence -> RefInfo -> Sentence
- data SecCons
- data Section = Section {}
- data Document
- ulcc :: RawContent -> UnlabelledContent
- mkParagraph :: Sentence -> Contents
- mkRawLC :: RawContent -> Reference -> LabelledContent
- section :: Sentence -> [Contents] -> [Section] -> Reference -> Section
- fig :: Lbl -> Filepath -> RawContent
- figNoCap :: Lbl -> Filepath -> RawContent
- figWithWidth :: Lbl -> Filepath -> MaxWidthPercent -> RawContent
- figNoCapWithWidth :: Lbl -> Filepath -> MaxWidthPercent -> RawContent
- llcc :: UID -> LblType -> ShortName -> RawContent -> LabelledContent
- llccFig :: String -> RawContent -> LabelledContent
- llccTab :: String -> RawContent -> LabelledContent
- llccEqn :: String -> RawContent -> LabelledContent
- llccFig' :: UID -> RawContent -> LabelledContent
- llccTab' :: UID -> RawContent -> LabelledContent
- llccEqn' :: UID -> RawContent -> LabelledContent
- mkFig :: Reference -> RawContent -> Contents
- data ShowTableOfContents
- checkToC :: Document -> Document
- makeTabRef :: String -> Reference
- makeFigRef :: String -> Reference
- makeSecRef :: String -> Sentence -> Reference
- makeEqnRef :: String -> Reference
- makeURI :: String -> String -> ShortName -> Reference
- makeTabRef' :: UID -> Reference
- makeFigRef' :: UID -> Reference
- makeSecRef' :: UID -> Sentence -> Reference
- makeEqnRef' :: UID -> Reference
- makeURI' :: UID -> String -> ShortName -> Reference
- fterms :: (NamedIdea c, NamedIdea d) => (NP -> NP -> t) -> c -> d -> t
- bulletFlat :: [Sentence] -> ListType
- mkEnumAbbrevList :: Integer -> Sentence -> [Sentence] -> [(Sentence, ItemType)]
- chgsStart :: (HasShortName x, Referable x) => x -> Sentence -> Sentence
- definedIn :: (Referable r, HasShortName r, DefinesQuantity r) => r -> Sentence
- definedIn' :: (Referable r, HasShortName r, DefinesQuantity r) => r -> Sentence -> Sentence
- definedIn'' :: (Referable r, HasShortName r) => r -> Sentence
- definedIn''' :: (Quantity q, Referable r, HasShortName r) => q -> r -> Sentence
- fromReplace :: (Referable r, HasShortName r, Quantity q) => r -> q -> Sentence
- fromSource :: (Referable r, HasShortName r) => r -> Sentence
- fromSources :: (Referable r, HasShortName r) => [r] -> Sentence
- fmtU :: MayHaveUnit a => Sentence -> a -> Sentence
- follows :: (Referable r, HasShortName r) => Sentence -> r -> Sentence
- makeListRef :: [a] -> Section -> [Sentence]
- addPercent :: Show a => a -> Sentence
- maybeChanged :: Sentence -> Sentence -> Sentence
- maybeExpanded :: Sentence -> Sentence -> Sentence
- maybeWOVerb :: Sentence -> Sentence -> Sentence
- showingCxnBw :: NamedIdea c => c -> Sentence -> Sentence
- substitute :: (Referable r, HasShortName r, DefinesQuantity r) => [r] -> Sentence
- typUncr :: (Double, Maybe Int) -> Sentence
- underConsidertn :: ConceptChunk -> Sentence
- chWithUnit :: (Quantity a, MayHaveUnit a) => a -> Sentence
- unitInParen :: MayHaveUnit a => a -> Sentence
- unitSym :: MayHaveUnit a => a -> Sentence
- eqN :: Int -> Sentence
- eqnWSource :: (Referable r, HasShortName r) => ModelExpr -> r -> Sentence
- bulletNested :: [Sentence] -> [ListType] -> ListType
- makeTMatrix :: Eq a => [Sentence] -> [[a]] -> [a] -> [[Sentence]]
- mkTableFromColumns :: [(Sentence, [Sentence])] -> ([Sentence], [[Sentence]])
- noRefs :: [ItemType] -> [(ItemType, Maybe String)]
- refineChain :: NamedIdea c => [(c, Section)] -> Sentence
- tAndDOnly :: Concept s => s -> ItemType
- tAndDWAcc :: Concept s => s -> ItemType
- tAndDWSym :: (Concept s, Quantity a) => s -> a -> ItemType
- zipSentList :: [[Sentence]] -> [Sentence] -> [[Sentence]] -> [[Sentence]]
- data ShortName
- class HasShortName s where
- shortname' :: Sentence -> ShortName
- getSentSN :: ShortName -> Sentence
Documentation
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
class HasCitation c where Source #
Some documents, as well as some pieces of knowledge, have citations.
citeKind :: Lens' Citation CitationKind Source #
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.
Fields used in citations.
Constructors
| Address String | |
| Author People | |
| BookTitle String | Used for |
| 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
| HasChunkRefs CiteField Source # | |||||
| Generic CiteField Source # | |||||
Defined in Language.Drasil.Document.Citation.Components Associated Types
| |||||
| type Rep CiteField Source # | |||||
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))))))) | |||||
How something is published. Necessary for URLs to work properly.
Instances
| HasChunkRefs HP Source # | |||||
| Generic HP Source # | |||||
Defined in Language.Drasil.Document.Citation.Components Associated Types
| |||||
| type Rep HP Source # | |||||
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).
Constructors
| Article | |
| Book | |
| Booklet | |
| InBook | |
| InCollection | |
| InProceedings | |
| Manual | |
| MThesis | |
| Misc | |
| PhDThesis | |
| Proceedings | |
| TechReport | |
| Unpublished |
Instances
| HasChunkRefs CitationKind Source # | |||||
Defined in Language.Drasil.Document.Citation.Components Methods chunkRefs :: CitationKind -> Set UID # | |||||
| Generic CitationKind Source # | |||||
Defined in Language.Drasil.Document.Citation.Components Associated Types
| |||||
| type Rep CitationKind Source # | |||||
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))))) | |||||
howPublishedU :: String -> CiteField Source #
Smart field constructor for a CiteField.
URL version of howPublished.
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
| HasChunkRefs ConceptInstance Source # | |||||
Defined in Language.Drasil.Document.ConceptInstance Methods chunkRefs :: ConceptInstance -> Set UID # | |||||
| HasUID ConceptInstance Source # | Finds | ||||
Defined in Language.Drasil.Document.ConceptInstance Methods uid :: Getter ConceptInstance UID # | |||||
| Idea ConceptInstance Source # | Finds the idea contained in the | ||||
Defined in Language.Drasil.Document.ConceptInstance | |||||
| NamedIdea ConceptInstance Source # | Finds term ( | ||||
Defined in Language.Drasil.Document.ConceptInstance Methods term :: Lens' ConceptInstance NP Source # | |||||
| ConceptDomain ConceptInstance Source # | Finds the domain contained in the | ||||
Defined in Language.Drasil.Document.ConceptInstance Methods cdom :: ConceptInstance -> [UID] Source # | |||||
| Definition ConceptInstance Source # | Finds the definition contained in the | ||||
Defined in Language.Drasil.Document.ConceptInstance Methods defn :: Lens' ConceptInstance Sentence Source # | |||||
| HasRefAddress ConceptInstance Source # | Finds the reference address contained in a | ||||
Defined in Language.Drasil.Document.ConceptInstance Methods getRefAdd :: ConceptInstance -> LblType Source # | |||||
| Referable ConceptInstance Source # | Finds the reference information contained in a | ||||
Defined in Language.Drasil.Document.ConceptInstance | |||||
| HasShortName ConceptInstance Source # | Finds the | ||||
Defined in Language.Drasil.Document.ConceptInstance Methods shortname :: ConceptInstance -> ShortName Source # | |||||
| Generic ConceptInstance Source # | |||||
Defined in Language.Drasil.Document.ConceptInstance Associated Types
Methods from :: ConceptInstance -> Rep ConceptInstance x # to :: Rep ConceptInstance x -> ConceptInstance # | |||||
| Eq ConceptInstance Source # | Equal if | ||||
Defined in Language.Drasil.Document.ConceptInstance Methods (==) :: ConceptInstance -> ConceptInstance -> Bool # (/=) :: ConceptInstance -> ConceptInstance -> Bool # | |||||
| type Rep ConceptInstance Source # | |||||
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
foldlSPCol :: [Sentence] -> Contents Source #
Same as foldlSP but uses foldlSentCol.
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 |
| Desc [ListTuple] | Descriptive list, renders as "Title: Item" (see |
| Definitions [ListTuple] | Renders a list of " |
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 |
| Enumeration ListType | For enumerated lists. |
| Defini [(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 Expr | Block for codes |
Contents may be labelled or unlabelled.
Constructors
| UlC UnlabelledContent | |
| LlC LabelledContent |
Instances
| HasContents Contents Source # | Access the |
Defined in Language.Drasil.Document.Core Methods accessContents :: Lens' Contents RawContent Source # | |
data LabelledContent Source #
Contains a Reference and RawContent.
Instances
| HasChunkRefs LabelledContent Source # | |
Defined in Language.Drasil.Document.Core Methods chunkRefs :: LabelledContent -> Set UID # | |
| HasUID LabelledContent Source # | Finds |
Defined in Language.Drasil.Document.Core Methods uid :: Getter LabelledContent UID # | |
| HasContents LabelledContent Source # | Access the |
Defined in Language.Drasil.Document.Core Methods accessContents :: Lens' LabelledContent RawContent Source # | |
| HasRefAddress LabelledContent Source # | Finds the reference address contained in the |
Defined in Language.Drasil.Document.Core Methods getRefAdd :: LabelledContent -> LblType Source # | |
| Referable LabelledContent Source # | Finds the reference information of |
Defined in Language.Drasil.Document.Core | |
| HasShortName LabelledContent Source # | Find the shortname of the reference address used for the |
Defined in Language.Drasil.Document.Core Methods shortname :: LabelledContent -> ShortName Source # | |
| Eq LabelledContent Source # |
|
Defined in Language.Drasil.Document.Core Methods (==) :: LabelledContent -> LabelledContent -> Bool # (/=) :: LabelledContent -> LabelledContent -> Bool # | |
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.
class HasContents c where Source #
Members of this class must have RawContent.
Instances
| HasContents Contents Source # | Access the |
Defined in Language.Drasil.Document.Core Methods accessContents :: Lens' Contents RawContent Source # | |
| HasContents LabelledContent Source # | Access the |
Defined in Language.Drasil.Document.Core Methods accessContents :: Lens' LabelledContent RawContent Source # | |
| HasContents UnlabelledContent Source # | Access the |
Defined in Language.Drasil.Document.Core Methods accessContents :: Lens' UnlabelledContent RawContent Source # | |
newtype UnlabelledContent Source #
Only contains RawContent.
Constructors
| UnlblC | |
Fields | |
Instances
| HasContents UnlabelledContent Source # | Access the |
Defined in Language.Drasil.Document.Core Methods accessContents :: Lens' UnlabelledContent RawContent Source # | |
data HasCaption Source #
Indicates whether a figure has a caption or not.
Constructors
| NoCaption | |
| WithCaption |
Instances
| Eq HasCaption Source # | |
Defined in Language.Drasil.Document.Core | |
For holding a Reference that is decorated with extra information (ex. page numbers, equation sources, etc.).
Instances
| HasChunkRefs DecRef Source # | |||||
| HasUID DecRef Source # | Finds the | ||||
Defined in Language.Drasil.Document.DecoratedReference | |||||
| HasRefAddress DecRef Source # | Finds the reference address contained in a | ||||
| HasShortName DecRef Source # | Finds the shortname of the reference address used for the | ||||
| Generic DecRef Source # | |||||
Defined in Language.Drasil.Document.DecoratedReference Associated Types
| |||||
| Eq DecRef Source # | Equal if | ||||
| type Rep DecRef Source # | |||||
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))) | |||||
dRef :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> DecRef Source #
dRefInfo :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> RefInfo -> DecRef Source #
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.
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.
Created for different forms of references. Used in LblType.
Constructors
| Deferred UID | Deferred lookup; done later. Used for domains in a |
| RS String | Lifts a |
| RConcat IRefProg IRefProg | Concatenates with two subprograms. |
| Name | The |
Instances
| HasChunkRefs IRefProg Source # | |||||
| Generic IRefProg Source # | |||||
Defined in Language.Drasil.Document.Labels Associated Types
| |||||
| type Rep IRefProg Source # | |||||
Defined in Language.Drasil.Document.Labels type Rep IRefProg = D1 ('MetaData "IRefProg" "Language.Drasil.Document.Labels" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'False) ((C1 ('MetaCons "Deferred" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UID)) :+: C1 ('MetaCons "RS" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String))) :+: (C1 ('MetaCons "RConcat" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 IRefProg) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 IRefProg)) :+: C1 ('MetaCons "Name" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
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
| HasChunkRefs LblType Source # | |||||
| Generic LblType Source # | |||||
Defined in Language.Drasil.Document.Labels Associated Types
| |||||
| type Rep LblType Source # | |||||
Defined in Language.Drasil.Document.Labels type Rep LblType = D1 ('MetaData "LblType" "Language.Drasil.Document.Labels" "drasil-lang-0.1.60.0-1HMwkmtaiHpDlCGzFv9lso" 'False) (C1 ('MetaCons "RP" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 IRefProg) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: (C1 ('MetaCons "Citation" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: C1 ('MetaCons "URI" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)))) | |||||
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
| Referable Citation Source # | Gets the reference information of a |
| Referable ConceptInstance Source # | Finds the reference information contained in a |
Defined in Language.Drasil.Document.ConceptInstance | |
| Referable LabelledContent Source # | Finds the reference information of |
Defined in Language.Drasil.Document.Core | |
| Referable Section Source # | Finds the reference information of a |
class HasRefAddress b where Source #
Members must have a reference address.
Instances
| HasRefAddress Citation Source # | Gets the reference address of a |
| HasRefAddress ConceptInstance Source # | Finds the reference address contained in a |
Defined in Language.Drasil.Document.ConceptInstance Methods getRefAdd :: ConceptInstance -> LblType Source # | |
| HasRefAddress LabelledContent Source # | Finds the reference address contained in the |
Defined in Language.Drasil.Document.Core Methods getRefAdd :: LabelledContent -> LblType Source # | |
| HasRefAddress DecRef Source # | Finds the reference address contained in a |
| HasRefAddress Reference Source # | Finds the reference address contained in a |
| HasRefAddress Section Source # | Finds the reference address of a |
A Reference contains the identifier (UID), a reference address (LblType),
a human-readable shortname (ShortName), and any extra information about the reference (RefInfo).
Instances
| HasChunkRefs Reference Source # | |||||
| HasUID Reference Source # | |||||
Defined in Language.Drasil.Document.Reference | |||||
| HasRefAddress Reference Source # | Finds the reference address contained in a | ||||
| HasShortName Reference Source # | Finds the shortname of the reference address used for the | ||||
| Generic Reference Source # | |||||
Defined in Language.Drasil.Document.Reference Associated Types
| |||||
| Eq Reference Source # | Equal if | ||||
| type Rep Reference Source # | |||||
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.
refS :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> Sentence Source #
namedRef :: (IsChunk r, HasRefAddress r, HasShortName r) => r -> Sentence -> Sentence Source #
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 #
Section Contents are split into subsections or contents, where contents
are standard layout objects (see Contents).
Instances
| HasChunkRefs Section Source # | |
| HasUID Section Source # | |
Defined in Language.Drasil.Document.Sections | |
| HasRefAddress Section Source # | Finds the reference address of a |
| Referable Section Source # | Finds the reference information of a |
| HasShortName Section Source # | Finds the short name of a |
| Eq Section Source # | |
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.
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.
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.
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).
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.
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).
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 #
definedIn' :: (Referable r, HasShortName r, DefinesQuantity r) => r -> Sentence -> Sentence Source #
definedIn'' :: (Referable r, HasShortName r) => r -> Sentence Source #
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 #
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.
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
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)".
eqnWSource :: (Referable r, HasShortName r) => ModelExpr -> r -> Sentence Source #
Takes an expression and a Referable and outputs as a Sentence "expression (source)".
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"]]
Used for holding the short form of a name (as a Sentence with a wrapper).
Instances
| HasChunkRefs ShortName Source # | |||||
| Generic ShortName Source # | |||||
Defined in Language.Drasil.Document.ShortName Associated Types
| |||||
| type Rep ShortName Source # | |||||
Defined in Language.Drasil.Document.ShortName | |||||
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).
Instances
| HasShortName Citation Source # | |
| HasShortName ConceptInstance Source # | Finds the |
Defined in Language.Drasil.Document.ConceptInstance Methods shortname :: ConceptInstance -> ShortName Source # | |
| HasShortName LabelledContent Source # | Find the shortname of the reference address used for the |
Defined in Language.Drasil.Document.Core Methods shortname :: LabelledContent -> ShortName Source # | |
| HasShortName DecRef Source # | Finds the shortname of the reference address used for the |
| HasShortName Reference Source # | Finds the shortname of the reference address used for the |
| HasShortName Section Source # | Finds the short name of a |
shortname' :: Sentence -> ShortName Source #