From bc3f16b0c18e0f04a3e9d3e162f57f8e86cadead Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Thu, 29 Oct 2020 15:54:50 -0700
Subject: [PATCH] Allow citation-abbreviations in defaults file.

---
 MANUAL.txt                 | 1 +
 src/Text/Pandoc/App/Opt.hs | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/MANUAL.txt b/MANUAL.txt
index 796431114..7ac314b62 100644
--- a/MANUAL.txt
+++ b/MANUAL.txt
@@ -1533,6 +1533,7 @@ csl: ieee
 bibliography:
 - foobar.bib
 - barbaz.json
+citation-abbreviations: abbrevs.json
 
 # Filters will be assumed to be Lua filters if they have
 # the .lua extension, and json filters otherwise.  But
diff --git a/src/Text/Pandoc/App/Opt.hs b/src/Text/Pandoc/App/Opt.hs
index 3da6a936b..64c61fb74 100644
--- a/src/Text/Pandoc/App/Opt.hs
+++ b/src/Text/Pandoc/App/Opt.hs
@@ -367,6 +367,11 @@ doOpt (k',v) = do
                                                     foldr addItem o xs)
           <|>
           (parseYAML v >>= \(x :: Text) -> return $ \o -> addItem x o)
+    "citation-abbreviations" ->
+      parseYAML v >>= \x ->
+             return (\o -> o{ optMetadata =
+                                addMeta "citation-abbreviations" (T.unpack x)
+                                  (optMetadata o) })
     "ipynb-output" ->
       parseYAML v >>= \x -> return (\o -> o{ optIpynbOutput = x })
     "include-before-body" ->