pandoc-citeproc 0.10.1.4 → 0.10.2
raw patch · 5 files changed
+20/−207 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- changelog +4/−0
- pandoc-citeproc.cabal +1/−1
- src/Text/CSL/Eval/Output.hs +8/−1
- src/Text/CSL/Output/Pandoc.hs +7/−1
- tests/isme.csl +0/−204
changelog view
@@ -1,3 +1,7 @@+pandoc-citeproc (0.10.2)++ * Use linebreaks to simulate display="block" (#85, #261).+ pandoc-citeproc (0.10.1.4) * Use finer grained Pandoc import statements (Albert Krewinkel).
pandoc-citeproc.cabal view
@@ -1,5 +1,5 @@ name: pandoc-citeproc-version: 0.10.1.4+version: 0.10.2 cabal-version: >= 1.12 synopsis: Supports using pandoc with citeproc
src/Text/CSL/Eval/Output.hs view
@@ -131,7 +131,7 @@ addFormatting :: Formatting -> Formatted -> Formatted addFormatting f =- addLink . addSuffix . pref . quote . font . text_case . strip_periods+ addDisplay . addLink . addSuffix . pref . quote . font . text_case . strip_periods where addLink i = case hyperlink f of "" -> i url -> Formatted [Link nullAttr (unFormatted i) (url, "")]@@ -156,6 +156,13 @@ NativeQuote -> Formatted [Span ("",["csl-inquote"],[]) ils] _ -> Formatted [Quoted DoubleQuote $ valign ils]++ addDisplay (Formatted []) = Formatted []+ addDisplay (Formatted ils) =+ case display f of+ "block" -> Formatted (LineBreak : ils +++ [LineBreak])+ _ -> Formatted ils font (Formatted ils) | noDecor f = Formatted [Span ("",["nodecor"],[]) ils]
src/Text/CSL/Output/Pandoc.hs view
@@ -33,7 +33,13 @@ renderPandoc :: Style -> Formatted -> [Inline] renderPandoc sty- = proc (convertQuoted sty) . proc' (clean' sty) . flipFlop . unFormatted+ = proc (convertQuoted sty) . proc' (clean' sty) . flipFlop .+ fixBreaks . unFormatted++-- remove leading/trailing LineBreak+fixBreaks :: [Inline] -> [Inline]+fixBreaks =+ dropWhile (== LineBreak) . reverse . dropWhile (== LineBreak) . reverse renderPandoc' :: Style -> (Formatted, String) -> Block renderPandoc' sty (form, citId) = Div ("ref-" ++ citId, [], []) [Para $ renderPandoc sty form]
− tests/isme.csl
@@ -1,204 +0,0 @@-<?xml version="1.0" encoding="utf-8"?>-<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-GB">- <info>- <title>The ISME Journal</title>- <id>http://www.zotero.org/styles/the-isme-journal</id>- <link href="http://www.zotero.org/styles/the-isme-journal" rel="self"/>- <link href="http://mts-isme.nature.com/cgi-bin/main.plex?form_type=display_auth_instructions" rel="documentation"/>- <author>- <name>Jessica Leigh</name>- <email>blackwednesday@gmail.com</email>- </author>- <category citation-format="author-date"/>- <category field="biology"/>- <issn>1751-7362</issn>- <eissn>1751-7370</eissn>- <summary>The ISME Journal style, which is not the same as for Nature</summary>- <updated>2014-12-02T15:48:05+00:00</updated>- <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>- </info>- <macro name="editor">- <names variable="editor">- <name and="symbol" delimiter=", " name-as-sort-order="all" sort-separator=", " initialize-with="">- <name-part name="family" text-case="capitalize-first"/>- <name-part name="given" text-case="capitalize-first"/>- </name>- <label form="short" prefix=" (" strip-periods="true" suffix=")"/>- </names>- </macro>- <macro name="series-editor">- <names variable="original-author">- <label form="short" text-case="capitalize-first" suffix=" "/>- <name and="symbol" delimiter=", "/>- </names>- </macro>- <macro name="author">- <names variable="author">- <name name-as-sort-order="all" sort-separator=" " delimiter=", " delimiter-precedes-last="always" initialize-with=""/>- <label form="short" prefix=" (" strip-periods="true" suffix=")"/>- <et-al font-style="italic"/>- <substitute>- <names variable="editor"/>- <names variable="translator"/>- </substitute>- </names>- </macro>- <macro name="author-short">- <names variable="author">- <name form="short" and="text" delimiter=", " delimiter-precedes-last="never"/>- <et-al font-style="italic"/>- <substitute>- <names variable="editor"/>- <names variable="translator"/>- </substitute>- </names>- </macro>- <macro name="access">- <choose>- <if variable="page" match="none">- <choose>- <if variable="DOI">- <text variable="DOI" prefix="doi:"/>- </if>- <else-if variable="URL">- <text variable="URL"/>- <group prefix=" (" suffix=")">- <text term="accessed" text-case="capitalize-first" suffix=" "/>- <date variable="accessed">- <date-part name="month" suffix=" "/>- <date-part name="day" suffix=", "/>- <date-part name="year"/>- </date>- </group>- </else-if>- </choose>- </if>- </choose>- </macro>- <macro name="title">- <choose>- <if type="thesis">- <text variable="title"/>- </if>- <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">- <text variable="title"/>- </else-if>- <else>- <text variable="title"/>- </else>- </choose>- </macro>- <macro name="publisher">- <group delimiter=": ">- <text variable="publisher"/>- <text variable="publisher-place"/>- </group>- </macro>- <macro name="year-date">- <date variable="issued">- <date-part name="year"/>- </date>- </macro>- <macro name="day-month">- <date variable="issued">- <date-part name="month"/>- <date-part name="day" prefix=" "/>- </date>- </macro>- <macro name="page">- <label variable="page" suffix=" " form="short"/>- <text variable="page"/>- </macro>- <macro name="edition">- <choose>- <if is-numeric="edition">- <group delimiter=" ">- <number variable="edition" form="ordinal"/>- <text term="edition" form="short"/>- </group>- </if>- <else>- <text variable="edition" suffix="."/>- </else>- </choose>- </macro>- <citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" collapse="year">- <layout prefix="(" suffix=")" delimiter="; ">- <group delimiter=", ">- <text macro="author-short"/>- <text macro="year-date"/>- <text variable="locator"/>- </group>- </layout>- </citation>- <bibliography hanging-indent="false" et-al-min="7" et-al-use-first="2">- <sort>- <key macro="author"/>- <key variable="title"/>- </sort>- <layout suffix=".">- <group delimiter=" ">- <text macro="author" suffix="."/>- <text macro="year-date" prefix="(" suffix=")."/>- </group>- <choose>- <if type="article-newspaper article-magazine" match="any">- <group delimiter=" ">- <text macro="title" prefix=" " suffix="."/>- </group>- <group prefix=" " delimiter=", ">- <text variable="container-title"/>- <text macro="day-month"/>- <text variable="edition"/>- </group>- </if>- <else-if type="thesis">- <text macro="title" prefix=" " suffix="."/>- <group prefix=" " delimiter=", ">- <text macro="edition"/>- <text macro="editor" suffix="."/>- <text variable="genre"/>- <text macro="publisher"/>- </group>- </else-if>- <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">- <group delimiter=" ">- <text macro="title" prefix=" " suffix="."/>- <text macro="edition"/>- <text macro="publisher"/>- </group>- </else-if>- <else-if type="chapter paper-conference" match="any">- <group delimiter=" ">- <text macro="title" prefix=" " suffix="."/>- <group prefix="In:" delimiter=", " suffix=".">- <text variable="container-title" font-style="italic"/>- <group delimiter=" ">- <text macro="editor" prefix=" "/>- <text variable="collection-title"/>- <text variable="volume" prefix="Vol. "/>- <text macro="series-editor"/>- </group>- <text macro="publisher" prefix=" "/>- <text macro="page" prefix=" "/>- </group>- </group>- </else-if>- <else>- <group suffix=".">- <text macro="title" prefix=" "/>- <text macro="editor" prefix=" "/>- </group>- <group prefix=" " suffix="." delimiter=" ">- <text variable="container-title" form="short" strip-periods="true" font-style="italic"/>- <group delimiter=":">- <text variable="volume" font-weight="bold"/>- <text variable="page"/>- </group>- </group>- </else>- </choose>- <text prefix=" " macro="access" suffix="."/>- </layout>- </bibliography>-</style>