packages feed

citeproc 0.3.0.8 → 0.3.0.9

raw patch · 6 files changed

+29/−13 lines, 6 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # citeproc changelog +## 0.3.0.9++ * Implement `et-al-subsequent-min` and `et-al-subsequent-use-first` (#60).+ ## 0.3.0.8   * In parsing abbreviations JSON, ignore top-level fields
citeproc.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.2 name:                citeproc-version:             0.3.0.8+version:             0.3.0.9 synopsis:            Generates citations and bibliography from CSL styles. description:         citeproc parses CSL style files and uses them to                      generate a list of formatted citations and bibliography
man/citeproc.1 view
@@ -1,6 +1,6 @@-.\" Automatically generated by Pandoc 2.11.4+.\" Automatically generated by Pandoc 2.12 .\"-.TH "citeproc" "1" "" "citeproc 0.3.0.7" ""+.TH "citeproc" "1" "" "citeproc 0.3.0.9" "" .hy .SH NAME .PP
src/Citeproc/Eval.hs view
@@ -43,6 +43,7 @@   , contextPosition            :: [Position]   , contextInSubstitute        :: Bool   , contextInSortKey           :: Bool+  , contextInBibliography      :: Bool   , contextSubstituteNamesForm :: Maybe NamesFormat   }   deriving (Show)@@ -101,6 +102,7 @@       , contextPosition            = []       , contextInSubstitute        = False       , contextInSortKey           = False+      , contextInBibliography      = False       , contextSubstituteNamesForm = Nothing       }       EvalState@@ -277,7 +279,9 @@       -- of year suffixes added in disambiguation)       bs <- case styleBibliography style of                Just biblayout-                 -> mapM (evalLayout True biblayout) (zip [1..] bibCitations)+                 -> local (\context ->+                             context{ contextInBibliography = True }) $+                    mapM (evalLayout biblayout) (zip [1..] bibCitations)                     >>= \bs ->                       case styleSubsequentAuthorSubstitute                             (styleOptions style) of@@ -467,7 +471,7 @@   withRWST (\ctx st -> (ctx,                         st { stateLastCitedMap = mempty                            , stateNoteMap = mempty })) $-     mapM (evalLayout False (styleCitation style)) (zip [1..] citations)+     mapM (evalLayout (styleCitation style)) (zip [1..] citations)   where @@ -981,11 +985,10 @@   evalLayout :: CiteprocOutput a-            => Bool-            -> Layout a+            => Layout a             -> (Int, Citation a)             -> Eval a (Output a)-evalLayout isBibliography layout (citationGroupNumber, citation) = do+evalLayout layout (citationGroupNumber, citation) = do   -- this is a hack to ensure that "ibid" detection will work   -- correctly in a citation starting with an author-only:   -- the combination AuthorOnly [SuppressAuthor] should not@@ -1025,6 +1028,8 @@   secondFieldAlign [] = []    evalItem' (positionInCitation :: Int, item) = do+    isBibliography  <- asks contextInBibliography+     styleOpts <- asks contextStyleOptions     let isNote = styleIsNoteStyle styleOpts     position <- getPosition citationGroupNumber (citationNoteNumber citation)@@ -1889,6 +1894,14 @@             -> Eval a (Output a) formatNames namesFormat nameFormat formatting (var, Just (NamesVal names)) =   do+  isSubsequent <- (Subsequent `elem`) <$> asks contextPosition+  isInBibliography <- asks contextInBibliography+  let (etAlMin, etAlUseFirst) =+        if not isInBibliography && isSubsequent+           then (nameEtAlSubsequentMin nameFormat <|> nameEtAlMin nameFormat,+                 nameEtAlSubsequentUseFirst nameFormat <|>+                    nameEtAlUseFirst nameFormat)+           else (nameEtAlMin nameFormat, nameEtAlUseFirst nameFormat)   inSortKey <- asks contextInSortKey   disamb <- gets (referenceDisambiguation . stateReference)   names' <- zipWithM (formatName nameFormat formatting) [1..] names@@ -1917,10 +1930,9 @@                                                    , termForm = Long }                   Nothing -> return Nothing   let etAlUseLast = nameEtAlUseLast nameFormat-  let etAlThreshold = case nameEtAlMin nameFormat of+  let etAlThreshold = case etAlMin of                         Just x | numnames >= x-                          -> case (disamb >>= disambEtAlNames,-                                    nameEtAlUseFirst nameFormat) of+                          -> case (disamb >>= disambEtAlNames, etAlUseFirst) of                                (Just n, Just m) -> Just (max m n)                                (_, y) -> y                         _ -> Nothing
stack.yaml view
@@ -2,7 +2,7 @@   citeproc:     executable: true     icu: false-resolver: lts-15.14+resolver: lts-17.5 extra-deps: - rfc5051-0.2 - pandoc-types-1.22
test/Spec.hs view
@@ -318,7 +318,7 @@                (length (skipped counts))   case length (failed counts) + length (errored counts) of     0 -> exitSuccess-    n | n <= 67 -> do+    n | n <= 66 -> do          putStrLn "We have passed all the CSL tests we expect to..."          exitSuccess       | otherwise -> exitWith $ ExitFailure n