-- | Lesson plan notebook section declaration types and functions.
module Drasil.DocumentLanguage.Notebook.LsnDecl where

import qualified Drasil.DocumentLanguage.Notebook.Core as NB (LsnDesc, LsnChapter(..), 
  Intro(..), LearnObj(..), Review(..), CaseProb(..), Example(..), Smmry(..), Apndx(..))

import SysInfo.Drasil (SystemInformation)

-- * Types

-- | A Lesson Plan notebook declaration is made up of all necessary chapters ('LsnChapter's).
type LsnDecl  = [LsnChapter]

-- | Contains all the different chapters needed for a notebook lesson plan ('LsnDecl').
data LsnChapter = Intro NB.Intro
                | LearnObj NB.LearnObj
                | Review NB.Review
                | CaseProb NB.CaseProb
                | Example NB.Example
                | Smmry NB.Smmry
                | BibSec
                | Apndx NB.Apndx

-- * Functions

-- | Creates the lesson description (translates 'LsnDecl' into a more usable form for generating documents).
mkLsnDesc :: SystemInformation -> LsnDecl -> NB.LsnDesc
mkLsnDesc :: SystemInformation -> LsnDecl -> LsnDesc
mkLsnDesc SystemInformation
_ = forall a b. (a -> b) -> [a] -> [b]
map LsnChapter -> LsnChapter
sec where
  sec :: LsnChapter -> NB.LsnChapter
  sec :: LsnChapter -> LsnChapter
sec (Intro Intro
i)     = Intro -> LsnChapter
NB.Intro Intro
i
  sec (LearnObj LearnObj
lo) = LearnObj -> LsnChapter
NB.LearnObj LearnObj
lo
  sec (Review Review
r)    = Review -> LsnChapter
NB.Review Review
r  
  sec (CaseProb CaseProb
cp) = CaseProb -> LsnChapter
NB.CaseProb CaseProb
cp
  sec (Example Example
e)   = Example -> LsnChapter
NB.Example Example
e  
  sec (Smmry Smmry
s)     = Smmry -> LsnChapter
NB.Smmry Smmry
s
  sec LsnChapter
BibSec        = LsnChapter
NB.BibSec
  sec (Apndx Apndx
a)     = Apndx -> LsnChapter
NB.Apndx Apndx
a