Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | None |
Language | Haskell2010 |
Description : Converting data types into IpeTypes
Synopsis
- writeIpeFile :: IpeWriteText r => FilePath -> IpeFile r -> IO ()
- writeIpePage :: IpeWriteText r => FilePath -> IpePage r -> IO ()
- printAsIpeSelection :: IpeWrite t => t -> IO ()
- toIpeSelectionXML :: IpeWrite t => t -> Maybe ByteString
- toIpeXML :: IpeWrite t => t -> Maybe ByteString
- writeIpeFile' :: IpeWrite t => t -> FilePath -> IO ()
- class IpeWriteText t where
- ipeWriteText :: t -> Maybe Text
- class IpeWrite t where
- ipeWriteAttrs :: (AllSatisfy IpeAttrName rs, RecAll (Attr f) rs IpeWriteText) => Attributes f rs -> [(Text, Text)]
- writeAttrValues :: RecAll f rs IpeWriteText => Rec f rs -> Rec (Const (Maybe Text)) rs
- addAtts :: Node Text Text -> [(Text, Text)] -> Node Text Text
- mAddAtts :: Maybe (Node Text Text) -> [(Text, Text)] -> Maybe (Node Text Text)
- writeByShow :: Show t => t -> Maybe Text
- unwords' :: [Maybe Text] -> Maybe Text
- unlines' :: [Maybe Text] -> Maybe Text
- ipeWriteRec :: RecAll f rs IpeWrite => Rec f rs -> [Node Text Text]
- fromPolyLine :: PolyLine 2 () r -> Path r
- combine :: [Node Text Text] -> Maybe (Node Text Text)
Documentation
writeIpeFile :: IpeWriteText r => FilePath -> IpeFile r -> IO () Source #
Given a prism to convert something of type g into an ipe file, a file path, and a g. Convert the geometry and write it to file.
Write an IpeFiele to file.
writeIpePage :: IpeWriteText r => FilePath -> IpePage r -> IO () Source #
Creates a single page ipe file with the given page
printAsIpeSelection :: IpeWrite t => t -> IO () Source #
Convert the input to ipeXml, and prints it to standard out in such a way that the copied text can be pasted into ipe as a geometry object.
toIpeSelectionXML :: IpeWrite t => t -> Maybe ByteString Source #
Convert input into an ipe selection.
writeIpeFile' :: IpeWrite t => t -> FilePath -> IO () Source #
Convert to ipe XML and write the output to a file.
class IpeWriteText t where Source #
For types that can produce a text value
ipeWriteText :: t -> Maybe Text Source #
Instances
class IpeWrite t where Source #
Types that correspond to an XML Element. All instances should produce an
Element. If the type should produce a Node with the Text constructor, use
the IpeWriteText
typeclass instead.
Instances
ipeWriteAttrs :: (AllSatisfy IpeAttrName rs, RecAll (Attr f) rs IpeWriteText) => Attributes f rs -> [(Text, Text)] Source #
Functon to write all attributes in a Rec
writeAttrValues :: RecAll f rs IpeWriteText => Rec f rs -> Rec (Const (Maybe Text)) rs Source #
Writing the attribute values
mAddAtts :: Maybe (Node Text Text) -> [(Text, Text)] -> Maybe (Node Text Text) Source #
Same as addAtts
but then for a Maybe node
fromPolyLine :: PolyLine 2 () r -> Path r Source #