pandoc-citeproc 0.10.1.1 → 0.10.1.2
raw patch · 5 files changed
+62/−26 lines, 5 filesdep ~pandoc-typesdep ~xml-conduitPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: pandoc-types, xml-conduit
API changes (from Hackage documentation)
Files
- changelog +12/−0
- man/man1/pandoc-citeproc.1 +18/−4
- pandoc-citeproc.cabal +6/−6
- src/Text/CSL/Pandoc.hs +17/−11
- stack.yaml +9/−5
changelog view
@@ -1,3 +1,15 @@+pandoc-citeproc (0.10.1.2)++ * Implemented notes-after-punctuation metadata field (#256).+ If this is true (the default), citations rendered as footnotes+ are automatically moved after punctuation. If it is false,+ footnote citations remain before punctuation, but space is still+ collapsed before the notes.+ * Don't require http-client 0.5. This mirrors recent changes to pandoc,+ which allow 0.4.30.x.+ * Allow pandoc-types 1.17.*.+ * Allow xml-conduit 1.4.x (Felix Yan).+ pandoc-citeproc (0.10.1.1) * Clarify that abbreviations require `form="short"` (Nick Bart).
man/man1/pandoc-citeproc.1 view
@@ -1,7 +1,7 @@ .\"t-.\" Automatically generated by Pandoc 1.17.1+.\" Automatically generated by Pandoc 1.17.3 .\"-.TH "pandoc\-citeproc" "1" "2016-07-14" "pandoc-citeproc 0.10" ""+.TH "pandoc\-citeproc" "1" "2016-10-13" "pandoc-citeproc 0.10.1.2" "" .hy .SH NAME .PP@@ -140,7 +140,7 @@ .PP The contents of fields will be interpreted as markdown when appropriate: so, for example, emphasis and strong emphasis can be used in title-fileds.+fields. Simple tex math will also be parsed and rendered appropriately. .RE .TP@@ -170,8 +170,11 @@ \f[C]C:\\Users\\USERNAME\\AppData\\Roaming\\csl\f[] in Windows 7). The format is described here (http://citationstylist.org/2011/10/19/abbreviations-for-zotero-test-release).-Here is a short example:+Abbreviations are only output if, in the \f[C]\&.csl\f[] file,+\f[C]form="short"\f[] is set on the element that renders the variable. .RS+.PP+Here is a short example: .IP .nf \f[C]@@ -213,6 +216,17 @@ If \f[C]reference\-section\-title\f[] is not specified and the document ends with a section header, this final header will be treated as the bibliography header.+.RS+.RE+.TP+.B \f[C]notes\-after\-punctuation\f[]+If true (the default), pandoc will put footnote citations after+following punctuation.+For example, if the source contains \f[C]blah\ blah\ [\@jones99].\f[],+the result will look like \f[C]blah\ blah.[^1]\f[], with the note moved+after the period and the space collapsed.+If false, the space will still be collapsed, but the footnote will not+be moved after the punctuation. .RS .RE .PP
pandoc-citeproc.cabal view
@@ -1,5 +1,5 @@ name: pandoc-citeproc-version: 0.10.1.1+version: 0.10.1.2 cabal-version: >= 1.12 synopsis: Supports using pandoc with citeproc @@ -96,11 +96,11 @@ ghc-prof-options: -fprof-auto-exported build-depends: containers, directory, mtl, bytestring, filepath,- pandoc-types >= 1.16 && < 1.17,+ pandoc-types >= 1.16 && < 1.18, pandoc >= 1.16 && < 1.18, tagsoup, aeson >= 0.7 && < 1.1, text, vector,- xml-conduit >= 1.2 && < 1.4,+ xml-conduit >= 1.2 && < 1.5, unordered-containers >= 0.2 && < 0.3, data-default, setenv >= 0.1 && < 0.2,@@ -145,7 +145,7 @@ ghc-options: -funbox-strict-fields -Wall ghc-prof-options: -fprof-auto-exported -rtsopts build-depends: base >= 4, pandoc-citeproc,- pandoc-types >= 1.16 && < 1.17,+ pandoc-types >= 1.16 && < 1.18, pandoc >= 1.16 && < 1.18, aeson, aeson-pretty >= 0.8, yaml, bytestring, syb, attoparsec, text,@@ -167,7 +167,7 @@ else Buildable: False build-depends: base >= 4, aeson, directory, text,- pandoc-types >= 1.16 && < 1.17,+ pandoc-types >= 1.16 && < 1.18, pandoc >= 1.16 && < 1.18, filepath, bytestring, pandoc-citeproc, process, temporary >= 1.1,@@ -181,7 +181,7 @@ Prelude Hs-Source-Dirs: tests, prelude build-depends: base >= 4, aeson, directory, text,- pandoc-types >= 1.16 && < 1.17,+ pandoc-types >= 1.16 && < 1.18, pandoc >= 1.16 && < 1.18, filepath, bytestring, pandoc-citeproc, process, temporary >= 1.1, yaml >= 0.8.8.7
src/Text/CSL/Pandoc.hs view
@@ -49,7 +49,10 @@ map (map (toCslCite locMap)) grps) cits_map = tr' "cits_map" $ M.fromList $ zip grps (citations result) biblioList = map (renderPandoc' style) $ zip (bibliography result) (citationIds result)- Pandoc m3 bs = bottomUp (mvPunct style) . deNote .+ moveNotes = case lookupMeta "notes-after-punctuation" m1 of+ Just (MetaBool False) -> False+ _ -> True+ Pandoc m3 bs = bottomUp (mvPunct moveNotes style) . deNote . topDown (processCite style cits_map) $ Pandoc m2 b2 m = case metanocites of Nothing -> m3@@ -262,22 +265,25 @@ isSpacy SoftBreak = True isSpacy _ = False -mvPunct :: Style -> [Inline] -> [Inline]-mvPunct _ (x : Space : xs) | isSpacy x = x : xs-mvPunct _ (s : x : ys) | isSpacy s, isNote x, startWithPunct ys =- Str (headInline ys) : x : tailFirstInlineStr ys-mvPunct _ (Cite cs ils : ys) |+mvPunct :: Bool -> Style -> [Inline] -> [Inline]+mvPunct _ _ (x : Space : xs) | isSpacy x = x : xs+mvPunct moveNotes _ (s : x : ys) | isSpacy s, isNote x, startWithPunct ys =+ if moveNotes+ then Str (headInline ys) : x : tailFirstInlineStr ys+ else x : ys+mvPunct moveNotes _ (Cite cs ils : ys) | length ils > 1 , isNote (last ils) , startWithPunct ys+ , moveNotes = Cite cs (init ils ++ [Str (headInline ys) | not (endWithPunct False (init ils))] ++ [last ils]) : tailFirstInlineStr ys-mvPunct sty (q@(Quoted _ _) : w@(Str _) : x : ys)- | isNote x, isPunctuationInQuote sty =+mvPunct moveNotes sty (q@(Quoted _ _) : w@(Str _) : x : ys)+ | isNote x, isPunctuationInQuote sty, moveNotes = mvPunctInsideQuote q w ++ (x : ys)-mvPunct _ (s : x : ys) | isSpacy s, isNote x = x : ys-mvPunct _ (s : x@(Cite _ (Superscript _ : _)) : ys) | isSpacy s = x : ys-mvPunct _ xs = xs+mvPunct _ _ (s : x : ys) | isSpacy s, isNote x = x : ys+mvPunct _ _ (s : x@(Cite _ (Superscript _ : _)) : ys) | isSpacy s = x : ys+mvPunct _ _ xs = xs endWithPunct :: Bool -> [Inline] -> Bool endWithPunct _ [] = True
stack.yaml view
@@ -7,9 +7,13 @@ debug: false packages: - '.'-- '../pandoc'-- '../pandoc-types'+- location:+ git: https://github.com/jgm/pandoc-types.git+ commit: 485eb11e9869fcd4c1ca9bcd68d3ccd384230252+- location:+ git: https://github.com/jgm/pandoc.git+ commit: 6156cdda13ee5f9edbb11a672f6eb78631c3ffc5 extra-deps:-- 'http-client-0.5.0'-- 'http-client-tls-0.3.0'-resolver: lts-7.0+- texmath-0.8.6.6+- doctemplates-0.1.0.2+resolver: lts-7.2