0610f16f7f
Markua is a markdown variant used by Leanpub. More information about Markua can be found at https://leanpub.com/markua/read. Adds a new exported function `writeMarkua` from T.P.Writers.Markdown. [API change] Closes #1871. Co-authored by Tim Wisotzki and Samuel Lemmenmeier.
40 lines
1.2 KiB
Haskell
40 lines
1.2 KiB
Haskell
{-# LANGUAGE OverloadedStrings #-}
|
|
module Tests.Writers.Markua (tests) where
|
|
|
|
import Test.Tasty
|
|
import Tests.Helpers
|
|
import Text.Pandoc
|
|
import Text.Pandoc.Arbitrary ()
|
|
import Text.Pandoc.Builder
|
|
|
|
{-
|
|
"my test" =: X =?> Y
|
|
|
|
is shorthand for
|
|
|
|
test html "my test" $ X =?> Y
|
|
|
|
which is in turn shorthand for
|
|
|
|
test html "my test" (X,Y)
|
|
-}
|
|
|
|
infix 4 =:
|
|
(=:) :: (ToString a, ToPandoc a)
|
|
=> String -> (a, String) -> TestTree
|
|
(=:) = test (purely (writeMarkua def) . toPandoc)
|
|
|
|
tests :: [TestTree]
|
|
tests = [ testGroup "simple blurb/aside"
|
|
["blurb" =: divWith ("",["blurb"],[]) (bulletList [para "blurb content"])
|
|
=?> "B> * blurb content"
|
|
,"aside" =: divWith ("",["aside"],[]) (bulletList [para "aside list"])
|
|
=?> "A> * aside list"
|
|
]
|
|
,testGroup "multiclass blurb/aside"
|
|
["blurb" =: divWith ("",["blurb", "otherclass"],[]) (bulletList [para "blurb content"])
|
|
=?> "B> * blurb content"
|
|
,"aside" =: divWith ("",["otherclass", "aside"],[]) (bulletList [para "aside list"])
|
|
=?> "A> * aside list"
|
|
]
|
|
]
|