-- | Defines helper functions used to make the general system description section.
module Drasil.Sections.GeneralSystDesc where

import Language.Drasil
import Language.Drasil.Sentence.Combinators

import Data.Drasil.Concepts.Documentation (interface, system, environment,
  userCharacteristic, systemConstraint, information, section_)
import qualified Drasil.DocLang.SRS as SRS (sysCon, sysCont, userChar)

-- | Default General System Description introduction.
genSysIntro :: Contents
genSysIntro :: Contents
genSysIntro = [Sentence] -> Contents
foldlSP [String -> Sentence
S "This", NamedChunk -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
phrase NamedChunk
section_, String -> Sentence
S "provides general",
  NamedChunk -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
phrase NamedChunk
information, String -> Sentence
S "about the" Sentence -> Sentence -> Sentence
+:+. NamedChunk -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
phrase NamedChunk
system, String -> Sentence
S "It identifies the",
  NamedChunk -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
plural NamedChunk
interface, String -> Sentence
S "between the", NamedChunk -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
phrase NamedChunk
system Sentence -> Sentence -> Sentence
`andIts` NamedChunk -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
phrase NamedChunk
environment Sentence -> Sentence -> Sentence
`sC`
  String -> Sentence
S "describes the", NamedChunk -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
plural NamedChunk
userCharacteristic Sentence -> Sentence -> Sentence
`sC` String -> Sentence
S "and lists the", NamedChunk -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
plural NamedChunk
systemConstraint]

-- | User Characeristics section constructor. Does not contain any subsections.
usrCharsF :: [Contents] -> Section
usrCharsF :: [Contents] -> Section
usrCharsF intro :: [Contents]
intro = [Contents] -> [Section] -> Section
SRS.userChar [Contents]
intro []

-- | System Constraints section constructor.
-- Generalized if no constraints, but if there are, they can be passed through.
systCon :: [Contents] -> [Section] -> Section
systCon :: [Contents] -> [Section] -> Section
systCon [] subSec :: [Section]
subSec  = [Contents] -> [Section] -> Section
SRS.sysCon [Contents
systCon_none] [Section]
subSec
            where systCon_none :: Contents
systCon_none = Sentence -> Contents
mkParagraph (String -> Sentence
S "There are no" Sentence -> Sentence -> Sentence
+:+. NamedChunk -> Sentence
forall n. (HasUID n, NamedIdea n) => n -> Sentence
plural NamedChunk
systemConstraint)
systCon a :: [Contents]
a subSec :: [Section]
subSec = [Contents] -> [Section] -> Section
SRS.sysCon [Contents]
a [Section]
subSec

-- | System Context section constructor. Does not contain any subsections.
sysContxt :: [Contents] -> Section
sysContxt :: [Contents] -> Section
sysContxt cs :: [Contents]
cs = [Contents] -> [Section] -> Section
SRS.sysCont [Contents]
cs []