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

Language.Drasil.Document.Contents

Description

General functions that are useful in manipulating some Drasil types into printable Contents.

Synopsis

List Creation Functions

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.

Displaying Expressions

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 :: CodeExpr -> Contents Source #

Unlabelled code expression