module Language.Ltml.AST.Section
    ( Section (..)
    , FormattedSection
    , Heading (..)
    , SectionBody (..)
    )
where

import Language.Lsd.AST.Format (InnerHeadingFormat)
import Language.Lsd.AST.Type.Section (SectionFormatted)
import Language.Ltml.AST.Node (Node)
import Language.Ltml.AST.Paragraph (Paragraph)
import Language.Ltml.AST.SimpleBlock (SimpleBlock)
import Language.Ltml.AST.Text (HeadingTextTree)
import Language.Ltml.Common (Flagged', Parsed)

type FormattedSection = SectionFormatted (Parsed (Node Section))

data Section
    = Section
        (Parsed Heading)
        SectionBody
    deriving (Int -> Section -> ShowS
[Section] -> ShowS
Section -> String
(Int -> Section -> ShowS)
-> (Section -> String) -> ([Section] -> ShowS) -> Show Section
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Section -> ShowS
showsPrec :: Int -> Section -> ShowS
$cshow :: Section -> String
show :: Section -> String
$cshowList :: [Section] -> ShowS
showList :: [Section] -> ShowS
Show)

data Heading
    = Heading
        InnerHeadingFormat
        [HeadingTextTree]
    deriving (Int -> Heading -> ShowS
[Heading] -> ShowS
Heading -> String
(Int -> Heading -> ShowS)
-> (Heading -> String) -> ([Heading] -> ShowS) -> Show Heading
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Heading -> ShowS
showsPrec :: Int -> Heading -> ShowS
$cshow :: Heading -> String
show :: Heading -> String
$cshowList :: [Heading] -> ShowS
showList :: [Heading] -> ShowS
Show)

data SectionBody
    = InnerSectionBody [Flagged' FormattedSection]
    | LeafSectionBody [Node Paragraph]
    | SimpleLeafSectionBody [SimpleBlock]
    deriving (Int -> SectionBody -> ShowS
[SectionBody] -> ShowS
SectionBody -> String
(Int -> SectionBody -> ShowS)
-> (SectionBody -> String)
-> ([SectionBody] -> ShowS)
-> Show SectionBody
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SectionBody -> ShowS
showsPrec :: Int -> SectionBody -> ShowS
$cshow :: SectionBody -> String
show :: SectionBody -> String
$cshowList :: [SectionBody] -> ShowS
showList :: [SectionBody] -> ShowS
Show)