Skip to content

Commit

Permalink
Revised parallel citation support
Browse files Browse the repository at this point in the history
  • Loading branch information
fbennett committed Jun 25, 2019
1 parent 47effcd commit e06fe63
Show file tree
Hide file tree
Showing 34 changed files with 1,912 additions and 3,308 deletions.
168 changes: 168 additions & 0 deletions fixtures/local/parallel_Bibliography.txt
@@ -0,0 +1,168 @@
>>===== MODE =====>>
bibliography
<<===== MODE =====<<


>>===== CITATIONS =====>>
[
[
{
"citationID": "CITATION-1",
"citationItems": [
{
"id": "ITEM-3"
},
{
"id": "ITEM-1"
},
{
"id": "ITEM-2"
}
],
"properties": {
"index": 0,
"noteIndex": 1
}
},
[],
[]
]
]
<<===== CITATIONS =====<<

>>===== RESULT =====>>
<div class="csl-bib-body">
<div class="csl-entry">Jim v. Bob, 444 U.S. 400 (1965)</div>
<div class="csl-entry">Smith v. Noakes, 222 U.S. 200, 333 L.Ed. 300 (1965)</div>
</div>
<<===== RESULT =====<<


>>===== CSL =====>>
<style
xmlns="http://purl.org/net/xbiblio/csl"
class="note"
version="1.0">
<info>
<id />
<title />
<updated>2009-08-10T04:49:00+09:00</updated>
</info>
<citation year-suffix-delimiter=", ">
<layout delimiter="; " suffix=".">
<choose>
<if position="first">
<group delimiter=", ">
<text variable="title"/>
<group delimiter=" ">
<text variable="volume"/>
<text variable="container-title"/>
<group>
<text variable="page"/>
<text variable="locator" prefix=", "/>
</group>
<date variable="issued" date-parts="year" form="text" prefix="(" suffix=")"/>
</group>
</group>
</if>
<else-if position="ibid-with-locator">
<text term="ibid"/>
<text variable="locator" prefix=" at "/>
</else-if>
<else-if position="ibid">
<text term="ibid"/>
</else-if>
<else-if position="subsequent">
<group delimiter=", ">
<text variable="title"/>
<group delimiter=" ">
<text variable="volume"/>
<text variable="container-title"/>
<text variable="locator"/>
</group>
</group>
</else-if>
<else>
<text value="WTF?"/>
</else>
</choose>
</layout>
</citation>
<bibliography>
<layout>
<group delimiter=", ">
<group is-parallel="first">
<text variable="title"/>
</group>
<group delimiter=" ">
<text variable="volume"/>
<text variable="container-title"/>
<group>
<text variable="page"/>
<text variable="locator" prefix=", "/>
</group>
<group is-parallel="last">
<date variable="issued" date-parts="year" form="text" prefix="(" suffix=")"/>
</group>
</group>
</group>
</layout>
</bibliography>
</style>
<<===== CSL =====<<


>>===== INPUT =====>>
[
{
"id": "ITEM-1",
"issued": {
"date-parts": [
[
"1965"
]
]
},
"volume" : "222",
"page" : "200",
"title": "Smith v. Noakes",
"container-title": "U.S.",
"jurisdiction": "us",
"type": "legal_case",
"seeAlso": ["ITEM-1", "ITEM-2"]
},
{
"id": "ITEM-2",
"issued": {
"date-parts": [
[
"1965"
]
]
},
"volume" : "333",
"page" : "300",
"title": "Smith v. Noakes",
"container-title": "L.Ed.",
"jurisdiction": "us",
"type": "legal_case",
"seeAlso": ["ITEM-1", "ITEM-2"]
},
{
"id": "ITEM-3",
"issued": {
"date-parts": [
[
"1965"
]
]
},
"volume" : "444",
"page" : "400",
"title": "Jim v. Bob",
"container-title": "U.S.",
"jurisdiction": "us",
"type": "legal_case"
}
]
<<===== INPUT =====<<
205 changes: 205 additions & 0 deletions fixtures/local/parallel_CrossCitationIbidOnInsert.txt
@@ -0,0 +1,205 @@
>>===== MODE =====>>
citation
<<===== MODE =====<<


>>===== RESULT =====>>
>>[0] Doe v. Roe, 12 U.S. 23, 34 L.Ed. 45 (2001)
>>[1] Id. at 78, 34 L.Ed. 89
..[2] Smith v. Jones, 56 U.S. 67 (2002)
<<===== RESULT =====<<


>>===== CITATIONS =====>>
[
[
{
"citationID": "CITATION-1",
"citationItems": [
{
"id": "ITEM-1",
"locator": "78"
},
{
"id": "ITEM-2",
"locator": "89"
}
],
"properties": {
"noteIndex": 1
}
},
[],
[]
],
[
{
"citationID": "CITATION-2",
"citationItems": [
{
"id": "ITEM-3"
}
],
"properties": {
"noteIndex": 2
}
},
[
[
"CITATION-1",
1
]
],
[]
],
[
{
"citationID": "CITATION-3",
"citationItems": [
{
"id": "ITEM-1"
},
{
"id": "ITEM-2"
}
],
"properties": {
"noteIndex": 1
}
},
[],
[
[
"CITATION-1",
2
],
[
"CITATION-2",
3
]
]
]
]
<<===== CITATIONS =====<<



>>===== CSL =====>>
<style
xmlns="http://purl.org/net/xbiblio/csl"
class="note"
version="1.0">
<info>
<id />
<title />
<updated>2009-08-10T04:49:00+09:00</updated>
</info>
<locale xml:lang="en">
<terms>
<term name="ibid">id.</term>
</terms>
</locale>
<citation>
<layout delimiter="; ">
<choose>
<if position="first">
<group delimiter=", ">
<group is-parallel="first">
<text variable="title"/>
</group>
<group delimiter=" ">
<text variable="volume"/>
<text variable="container-title"/>
<text variable="page"/>
<group is-parallel="last">
<date variable="issued" prefix="(" suffix=")">
<date-part name="year"/>
</date>
</group>
</group>
</group>
</if>
<else-if position="ibid-with-locator">
<text term="ibid" suffix=" at "/>
<text variable="locator"/>
</else-if>
<else-if position="ibid">
<text term="ibid"/>
</else-if>
<else-if position="subsequent">
<group delimiter=", ">
<group is-parallel="first">
<text variable="title"/>
</group>
<group delimiter=" ">
<text variable="volume"/>
<text variable="container-title"/>
<choose>
<if variable="locator">
<text variable="locator"/>
</if>
<else>
<text variable="page"/>
</else>
</choose>
</group>
</group>
</else-if>
<else>
<text value="WTF?"/>
</else>
</choose>
</layout>
</citation>
</style>
<<===== CSL =====<<


>>===== INPUT =====>>
[
{
"title": "Doe v. Roe",
"volume": "12",
"container-title": "U.S.",
"page": "23",
"issued": {
"date-parts": [
[2001]
]
},
"id": "ITEM-1",
"jurisdiction": "us",
"type": "legal_case",
"seeAlso": ["ITEM-1", "ITEM-2"]
},
{
"title": "Doe v. Roe",
"volume": "34",
"container-title": "L.Ed.",
"page": "45",
"issued": {
"date-parts": [
[2001]
]
},
"id": "ITEM-2",
"jurisdiction": "us",
"type": "legal_case",
"seeAlso": ["ITEM-1", "ITEM-2"]
},
{
"title": "Smith v. Jones",
"volume": "56",
"container-title": "U.S.",
"page": "67",
"issued": {
"date-parts": [
[2002]
]
},
"id": "ITEM-3",
"jurisdiction": "us",
"type": "legal_case"
}
]
<<===== INPUT =====<<

0 comments on commit e06fe63

Please sign in to comment.