git.iko.soy/typeable/pandoc
on master help sign in
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.

commitd2d5eb8a993553eb5d1b9b9ca7863638864dde7e authorAlbert Krewinkel <albert@zeitkraut.de> dateSun 28 Jun 2020, 18:23 (6 years ago) parentb7a8620
3 files changed+22−7
doc/org.md+5 src/Text/Pandoc/Readers/Org/Meta.hs+13−7 test/Tests/Readers/Org/Meta.hs+4
doc/org.md+5
@@ -93,6 +93,11 @@ Pandoc recognizes some export options not used by Emacs Org.
9393- HEADER-INCLUDES: like HTML_HEAD and, LATEX_HEADER, but treats
9494 the option's value as normal text with markup.
9595
96+- INSTITUTE: Affiliation of the author; the value is read as text
97+ with markup and is stored in the `institute` metadata field. The
98+ field is included by default on the title slide of beamer
99+ presentations.
100+
96101
97102Citations
98103=========
src/Text/Pandoc/Readers/Org/Meta.hs+13−7
@@ -73,20 +73,26 @@ metaKey = T.toLower <$> many1Char (noneOf ": \n\r")
7373
7474exportSettingHandlers :: PandocMonad m => Map Text (OrgParser m ())
7575exportSettingHandlers = Map.fromList
76− [ ("result" , fmap pure anyLine `parseThen` discard) -- RESULT is never an export setting
77− , ("author" , lineOfInlines `parseThen` collectLines "author")
78− , ("keywords" , lineOfInlines `parseThen` collectLines "keywords")
79− , ("date" , lineOfInlines `parseThen` setField "date")
80− , ("description", lineOfInlines `parseThen` collectLines "description")
81− , ("title" , lineOfInlines `parseThen` collectLines "title")
82− , ("nocite" , lineOfInlines `parseThen` collectAsList "nocite")
76+ [ ("result" , fmap pure anyLine `parseThen` discard)
77+ -- Common settings
78+ , ("author" , lineOfInlines `parseThen` collectLines "author")
79+ , ("date" , lineOfInlines `parseThen` setField "date")
80+ , ("description", lineOfInlines `parseThen` collectLines "description")
81+ , ("keywords" , lineOfInlines `parseThen` collectLines "keywords")
82+ , ("title" , lineOfInlines `parseThen` collectLines "title")
83+ -- LaTeX
8384 , ("latex_class", fmap pure anyLine `parseThen` setField "documentclass")
8485 , ("latex_class_options", (pure . T.filter (`notElem` ("[]" :: String)) <$> anyLine)
8586 `parseThen` setField "classoption")
8687 , ("latex_header", metaExportSnippet "latex" `parseThen`
8788 collectAsList "header-includes")
89+ -- HTML
8890 , ("html_head" , metaExportSnippet "html" `parseThen`
8991 collectAsList "header-includes")
92+ -- pandoc-specific
93+ , ("nocite" , lineOfInlines `parseThen` collectLines "nocite")
94+ , ("header-includes", lineOfInlines `parseThen` collectLines "header-includes")
95+ , ("institute" , lineOfInlines `parseThen` collectLines "institute")
9096 ]
9197
9298parseThen :: PandocMonad m
test/Tests/Readers/Org/Meta.hs+4
@@ -133,6 +133,10 @@ tests =
133133 inclList = MetaList [MetaInlines (toList html)]
134134 meta = setMeta "header-includes" inclList nullMeta
135135 in Pandoc meta mempty
136+
137+ , "Institute" =:
138+ "#+INSTITUTE: ACME Inc." =?>
139+ Pandoc (setMeta "institute" ("ACME Inc." :: Inlines) nullMeta) mempty
136140 ]
137141
138142 , "Properties drawer" =: