hoodle-builder 0.2 → 0.2.1
raw patch · 2 files changed
+12/−4 lines, 2 filesdep ~hoodle-typesPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: hoodle-types
API changes (from Hackage documentation)
+ Text.Hoodle.Builder: buildRevision :: Revision -> Builder
Files
- hoodle-builder.cabal +2/−3
- src/Text/Hoodle/Builder.hs +10/−1
hoodle-builder.cabal view
@@ -1,5 +1,5 @@ Name: hoodle-builder-Version: 0.2+Version: 0.2.1 Synopsis: text builder for hoodle file format Description: This library builds text xoj format file from hoodle data structure License: BSD3@@ -20,7 +20,7 @@ ghc-prof-options: -caf-all -auto-all Build-Depends: base == 4.*,- hoodle-types >= 0.2,+ hoodle-types >= 0.2.1, lens >= 2.5, blaze-builder == 0.3.*, strict == 0.3.*, @@ -30,7 +30,6 @@ Exposed-Modules: Text.Hoodle.Builder Text.Hoodle.Builder.V0_1_1- -- Text.Hoodle.Builder.V0_1_999 Other-Modules:
src/Text/Hoodle/Builder.hs view
@@ -51,10 +51,11 @@ -- | buildHoodle :: Hoodle -> Builder -buildHoodle hdl = fromByteString "<?xml version=\"1.0\" standalone=\"no\"?>\n<hoodle version=\"0.2\" id=\""+buildHoodle hdl = fromByteString "<?xml version=\"1.0\" standalone=\"no\"?>\n<hoodle version=\"0.2.1\" id=\"" <> fromByteString (view hoodleID hdl) <> fromByteString "\">\n" <> (buildTitle . view title) hdl + <> (mconcat . map buildRevision . view revisions) hdl <> (maybe mempty buildEmbeddedPdf . view embeddedPdf) hdl <> (mconcat . map buildPage . view pages) hdl <> fromByteString "</hoodle>\n"@@ -64,6 +65,14 @@ buildTitle ttl = fromByteString "<title>" <> fromByteString ttl <> fromByteString "</title>\n"+ +-- | +buildRevision :: Revision -> Builder +buildRevision rev = fromByteString "<revision revmd5=\""+ <> fromByteString (view revmd5 rev)+ <> fromByteString "\" revtxt=\""+ <> fromByteString (view revtxt rev)+ <> fromByteString "\"/>\n" -- | buildEmbeddedPdf :: S.ByteString -> Builder