diff options
author | Francesco Occhipinti <focchi.pinti@gmail.com> | 2018-08-01 21:32:16 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-08-01 12:32:16 -0700 |
commit | 2661658a696ebaab14b2792b7bbd38ef2b5904e4 (patch) | |
tree | c964cc0b8a4e4c441cb4648f89b1db7b198bcc59 /test | |
parent | 08694efd89dccaebbb663d44bfa7787df3755545 (diff) | |
download | pandoc-2661658a696ebaab14b2792b7bbd38ef2b5904e4.tar.gz |
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.
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Writers/RST.hs | 8 |
1 files changed, 8 insertions, 0 deletions
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) ] |