diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2020-06-29 16:43:27 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2020-06-29 17:03:33 +0200 |
commit | d17b257c89624ceea6bd319caa22aa25e95fb5e9 (patch) | |
tree | 47e3091488105ab70f49e904c5238e7d2fb3392d | |
parent | 11dc9f84f54650037c60917435fd91a90f94f9cf (diff) | |
download | pandoc-d17b257c89624ceea6bd319caa22aa25e95fb5e9.tar.gz |
Org reader: allow multiple #+SUBTITLE export settings
The values of all lines are read as inlines and collected in the
`subtitle` metadata field.
-rw-r--r-- | doc/org.md | 5 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Org/Meta.hs | 1 | ||||
-rw-r--r-- | test/Tests/Readers/Org/Meta.hs | 7 |
3 files changed, 12 insertions, 1 deletions
diff --git a/doc/org.md b/doc/org.md index b65782107..d117d09dc 100644 --- a/doc/org.md +++ b/doc/org.md @@ -51,7 +51,7 @@ occur. Pandoc follows the LaTeX exporter in that it allows markup in the description. In contrast, the Org-mode HTML exporter treats - reads the description as plain text. + the description as plain text. - LATEX_HEADER: arbitrary lines to add to the document's preamble. Contrary to Org-mode, these lines are not inserted before the @@ -74,6 +74,9 @@ occur. - SUBTITLE: the document's subtitle; fully supported. + The content of this option is stored as inlines in the + `subtitle` metadata field. + - HTML_HEAD: arbitrary lines to add to the HTML document's head; fully supported. diff --git a/src/Text/Pandoc/Readers/Org/Meta.hs b/src/Text/Pandoc/Readers/Org/Meta.hs index 3e77b3f42..c922403df 100644 --- a/src/Text/Pandoc/Readers/Org/Meta.hs +++ b/src/Text/Pandoc/Readers/Org/Meta.hs @@ -79,6 +79,7 @@ exportSettingHandlers = Map.fromList , ("date" , lineOfInlines `parseThen` setField "date") , ("description", lineOfInlines `parseThen` collectLines "description") , ("keywords" , lineOfInlines `parseThen` collectLines "keywords") + , ("subtitle" , lineOfInlines `parseThen` collectLines "subtitle") , ("title" , lineOfInlines `parseThen` collectLines "title") -- LaTeX , ("latex_class", fmap pure anyLine `parseThen` setField "documentclass") diff --git a/test/Tests/Readers/Org/Meta.hs b/test/Tests/Readers/Org/Meta.hs index c811f2363..89cd35b26 100644 --- a/test/Tests/Readers/Org/Meta.hs +++ b/test/Tests/Readers/Org/Meta.hs @@ -93,6 +93,13 @@ tests = in Pandoc meta mempty ] + , "Subtitle" =: + T.unlines [ "#+SUBTITLE: Your Life in" + , "#+SUBTITLE: /Plain/ Text" + ] =?> + let subtitle = "Your Life in" <> softbreak <> emph "Plain" <> " Text" + in Pandoc (setMeta "subtitle" (toMetaValue subtitle) nullMeta) mempty + , "Keywords" =: T.unlines [ "#+KEYWORDS: pandoc, testing," , "#+KEYWORDS: Org" |