getSectionBody :: FilePath -> T.Text -> IO [BodyItem]
getSectionBody inputWrapperPath documentID = do
  let inputDocumentPath =
        fromString $ inputWrapperPath ++ "/Files/Docs/"
                     ++ (T.unpack documentID) ++ ".rtf"
  exists <- IO.doesFileExist inputDocumentPath
  if exists
    then do
      rtf <- RTF.readFile inputDocumentPath
      case rtf of
        Nothing -> do
          putStrLn $ "Unable to read from " ++ inputDocumentPath
          IO.exitFailure
        Just rtf -> do
          let paragraphs =
                map (\paragraphIn ->
                       Paragraph [Text $ RTF.paragraphText paragraphIn])
                    (RTF.rtfParagraphs rtf)
          return $!! paragraphs
    else return []
getSectionBody :: FilePath -> T.Text -> IO [BodyItem]
getSectionBody inputWrapperPath documentID = do
  let inputDocumentPath =
        fromString $ inputWrapperPath ++ "/Files/Docs/"
                     ++ (T.unpack documentID) ++ ".rtf"
  exists <- IO.doesFileExist inputDocumentPath
  if exists
    then do
      rtf <- RTF.readFile inputDocumentPath
      case rtf of
        Nothing -> do
          putStrLn $ "Unable to read from " ++ inputDocumentPath
          IO.exitFailure
        Just rtf -> do
          let paragraphs =
                map (\paragraphIn ->
                       Paragraph [Text $ RTF.paragraphText paragraphIn])
                    (RTF.rtfParagraphs rtf)
          return $!! paragraphs
    else return []
getSectionBody inputWrapperPath documentID = do
  let inputDocumentPath =
        fromString $ inputWrapperPath ++ "/Files/Docs/"
                     ++ (T.unpack documentID) ++ ".rtf"
  exists <- IO.doesFileExist inputDocumentPath
  if exists
    then do
      rtf <- RTF.readFile inputDocumentPath
      case rtf of
        Nothing -> do
          putStrLn $ "Unable to read from " ++ inputDocumentPath
          IO.exitFailure
        Just rtf -> do
          let paragraphs =
                map (\paragraphIn ->
                       Paragraph [Text $ RTF.paragraphText paragraphIn])
                    (RTF.rtfParagraphs rtf)
          return $!! paragraphs
    else return []