pandoc-citeproc 0.7.2 → 0.7.3
raw patch · 8 files changed
+52/−38 lines, 8 filesdep ~containersdep ~vectorsetup-changedPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: containers, vector
API changes (from Hackage documentation)
+ Text.CSL.Style: instance Walkable Formatted Formatted
+ Text.CSL.Style: instance Walkable Inline Formatted
Files
- Setup.hs +20/−28
- changelog +12/−0
- pandoc-citeproc.cabal +2/−3
- src/Text/CSL/Eval/Names.hs +2/−1
- src/Text/CSL/Input/Bibtex.hs +1/−1
- src/Text/CSL/Reference.hs +2/−2
- src/Text/CSL/Style.hs +12/−2
- tests/test-citeproc.hs +1/−1
Setup.hs view
@@ -2,43 +2,35 @@ import Distribution.Simple import Distribution.Simple.PreProcess-import Distribution.Simple.Setup- (copyDest, copyVerbosity, fromFlag, installVerbosity, BuildFlags(..))+import Distribution.Simple.InstallDirs (mandir) import Distribution.PackageDescription (PackageDescription(..), Executable(..))-import Distribution.Simple.LocalBuildInfo- (LocalBuildInfo(..), absoluteInstallDirs)-import Distribution.Verbosity ( Verbosity, silent )-import Distribution.Simple.InstallDirs (mandir, CopyDest (NoCopyDest))-import Distribution.Simple.Utils (installOrdinaryFiles, info)-import Prelude hiding (catch) import System.Process ( rawSystem ) import System.FilePath ( (</>) ) import System.Directory ( findExecutable )-import System.Exit+import Distribution.Simple.Utils (info, notice, rawSystemExit, installOrdinaryFiles)+import Distribution.Simple.Setup+import Distribution.Simple.LocalBuildInfo+import Distribution.Verbosity + main :: IO ()-main = do+main = defaultMainWithHooks $ simpleUserHooks {- postCopy = \ _ flags pkg lbi ->- installManpages pkg lbi (fromFlag $ copyVerbosity flags)- (fromFlag $ copyDest flags)- , postInst = \ _ flags pkg lbi ->- installManpages pkg lbi (fromFlag $ installVerbosity flags) NoCopyDest- , hookedPreProcessors = [ppBlobSuffixHandler]+ -- enable hsb2hs preprocessor for .hsb files+ hookedPreProcessors = [ppBlobSuffixHandler]+ , postCopy = installManPage }- exitWith ExitSuccess -manpages :: [FilePath]-manpages = ["man1" </> "pandoc-citeproc.1"]--manDir :: FilePath-manDir = "man"--installManpages :: PackageDescription -> LocalBuildInfo- -> Verbosity -> CopyDest -> IO ()-installManpages pkg lbi verbosity copy =- installOrdinaryFiles verbosity (mandir (absoluteInstallDirs pkg lbi copy))- (zip (repeat manDir) manpages)+installManPage :: Args -> CopyFlags+ -> PackageDescription -> LocalBuildInfo -> IO ()+installManPage _ flags pkg lbi = do+ let verbosity = fromFlag (copyVerbosity flags)+ let copydest = fromFlag (copyDest flags)+ let mandest = mandir (absoluteInstallDirs pkg lbi copydest)+ </> "man1"+ notice verbosity $ "Copying man page to " ++ mandest+ installOrdinaryFiles verbosity mandest+ [("man" </> "man1", "pandoc-citeproc.1")] ppBlobSuffixHandler :: PPSuffixHandler ppBlobSuffixHandler = ("hsb", \_ _ ->
changelog view
@@ -1,3 +1,15 @@+pandoc-citeproc (0.7.3)++ * Add Walkable instances for Formatted (Sean Leather).+ * Allow empty end year in Zotero workaround, e.g. `2005_` (Nick Bart).+ * man/Makefile - removed unnecessary dependency.+ * Fixed test-citeproc.hs for change in `ProcOpts`.+ * Cleaned up Setup.hs. Now takes into account destdir in copying man page.+ * Don’t add space after particles ending with "-" (Nick Bart).+ * Names.hs: Add Unicode “Latin Extended Additional” to isByzantine (Nick+ Bart).+ * Allow vector 0.11.+ pandoc-citeproc (0.7.2) * Added `link-citations` metadata field (#141). If this has a true value,
pandoc-citeproc.cabal view
@@ -1,5 +1,5 @@ name: pandoc-citeproc-version: 0.7.2+version: 0.7.3 cabal-version: >= 1.12 synopsis: Supports using pandoc with citeproc @@ -150,8 +150,7 @@ build-depends: base >= 4, aeson, directory, text, pandoc-types >= 1.12.3, pandoc >= 1.13, filepath, bytestring, pandoc-citeproc, process, temporary >= 1.1,- yaml >= 0.8.8.7, containers >= 0.4 && < 0.6,- vector >= 0.10 && < 0.11+ yaml >= 0.8.8.7, containers >= 0.4, vector >= 0.10 default-language: Haskell98 test-suite test-pandoc-citeproc
src/Text/CSL/Eval/Names.hs view
@@ -301,7 +301,7 @@ -- see src/load.js ROMANESQUE_REGEX in citeproc-js: isByzantine c = not (isLetter c) || c <= '\x5FF' ||- (c >= '\x1f00' && c <= '\x1fff')+ (c >= '\x1e00' && c <= '\x1fff') shortName = oPan' (unFormatted $ nondropping <+> family) (form "family") longName g = if isSorting m then let firstPart = case getOptionVal "demote-non-dropping-particle" ops of@@ -378,6 +378,7 @@ Formatted xs <+> Formatted ys = case lastInline xs of "’" -> Formatted (xs ++ ys)+ "-" -> Formatted (xs ++ ys) _ -> Formatted (xs ++ [Space] ++ ys) (<++>) :: [Output] -> [Output] -> [Output]
src/Text/CSL/Input/Bibtex.hs view
@@ -913,7 +913,7 @@ ("english","variant=us") -> return "american" ("english","variant=usmax") -> return "american" ("english","variant=uk") -> return "british"- ("english","varant=australian") -> return "australian"+ ("english","variant=australian") -> return "australian" ("english","variant=newzealand") -> return "newzealand" (x,_) -> return x hyphenation <- ((toLocale . map toLower) <$>
src/Text/CSL/Reference.hs view
@@ -168,13 +168,13 @@ parseJSON x = parseJSON x >>= mkRefDate -- Zotero doesn't properly support date ranges, so a common--- workaround is 2005_2007; support this as date range:+-- workaround is 2005_2007 or 2005_; support this as date range: handleLiteral :: RefDate -> [RefDate] handleLiteral d@(RefDate (Literal "") (Literal "") (Literal "") (Literal "") (Literal xs) b) = case splitWhen (=='_') xs of [x,y] | all isDigit x && all isDigit y &&- not (null x) && not (null y) ->+ not (null x) -> [RefDate (Literal x) mempty mempty mempty mempty b, RefDate (Literal y) mempty mempty mempty mempty b] _ -> [d]
src/Text/CSL/Style.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE OverloadedStrings, PatternGuards, DeriveDataTypeable, ScopedTypeVariables, FlexibleInstances, DeriveGeneric,- GeneralizedNewtypeDeriving, CPP #-}+ GeneralizedNewtypeDeriving, CPP, MultiParamTypeClasses #-} ----------------------------------------------------------------------------- -- | -- Module : Text.CSL.Style@@ -85,7 +85,7 @@ import Data.String import Data.Monoid (mempty, Monoid, mappend, mconcat, (<>)) import Control.Arrow hiding (left, right)-import Control.Monad (mplus)+import Control.Monad (liftM, mplus) import Control.Applicative hiding (Const) import qualified Data.Aeson as Aeson import Data.Aeson.Types (Pair)@@ -217,6 +217,16 @@ mempty = Formatted [] mappend = appendWithPunct mconcat = foldr mappend mempty++instance Walk.Walkable Inline Formatted where+ walk f = Formatted . Walk.walk f . unFormatted+ walkM f = liftM Formatted . Walk.walkM f . unFormatted+ query f = Walk.query f . unFormatted++instance Walk.Walkable Formatted Formatted where+ walk f = f+ walkM f = f+ query f = f toStr :: String -> [Inline] toStr = intercalate [Str "\n"] .
tests/test-citeproc.hs view
@@ -100,7 +100,7 @@ runTest path = E.handle (handleError path) $ do raw <- BL.readFile path let testCase = either error id $ eitherDecode raw- let procOpts = ProcOpts (testBibopts testCase)+ let procOpts = ProcOpts (testBibopts testCase) False style <- localizeCSL Nothing $ (testCsl testCase) { styleAbbrevs = testAbbreviations testCase } let refs = testReferences testCase