casa-reoc-0.1.0.0: src/ReOC/Render/TrainingManual/Chunk.hs
{-# LANGUAGE DeriveLift #-}
{-# OPTIONS_GHC -Wall #-}
-- | A part of the marked-up text of the RePL training manual template.
module ReOC.Render.TrainingManual.Chunk (
Chunk (..),
) where
import Data.Text (Text)
import Language.Haskell.TH.Syntax (Lift)
{- | A part of the marked-up text of the RePL training manual template:
markdown text, a hole @{{name}}@, or the text of a marker
@<!-- ... -->@ … @<!-- end -->@.
-}
data Chunk
= -- | Markdown text.
Literal Text
| -- | A hole, by name.
Hole Text
| -- | @<!-- if KEY=VALUE -->@: included when the course of the enclosing @per-course@ block has the value.
CourseCondition Text Text [Chunk]
| -- | @<!-- if offered KEY=VALUE -->@: included when any course has the value.
OfferedCondition Text Text [Chunk]
| -- | @<!-- if simulator -->@: included when a simulator is used.
SimulatorCondition [Chunk]
| -- | @<!-- per-course begin -->@ … @<!-- per-course end -->@: included once for each course.
PerCourse [Chunk]
deriving (Eq, Show, Lift)