mdoc-0.1.0.0: src/Mdoc/MdocLine.hs
-- |
--
-- Module : Mdoc.MdocLine
-- Copyright : (c) 2026 Patrick Brisbin
-- License : AGPL-3
-- Maintainer : pbrisbin@gmail.com
-- Stability : experimental
-- Portability : POSIX
module Mdoc.MdocLine
( MdocLine (..)
-- * Lenses
, _Dd
) where
import Mdoc.Prelude
import Mdoc.Interpolation
import Mdoc.MacroArg
import Mdoc.MacroName
import Mdoc.Optics
import Mdoc.TableLine
import Mdoc.TroffMacro
data MdocLine
= Comment Text
| MacroLine MacroName [MacroArg]
| TextLine Text
| TableLines [TableLine]
| TroffMacro TroffMacro
| InterpolatedLine Interpolation
deriving stock (Eq, Show)
_Dd :: Prism' MdocLine [MacroArg]
_Dd = prism (MacroLine Dd) $ \case
MacroLine Dd args -> Right args
other -> Left other