Org reader: allow multiple #+SUBTITLE export settings

The values of all lines are read as inlines and collected in the
`subtitle` metadata field.
This commit is contained in:
Albert Krewinkel 2020-06-29 16:43:27 +02:00
parent 11dc9f84f5
commit d17b257c89
No known key found for this signature in database
GPG key ID: 388DC0B21F631124
3 changed files with 12 additions and 1 deletions

View file

@ -51,7 +51,7 @@ occur.
Pandoc follows the LaTeX exporter in that it allows markup in Pandoc follows the LaTeX exporter in that it allows markup in
the description. In contrast, the Org-mode HTML exporter treats 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. - LATEX_HEADER: arbitrary lines to add to the document's preamble.
Contrary to Org-mode, these lines are not inserted before the Contrary to Org-mode, these lines are not inserted before the
@ -74,6 +74,9 @@ occur.
- SUBTITLE: the document's subtitle; fully supported. - 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; - HTML_HEAD: arbitrary lines to add to the HTML document's head;
fully supported. fully supported.

View file

@ -79,6 +79,7 @@ exportSettingHandlers = Map.fromList
, ("date" , lineOfInlines `parseThen` setField "date") , ("date" , lineOfInlines `parseThen` setField "date")
, ("description", lineOfInlines `parseThen` collectLines "description") , ("description", lineOfInlines `parseThen` collectLines "description")
, ("keywords" , lineOfInlines `parseThen` collectLines "keywords") , ("keywords" , lineOfInlines `parseThen` collectLines "keywords")
, ("subtitle" , lineOfInlines `parseThen` collectLines "subtitle")
, ("title" , lineOfInlines `parseThen` collectLines "title") , ("title" , lineOfInlines `parseThen` collectLines "title")
-- LaTeX -- LaTeX
, ("latex_class", fmap pure anyLine `parseThen` setField "documentclass") , ("latex_class", fmap pure anyLine `parseThen` setField "documentclass")

View file

@ -93,6 +93,13 @@ tests =
in Pandoc meta mempty 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" =: , "Keywords" =:
T.unlines [ "#+KEYWORDS: pandoc, testing," T.unlines [ "#+KEYWORDS: pandoc, testing,"
, "#+KEYWORDS: Org" , "#+KEYWORDS: Org"