aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/org.md5
-rw-r--r--src/Text/Pandoc/Readers/Org/Meta.hs20
-rw-r--r--test/Tests/Readers/Org/Meta.hs4
3 files changed, 22 insertions, 7 deletions
diff --git a/doc/org.md b/doc/org.md
index 9d8ffea8b..8e147c5a9 100644
--- a/doc/org.md
+++ b/doc/org.md
@@ -93,6 +93,11 @@ Pandoc recognizes some export options not used by Emacs Org.
- HEADER-INCLUDES: like HTML_HEAD and, LATEX_HEADER, but treats
the option's value as normal text with markup.
+- INSTITUTE: Affiliation of the author; the value is read as text
+ with markup and is stored in the `institute` metadata field. The
+ field is included by default on the title slide of beamer
+ presentations.
+
Citations
=========
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
diff --git a/test/Tests/Readers/Org/Meta.hs b/test/Tests/Readers/Org/Meta.hs
index 3852e676d..c811f2363 100644
--- a/test/Tests/Readers/Org/Meta.hs
+++ b/test/Tests/Readers/Org/Meta.hs
@@ -133,6 +133,10 @@ tests =
inclList = MetaList [MetaInlines (toList html)]
meta = setMeta "header-includes" inclList nullMeta
in Pandoc meta mempty
+
+ , "Institute" =:
+ "#+INSTITUTE: ACME Inc." =?>
+ Pandoc (setMeta "institute" ("ACME Inc." :: Inlines) nullMeta) mempty
]
, "Properties drawer" =: