cmark-sections 0.3.0 → 0.3.0.1
raw patch · 3 files changed
+21/−13 lines, 3 filesdep ~basedep ~cmarkdep ~hspecPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, cmark, hspec
API changes (from Hackage documentation)
- CMark.Sections: instance (Data.Data.Data b, Data.Data.Data a) => Data.Data.Data (CMark.Sections.Document a b)
- CMark.Sections: instance (Data.Data.Data b, Data.Data.Data a) => Data.Data.Data (CMark.Sections.Section a b)
- CMark.Sections: instance (GHC.Classes.Eq a, GHC.Classes.Eq b) => GHC.Classes.Eq (CMark.Sections.Document a b)
- CMark.Sections: instance (GHC.Classes.Eq b, GHC.Classes.Eq a) => GHC.Classes.Eq (CMark.Sections.Section a b)
- CMark.Sections: instance (GHC.Show.Show a, GHC.Show.Show b) => GHC.Show.Show (CMark.Sections.Document a b)
- CMark.Sections: instance (GHC.Show.Show b, GHC.Show.Show a) => GHC.Show.Show (CMark.Sections.Section a b)
- CMark.Sections: instance GHC.Base.Monoid a => GHC.Base.Monoid (CMark.Sections.WithSource a)
+ CMark.Sections: instance (Data.Data.Data a, Data.Data.Data b) => Data.Data.Data (CMark.Sections.Document a b)
+ CMark.Sections: instance (Data.Data.Data a, Data.Data.Data b) => Data.Data.Data (CMark.Sections.Section a b)
+ CMark.Sections: instance (GHC.Base.Monoid a, GHC.Base.Semigroup a) => GHC.Base.Monoid (CMark.Sections.WithSource a)
+ CMark.Sections: instance (GHC.Classes.Eq a, GHC.Classes.Eq b) => GHC.Classes.Eq (CMark.Sections.Section a b)
+ CMark.Sections: instance (GHC.Classes.Eq b, GHC.Classes.Eq a) => GHC.Classes.Eq (CMark.Sections.Document a b)
+ CMark.Sections: instance (GHC.Show.Show a, GHC.Show.Show b) => GHC.Show.Show (CMark.Sections.Section a b)
+ CMark.Sections: instance (GHC.Show.Show b, GHC.Show.Show a) => GHC.Show.Show (CMark.Sections.Document a b)
+ CMark.Sections: instance GHC.Base.Semigroup a => GHC.Base.Semigroup (CMark.Sections.WithSource a)
Files
- CHANGELOG.md +4/−0
- cmark-sections.cabal +6/−6
- lib/CMark/Sections.hs +11/−7
CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.3.0.1++* Bumped hspec and cmark versions.+ # 0.3.0 * Added `Generic` and `Data` instances.
cmark-sections.cabal view
@@ -1,8 +1,8 @@ name: cmark-sections-version: 0.3.0+version: 0.3.0.1 synopsis: Represent cmark-parsed Markdown as a tree of sections description:- Represent cmark-parsed Markdown as a tree of sections+ Convert a stream of cmark-parsed Markdown to a tree (with nodes marked by sections). homepage: http://github.com/aelve/cmark-sections bug-reports: http://github.com/aelve/cmark-sections/issues license: BSD3@@ -11,7 +11,7 @@ maintainer: yom@artyom.me -- copyright: category: Text-tested-with: GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.1+tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.3 build-type: Simple extra-source-files: CHANGELOG.md cabal-version: >=1.10@@ -24,9 +24,9 @@ exposed-modules: CMark.Sections -- other-modules: -- other-extensions: - build-depends: base >=4.7 && <5+ build-depends: base >=4.9 && <5 , base-prelude == 1.*- , cmark >= 0.5 && < 0.5.6+ , cmark >= 0.5 && < 0.5.7 , containers , microlens == 0.4.* , split == 0.2.*@@ -44,7 +44,7 @@ , cmark , cmark-sections , containers- , hspec >= 2.2 && < 2.5+ , hspec >= 2.2 && < 2.6 , text ghc-options: -Wall -fno-warn-unused-do-bind hs-source-dirs: tests
lib/CMark/Sections.hs view
@@ -8,10 +8,6 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NoImplicitPrelude #-} -#if __GLASGOW_HASKELL__ == 708-{-# LANGUAGE StandaloneDeriving #-}-#endif- {- | This library lets you parse Markdown into a hierarchical structure (delimited by headings). For instance, let's say your document looks like this:@@ -92,7 +88,12 @@ where +#if !(MIN_VERSION_base(4,11,0))+import BasePrelude hiding ((<>))+import Data.Semigroup+#else import BasePrelude+#endif -- Lenses import Lens.Micro hiding ((&)) -- Text@@ -120,10 +121,13 @@ stripSource :: WithSource a -> a stripSource (WithSource _ x) = x -instance Monoid a => Monoid (WithSource a) where- mempty = WithSource "" mempty- WithSource s1 v1 `mappend` WithSource s2 v2 =+instance Semigroup a => Semigroup (WithSource a) where+ WithSource s1 v1 <> WithSource s2 v2 = WithSource (s1 <> s2) (v1 <> v2)++instance (Monoid a, Semigroup a) => Monoid (WithSource a) where+ mempty = WithSource "" mempty+ mappend = (<>) {- | A section in the Markdown tree.