From 2661658a696ebaab14b2792b7bbd38ef2b5904e4 Mon Sep 17 00:00:00 2001 From: Francesco Occhipinti Date: Wed, 1 Aug 2018 21:32:16 +0200 Subject: RST writer: use `titleblock` instead of `title` variable for title block Closes #4803 After this commit use `$titleblock$` in order to get what was contained in `$title$` before, that is a title and subtitle rendered according to the official rST method: http://docutils.sourceforge.net/docs/user/rst/quickstart.html#document-title-subtitle. from With this commit, the `$title$` and `$subtitle$` metadata are available and they simply carry the metadata values. This opens up more possibilities in templates. --- test/Tests/Writers/RST.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/Tests/Writers') diff --git a/test/Tests/Writers/RST.hs b/test/Tests/Writers/RST.hs index a1a4510e0..0d5b7c38a 100644 --- a/test/Tests/Writers/RST.hs +++ b/test/Tests/Writers/RST.hs @@ -16,6 +16,11 @@ infix 4 =: => String -> (a, String) -> TestTree (=:) = test (purely (writeRST def . toPandoc)) +testTemplate :: (ToString a, ToString c, ToPandoc a) => + String -> String -> (a, c) -> TestTree +testTemplate t = + test (purely (writeRST def{ writerTemplate = Just t }) . toPandoc) + tests :: [TestTree] tests = [ testGroup "rubrics" [ "in list item" =: @@ -156,4 +161,7 @@ tests = [ testGroup "rubrics" , "Header 2" , "--------"] ] + , testTemplate "$subtitle$\n" "subtitle" $ + (setMeta "subtitle" ("subtitle" :: Inlines) $ doc $ plain "") =?> + ("subtitle" :: String) ] -- cgit v1.2.3