summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnMacFarlane <>2020-08-02 06:10:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2020-08-02 06:10:00 (GMT)
commit7ebdb1de3ba00a367376fd6c371e87f8b886721a (patch)
treea26e4805727a43136f313ad9caa737a2bbd9ec7f
parentf90bafea252b141f269b496b7807978178cf85cf (diff)
version 0.17.0.2HEAD0.17.0.2master
-rw-r--r--changelog5
-rw-r--r--chicago-author-date.csl14
-rw-r--r--locales/locales-nb-NO.xml2
-rw-r--r--locales/locales-nl-NL.xml8
-rw-r--r--locales/locales-nn-NO.xml2
-rw-r--r--locales/locales-sl-SI.xml4
-rw-r--r--pandoc-citeproc.cabal4
-rw-r--r--src/Text/CSL/Style.hs35
-rw-r--r--stack.yaml7
9 files changed, 47 insertions, 34 deletions
diff --git a/changelog b/changelog
index cd46f18..04a38c3 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,8 @@
+pandoc-citeproc (0.17.0.2)
+
+ * Update to use latest rfc5051.
+ * Update chicago-author-date.csl and locales.
+
pandoc-citeproc (0.17.0.1)
* Allow aeson 1.5 (#452, Felix Yan).
diff --git a/chicago-author-date.csl b/chicago-author-date.csl
index 32d0cab..9f126b3 100644
--- a/chicago-author-date.csl
+++ b/chicago-author-date.csl
@@ -27,6 +27,9 @@
<email>matthew.g.roth@yale.edu</email>
<uri> https://orcid.org/0000-0001-7902-6331</uri>
</contributor>
+ <contributor>
+ <name>Brenton M. Wiernik</name>
+ </contributor>
<category citation-format="author-date"/>
<category field="generic-base"/>
<summary>The author-date variant of the Chicago style</summary>
@@ -509,8 +512,15 @@
</choose>
</macro>
<macro name="event">
- <group>
- <text term="presented at" suffix=" "/>
+ <group delimiter=" ">
+ <choose>
+ <if variable="genre">
+ <text term="presented at"/>
+ </if>
+ <else>
+ <text term="presented at" text-case="capitalize-first"/>
+ </else>
+ </choose>
<text variable="event"/>
</group>
</macro>
diff --git a/locales/locales-nb-NO.xml b/locales/locales-nb-NO.xml
index 7e86f93..b0ae7f0 100644
--- a/locales/locales-nb-NO.xml
+++ b/locales/locales-nb-NO.xml
@@ -45,7 +45,7 @@
<term name="interview">intervju</term>
<term name="letter">brev</term>
<term name="no date">ingen dato</term>
- <term name="no date" form="short">udatert</term>
+ <term name="no date" form="short">u.å.</term>
<term name="online">online</term>
<term name="presented at">presentert på</term>
<term name="reference">
diff --git a/locales/locales-nl-NL.xml b/locales/locales-nl-NL.xml
index 1146f4a..f8b63c3 100644
--- a/locales/locales-nl-NL.xml
+++ b/locales/locales-nl-NL.xml
@@ -66,10 +66,10 @@
<term name="bc">BC</term>
<!-- PUNCTUATION -->
- <term name="open-quote">“</term>
- <term name="close-quote">”</term>
- <term name="open-inner-quote">‘</term>
- <term name="close-inner-quote">’</term>
+ <term name="open-quote">‘</term>
+ <term name="close-quote">’</term>
+ <term name="open-inner-quote">“</term>
+ <term name="close-inner-quote">”</term>
<term name="page-range-delimiter">–</term>
<!-- ORDINALS -->
diff --git a/locales/locales-nn-NO.xml b/locales/locales-nn-NO.xml
index 060b121..8702c94 100644
--- a/locales/locales-nn-NO.xml
+++ b/locales/locales-nn-NO.xml
@@ -45,7 +45,7 @@
<term name="interview">intervju</term>
<term name="letter">brev</term>
<term name="no date">ingen dato</term>
- <term name="no date" form="short">udatert</term>
+ <term name="no date" form="short">u.å.</term>
<term name="online">online</term>
<term name="presented at">presentert på</term>
<term name="reference">
diff --git a/locales/locales-sl-SI.xml b/locales/locales-sl-SI.xml
index a0957c8..5eb2f3c 100644
--- a/locales/locales-sl-SI.xml
+++ b/locales/locales-sl-SI.xml
@@ -14,7 +14,7 @@
<date form="text">
<date-part name="day" form="numeric" suffix=". "/>
<date-part name="month" suffix=" "/>
- <date-part name="year" suffix="."/>
+ <date-part name="year"/>
</date>
<date form="numeric">
<date-part name="day" form="numeric" suffix=". "/>
@@ -40,7 +40,7 @@
<term name="edition" form="short">izd.</term>
<term name="et-al">idr.</term>
<term name="forthcoming">pred izidom</term>
- <term name="from">od</term>
+ <term name="from">s</term>
<term name="ibid">isto</term>
<term name="in">v</term>
<term name="in press">v tisku</term>
diff --git a/pandoc-citeproc.cabal b/pandoc-citeproc.cabal
index cc0e0c4..8b4360c 100644
--- a/pandoc-citeproc.cabal
+++ b/pandoc-citeproc.cabal
@@ -1,6 +1,6 @@
cabal-version: 1.12
name: pandoc-citeproc
-version: 0.17.0.1
+version: 0.17.0.2
synopsis: Supports using pandoc with citeproc
description: The pandoc-citeproc library supports automatic
@@ -151,7 +151,7 @@ library
build-depends: text, text-icu
cpp-options: -DUNICODE_COLLATION
else
- build-depends: rfc5051
+ build-depends: rfc5051 >= 0.2 && < 0.3
executable pandoc-citeproc
main-is: pandoc-citeproc.hs
diff --git a/src/Text/CSL/Style.hs b/src/Text/CSL/Style.hs
index 9c52d35..b54527c 100644
--- a/src/Text/CSL/Style.hs
+++ b/src/Text/CSL/Style.hs
@@ -101,7 +101,7 @@ import Control.Monad (mplus)
import Data.Aeson hiding (Number)
import qualified Data.Aeson as Aeson
import Data.Aeson.Types (Pair)
-import Data.Char (isLetter, isPunctuation, isUpper, toLower, isDigit)
+import Data.Char (isLetter, isPunctuation, isUpper, isDigit)
import qualified Data.Char as Char
import Data.Generics (Data, Typeable)
import Data.List (intercalate, intersperse, nubBy)
@@ -110,7 +110,6 @@ import qualified Data.Map as M
import Data.Maybe (listToMaybe, isNothing)
import Data.String
import Data.Text (Text)
-import qualified Data.Text as T
import Data.Yaml.Builder (ToYaml (..))
import qualified Data.Yaml.Builder as Y
import GHC.Generics (Generic)
@@ -126,8 +125,8 @@ import Text.Pandoc.Definition hiding (Citation, Cite)
import qualified Text.Pandoc.Walk as Walk
import Text.Pandoc.XML (fromEntities)
-#ifdef UNICODE_COLLATION
import qualified Data.Text as T
+#ifdef UNICODE_COLLATION
import qualified Data.Text.ICU as T
#else
import Data.RFC5051 (compareUnicode)
@@ -486,32 +485,28 @@ instance Ord Sorting where
compare _ _ = EQ
compare' :: Text -> Text -> Ordering
-compare' x' y'
- = case (x, y) of
- ('-':_,'-':_) -> comp (normalize y) (normalize x)
- ('-':_, _ ) -> LT
- (_ ,'-':_) -> GT
- _ -> comp (normalize x) (normalize y)
+compare' x y
+ = case (T.uncons x, T.uncons y) of
+ (Just ('-',_), Just ('-',_)) -> comp (normalize y) (normalize x)
+ (Just ('-',_), _) -> LT
+ (_ ,Just ('-',_)) -> GT
+ _ -> comp (normalize x) (normalize y)
where
- -- FIXME: to Text
- x = T.unpack x'
- y = T.unpack y'
-- we zero pad numbers so they're sorted numerically, see #399
- zeropad [] = []
- zeropad xs = if all isDigit xs
- then replicate (10 - length xs) '0' ++ xs
- else xs
+ zeropad t = if T.all isDigit t
+ then T.replicate (10 - T.length t) "0" <> t
+ else t
normalize = zeropad .
- map (\c -> if c == ',' || c == '.' then ' ' else c) .
- filter (\c -> c == ',' ||
+ T.map (\c -> if c == ',' || c == '.' then ' ' else c) .
+ T.filter (\c -> c == ',' ||
not (isPunctuation c || Char.isSpace c
-- ayn/hamza in transliterated arabic:
|| c == 'ʾ' || c == 'ʿ'
))
#ifdef UNICODE_COLLATION
- comp a b = T.collate (T.collator T.Current) (T.pack a) (T.pack b)
+ comp a b = T.collate (T.collator T.Current) a b
#else
- comp a b = compareUnicode (map toLower a) (map toLower b)
+ comp a b = compareUnicode a b
#endif
data Form
diff --git a/stack.yaml b/stack.yaml
index 987a810..d8a27e3 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -22,9 +22,12 @@ extra-deps:
- HsYAML-0.2.1.0
- HsYAML-aeson-0.2.0.0
- doctemplates-0.8.2
+- commonmark-0.1.0.1
+- commonmark-extensions-0.2.0.1
+- commonmark-pandoc-0.2.0.0
- pandoc-types-1.21
-- git: 'https://github.com/jgm/pandoc'
- commit: 9672ff827194ddf5565351b2fdde942c03942b2d
+- rfc5051-0.2
+- pandoc-2.10.1
ghc-options:
"$locals": -fhide-source-paths