git.iko.soy/typeable/pandoc
on master help sign in
Org reader: allow multiple #+SUBTITLE export settings

The values of all lines are read as inlines and collected in the `subtitle` metadata field.

commit3ce7112c540b38c868ec3aa744801278914e2e98 authorAlbert Krewinkel <albert@zeitkraut.de> dateMon 29 Jun 2020, 16:43 (6 years ago) parent34e54d3
3 files changed+12−1
doc/org.md+4−1 src/Text/Pandoc/Readers/Org/Meta.hs+1 test/Tests/Readers/Org/Meta.hs+7
doc/org.md+4−1
@@ -51,7 +51,7 @@ occur.
5151
5252 Pandoc follows the LaTeX exporter in that it allows markup in
5353 the description. In contrast, the Org-mode HTML exporter treats
54− reads the description as plain text.
54+ the description as plain text.
5555
5656- LATEX_HEADER: arbitrary lines to add to the document's preamble.
5757 Contrary to Org-mode, these lines are not inserted before the
@@ -74,6 +74,9 @@ occur.
7474
7575- SUBTITLE: the document's subtitle; fully supported.
7676
77+ The content of this option is stored as inlines in the
78+ `subtitle` metadata field.
79+
7780- HTML_HEAD: arbitrary lines to add to the HTML document's head;
7881 fully supported.
7982
src/Text/Pandoc/Readers/Org/Meta.hs+1
@@ -79,6 +79,7 @@ exportSettingHandlers = Map.fromList
7979 , ("date" , lineOfInlines `parseThen` setField "date")
8080 , ("description", lineOfInlines `parseThen` collectLines "description")
8181 , ("keywords" , lineOfInlines `parseThen` collectLines "keywords")
82+ , ("subtitle" , lineOfInlines `parseThen` collectLines "subtitle")
8283 , ("title" , lineOfInlines `parseThen` collectLines "title")
8384 -- LaTeX
8485 , ("latex_class", fmap pure anyLine `parseThen` setField "documentclass")
test/Tests/Readers/Org/Meta.hs+7
@@ -93,6 +93,13 @@ tests =
9393 in Pandoc meta mempty
9494 ]
9595
96+ , "Subtitle" =:
97+ T.unlines [ "#+SUBTITLE: Your Life in"
98+ , "#+SUBTITLE: /Plain/ Text"
99+ ] =?>
100+ let subtitle = "Your Life in" <> softbreak <> emph "Plain" <> " Text"
101+ in Pandoc (setMeta "subtitle" (toMetaValue subtitle) nullMeta) mempty
102+
96103 , "Keywords" =:
97104 T.unlines [ "#+KEYWORDS: pandoc, testing,"
98105 , "#+KEYWORDS: Org"