From d2d5eb8a993553eb5d1b9b9ca7863638864dde7e Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 28 Jun 2020 18:23:25 +0200 Subject: Org reader: read `#+INSTITUTE` values as text with markup The value is stored in the `institute` metadata field and used in the default beamer presentation template. --- src/Text/Pandoc/Readers/Org/Meta.hs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/Org/Meta.hs b/src/Text/Pandoc/Readers/Org/Meta.hs index fdb7abe7c..3e77b3f42 100644 --- a/src/Text/Pandoc/Readers/Org/Meta.hs +++ b/src/Text/Pandoc/Readers/Org/Meta.hs @@ -73,20 +73,26 @@ metaKey = T.toLower <$> many1Char (noneOf ": \n\r") exportSettingHandlers :: PandocMonad m => Map Text (OrgParser m ()) exportSettingHandlers = Map.fromList - [ ("result" , fmap pure anyLine `parseThen` discard) -- RESULT is never an export setting - , ("author" , lineOfInlines `parseThen` collectLines "author") - , ("keywords" , lineOfInlines `parseThen` collectLines "keywords") - , ("date" , lineOfInlines `parseThen` setField "date") - , ("description", lineOfInlines `parseThen` collectLines "description") - , ("title" , lineOfInlines `parseThen` collectLines "title") - , ("nocite" , lineOfInlines `parseThen` collectAsList "nocite") + [ ("result" , fmap pure anyLine `parseThen` discard) + -- Common settings + , ("author" , lineOfInlines `parseThen` collectLines "author") + , ("date" , lineOfInlines `parseThen` setField "date") + , ("description", lineOfInlines `parseThen` collectLines "description") + , ("keywords" , lineOfInlines `parseThen` collectLines "keywords") + , ("title" , lineOfInlines `parseThen` collectLines "title") + -- LaTeX , ("latex_class", fmap pure anyLine `parseThen` setField "documentclass") , ("latex_class_options", (pure . T.filter (`notElem` ("[]" :: String)) <$> anyLine) `parseThen` setField "classoption") , ("latex_header", metaExportSnippet "latex" `parseThen` collectAsList "header-includes") + -- HTML , ("html_head" , metaExportSnippet "html" `parseThen` collectAsList "header-includes") + -- pandoc-specific + , ("nocite" , lineOfInlines `parseThen` collectLines "nocite") + , ("header-includes", lineOfInlines `parseThen` collectLines "header-includes") + , ("institute" , lineOfInlines `parseThen` collectLines "institute") ] parseThen :: PandocMonad m -- cgit v1.2.3