module Text.Pandoc.PlantUML.Filter.Types where
import Data.Text(Text)
import qualified Data.Text as T
type ImageName = String
newtype DiagramSource = DiagramSource Text deriving (DiagramSource -> DiagramSource -> Bool
(DiagramSource -> DiagramSource -> Bool)
-> (DiagramSource -> DiagramSource -> Bool) -> Eq DiagramSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DiagramSource -> DiagramSource -> Bool
$c/= :: DiagramSource -> DiagramSource -> Bool
== :: DiagramSource -> DiagramSource -> Bool
$c== :: DiagramSource -> DiagramSource -> Bool
Eq, Int -> DiagramSource -> ShowS
[DiagramSource] -> ShowS
DiagramSource -> String
(Int -> DiagramSource -> ShowS)
-> (DiagramSource -> String)
-> ([DiagramSource] -> ShowS)
-> Show DiagramSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DiagramSource] -> ShowS
$cshowList :: [DiagramSource] -> ShowS
show :: DiagramSource -> String
$cshow :: DiagramSource -> String
showsPrec :: Int -> DiagramSource -> ShowS
$cshowsPrec :: Int -> DiagramSource -> ShowS
Show)
type ImageFormat = Text
data ImageFileName = ImageFileName ImageName ImageFormat deriving ImageFileName -> ImageFileName -> Bool
(ImageFileName -> ImageFileName -> Bool)
-> (ImageFileName -> ImageFileName -> Bool) -> Eq ImageFileName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageFileName -> ImageFileName -> Bool
$c/= :: ImageFileName -> ImageFileName -> Bool
== :: ImageFileName -> ImageFileName -> Bool
$c== :: ImageFileName -> ImageFileName -> Bool
Eq
instance Show ImageFileName where
show :: ImageFileName -> String
show (ImageFileName String
name ImageFormat
format) = String
name String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
"." String -> ShowS
forall a. Semigroup a => a -> a -> a
<> ImageFormat -> String
T.unpack ImageFormat
format
class Monad m => ImageIO m where
doesImageExist :: ImageFileName -> m Bool
renderImage :: ImageFileName -> DiagramSource -> m ()