Skip to content

Instantly share code, notes, and snippets.

@zepinglee
Created October 7, 2023 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zepinglee/4a3a2de7e671a1d8cff86897b75b3b84 to your computer and use it in GitHub Desktop.
Save zepinglee/4a3a2de7e671a1d8cff86897b75b3b84 to your computer and use it in GitHub Desktop.
Sorting citation items by year-suffix
>>===== MODE =====>>
citation
<<===== MODE =====<<
>>===== RESULT =====>>
>>[0] (Nietzsche 1988a, 1988b)
<<===== RESULT =====<<
>>===== CITATIONS =====>>
[
[
{
"citationID": "CITATION-1",
"citationItems": [
{
"id": "ITEM-1"
},
{
"id": "ITEM-2"
}
],
"properties": {
"noteIndex": 0
}
},
[],
[]
]
]
<<===== CITATIONS =====<<
>>===== CSL =====>>
<style
xmlns="http://purl.org/net/xbiblio/csl"
class="in-text"
version="1.0">
<info>
<id />
<title />
<updated>2023-10-07T22:51:24+08:00</updated>
</info>
<macro name="author">
<names variable="author"/>
</macro>
<macro name="author-short">
<names variable="author">
<name form="short"/>
</names>
</macro>
<macro name="date">
<date variable="issued">
<date-part name="year"/>
</date>
<text variable="year-suffix"/>
</macro>
<citation disambiguate-add-year-suffix="true" collapse="year">
<sort>
<key macro="author-short"/>
<key macro="date"/>
</sort>
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=" ">
<text macro="author-short"/>
<text macro="date"/>
</group>
</layout>
</citation>
<bibliography>
<sort>
<key macro="author"/>
<key macro="date"/>
<key variable="title"/>
</sort>
<layout>
<group delimiter=". ">
<text macro="author"/>
<text macro="date"/>
<text variable="title"/>
</group>
</layout>
</bibliography>
</style>
<<===== CSL =====<<
>>===== INPUT =====>>
[
{
"id": "ITEM-1",
"type": "book",
"author": [
{
"family": "Nietzsche",
"given": "Friedrich"
}
],
"issued": {
"date-parts": [
[
1988
]
]
},
"title": "Title B of ITEM-1"
},
{
"id": "ITEM-2",
"type": "book",
"author": [
{
"family": "Nietzsche",
"given": "Friedrich"
}
],
"issued": {
"date-parts": [
[
1988
]
]
},
"title": "Title A of ITEM-2"
}
]
<<===== INPUT =====<<
>>===== VERSION =====>>
1.0
<<===== VERSION =====<<
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment