From 6802934307e7b36c2d2fb83974da93d99bbf42ac Mon Sep 17 00:00:00 2001 From: +merlan #flirora Date: Tue, 28 May 2024 12:04:54 -0400 Subject: [PATCH 01/11] Update preset styles --- archive/styles/cell.cbor | 4 ++-- archive/styles/chicago-author-date.cbor | Bin 21194 -> 21372 bytes archive/styles/copernicus-publications.cbor | 2 +- ...odern-humanities-research-association.cbor | 2 +- src/csl/archive.rs | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/archive/styles/cell.cbor b/archive/styles/cell.cbor index ce96c019..1ba17c71 100644 --- a/archive/styles/cell.cbor +++ b/archive/styles/cell.cbor @@ -1,2 +1,2 @@ -�dinfo�fauthor��dnameiAdam Markeemailra.mark@uoguelph.cakcontributor��dnamemJulian Onionseemailwjulian.onions@gmail.com�dnametAurimas Vinckeviciuseemailuaurimas.dev@gmail.comhcategory��p@citation-formatgnumeric�f@fieldgbiologyefield�bidx!http://www.zotero.org/styles/celldissn�i0092-8674eeissni1097-4172dlink��e@hrefx!http://www.zotero.org/styles/celld@reldself�e@hrefx!https://www.cell.com/cell/authorsd@relmdocumentationfrights�e$textxQThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Licenseh@licensex.http://creativecommons.org/licenses/by-sa/3.0/gsummary�f$valuexfThe Cell journal style, switched to numeric superscript as per the Cell editorial office in Sept. 2022etitle�f$valuedCellgupdated�e$textx2022-09-23T22:06:38+00:00o@default-localeeen-USh@versionc1.0hcitation�dsort�ckey��i@variableocitation-numbere@sortiascendingflayout�f$value��dtext�i@variableocitation-numbere@formdlongg@quotes�n@strip-periods��o@vertical-aligncsupj@delimitera,x@disambiguate-add-givenname�x@givenname-disambiguation-rulegby-citew@disambiguate-add-names�x@disambiguate-add-year-suffix�i@collapseocitation-numbers@near-note-distance�lbibliography�dsort�ckey��i@variableocitation-numbere@sortiascendingflayout�f$value��dtext�i@variableocitation-numbere@formdlongg@suffixa.g@quotes�n@strip-periods���dtext�f@macrofauthorg@quotes�n@strip-periods���ddate�i@variablefissuedidate-part��e@namedyearn@strip-periods��g@prefixb (g@suffixb).��fchoose�bif�e@type�dbilldbookggraphicjlegal_caseklegislationnmotion_picturefreportdsongf@matchcanyf$value��egroup�f$value��dtext�f@macroetitleg@quotes�n@strip-periods���dtext�f@macrogeditiong@quotes�n@strip-periods���dtext�f@macrofeditorg@quotes�n@strip-periods���dtext�f@macroipublisherg@quotes�n@strip-periods��g@prefixa j@delimitera gelse-if��e@type�gchapterppaper-conferencef@matchcanyf$value��egroup�f$value��dtext�f@macroetitleg@suffixa.g@quotes�n@strip-periods���dtext�e@termbine@formdlongg@plural�g@quotes�n@strip-periods�j@text-casepcapitalize-first��dtext�i@variableocontainer-titlee@formdlongg@quotes�n@strip-periods���dtext�i@variablepcollection-titlee@formdlongg@suffixa.g@quotes�n@strip-periods��g@prefixa j@delimitera �dtext�f@macrofeditorg@prefixb, g@quotes�n@strip-periods���egroup�f$value��dtext�f@macroipublisherg@prefixa g@quotes�n@strip-periods���egroup�f$value��elabel�i@variabledpagee@formeshortg@pluraljcontextualg@suffixa n@strip-periods���dtext�i@variabledpagee@formdlongg@quotes�n@strip-periods��g@prefixb, g@suffixa.�e@type�garticlef@matchcallf$value��dtext�f@macroetitleg@prefixa g@quotes�n@strip-periods���dtext�e@termgarticlee@formdlongg@plural�g@prefixb. g@quotes�n@strip-periods�j@text-casepcapitalize-first��dtext�i@variableipublishere@formdlongg@prefixd at g@quotes�n@strip-periods���dtext�f@macrofaccessg@prefixb, g@quotes�n@strip-periods���e@type�gdatasethsoftwaref@matchcanyf$value��egroup�f$value��dtext�f@macroetitleg@quotes�n@strip-periods���egroup�f$value��egroup�f$value��dtext�e@termgversione@formdlongg@plural�g@quotes�n@strip-periods�j@text-casepcapitalize-first��dtext�i@variablegversione@formdlongg@quotes�n@strip-periods��j@delimitera �dtext�i@variableipublishere@formdlongg@prefixa(g@suffixa)g@quotes�n@strip-periods��j@delimitera �dtext�f@macrofaccessg@quotes�n@strip-periods��g@prefixa j@delimiterb. delse�f$value��dtext�f@macroetitleg@prefixa g@suffixa.g@quotes�n@strip-periods���egroup�f$value��egroup�f$value��dtext�i@variableocontainer-titlee@formeshortg@quotes�n@strip-periods���dtext�i@variablefvolumee@formdlongk@font-stylefitalicg@quotes�n@strip-periods��j@delimitera �dtext�i@variabledpagee@formdlongg@quotes�n@strip-periods��g@prefixa g@suffixa.j@delimiterb, �dtext�f@macrofaccessg@prefixa g@quotes�n@strip-periods��g@suffixa.o@hanging-indent�s@second-field-aligneflushm@line-spacingn@entry-spacingx"@subsequent-author-substitute-rulelcomplete-allj@et-al-min p@et-al-use-first -�f@classgin-textw@initialize-with-hyphen�r@page-range-formathexpandedx@demote-non-dropping-particleisort-onlyemacro��e@namefeditorf$value��enames�i@variable�feditorf$value��dname�j@delimiterb, iname-part�d@anddtextp@initialize-withb. ��elabel�e@formeshortg@pluraljcontextualg@prefixb, n@strip-periods��j@delimiterb, �e@namefauthorf$value��enames�i@variable�fauthorf$value��dname�j@delimiterb, iname-part�d@anddtextx@delimiter-precedes-lastfalwaysp@initialize-witha.s@name-as-sort-ordercallo@sort-separatorb, ��elabel�e@formeshortg@pluraljcontextualg@prefixa n@strip-periods���jsubstitute�f$value��enames�i@variable�feditorf$value��dtext�i@variableetitlee@formdlongg@quotes�n@strip-periods���e@namefaccessf$value��fchoose�bif�i@variable�cDOIf@matchcanyf$value��dtext�i@variablecDOIe@formdlongg@quotes�n@strip-periods��gelse-if��e@type�gwebpagegdatasetpentry-dictionaryrentry-encyclopediadpostkpost-weblogf@matchcanyf$value��dtext�i@variablecURLe@formdlongg@quotes�n@strip-periods���e@nameetitlef$value��dtext�i@variableetitlee@formdlongg@quotes�n@strip-periods���e@nameipublisherf$value��dtext�i@variableipublishere@formdlongg@prefixa(g@suffixa)g@quotes�n@strip-periods���e@namegeditionf$value��fchoose�bif�k@is-numeric�geditionf@matchcallf$value��egroup�f$value��fnumber�i@variablegeditione@formgordinal��dtext�e@termgeditione@formeshortg@plural�g@quotes�n@strip-periods��j@delimitera gelse-if�delse�f$value��dtext�i@variablegeditione@formdlongg@suffixa.g@quotes�n@strip-periods��flocale�� \ No newline at end of file +�dinfo�fauthor��dnameiAdam Markeemailra.mark@uoguelph.cakcontributor��dnamemJulian Onionseemailwjulian.onions@gmail.com�dnametAurimas Vinckeviciuseemailuaurimas.dev@gmail.com�dnameoPatrick O'Brienhcategory��p@citation-formatgnumeric�f@fieldgbiologyefield�bidx!http://www.zotero.org/styles/celldissn�i0092-8674eeissni1097-4172dlink��e@hrefx!http://www.zotero.org/styles/celld@reldself�e@hrefx!https://www.cell.com/cell/authorsd@relmdocumentationfrights�e$textxQThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Licenseh@licensex.http://creativecommons.org/licenses/by-sa/3.0/gsummary�f$valuexfThe Cell journal style, switched to numeric superscript as per the Cell editorial office in Sept. 2022etitle�f$valuedCellgupdated�e$textx2024-03-28T09:46:58+00:00o@default-localeeen-USh@versionc1.0hcitation�dsort�ckey��i@variableocitation-numbere@sortiascendingflayout�f$value��dtext�i@variableocitation-numbere@formdlongg@quotes�n@strip-periods��o@vertical-aligncsupj@delimitera,x@disambiguate-add-givenname�x@givenname-disambiguation-rulegby-citew@disambiguate-add-names�x@disambiguate-add-year-suffix�i@collapseocitation-numbers@near-note-distance�lbibliography�dsort�ckey��i@variableocitation-numbere@sortiascendingflayout�f$value��dtext�i@variableocitation-numbere@formdlongg@suffixa.g@quotes�n@strip-periods���dtext�f@macrofauthorg@quotes�n@strip-periods���ddate�i@variablefissuedidate-part��e@namedyearn@strip-periods��g@prefixb (g@suffixb).��fchoose�bif�e@type�dbilldbookggraphicjlegal_caseklegislationnmotion_picturefreportdsongf@matchcanyf$value��egroup�f$value��dtext�f@macroetitleg@quotes�n@strip-periods���dtext�f@macrogeditiong@quotes�n@strip-periods���dtext�f@macrofeditorg@quotes�n@strip-periods���dtext�f@macroipublisherg@quotes�n@strip-periods��g@prefixa j@delimitera gelse-if��e@type�gchapterppaper-conferencef@matchcanyf$value��egroup�f$value��dtext�f@macroetitleg@suffixa.g@quotes�n@strip-periods���dtext�e@termbine@formdlongg@plural�g@quotes�n@strip-periods�j@text-casepcapitalize-first��dtext�i@variableocontainer-titlee@formdlongg@quotes�n@strip-periods���dtext�i@variablepcollection-titlee@formdlongg@suffixa.g@quotes�n@strip-periods��g@prefixa j@delimitera �dtext�f@macrofeditorg@prefixb, g@quotes�n@strip-periods���egroup�f$value��dtext�f@macroipublisherg@prefixa g@quotes�n@strip-periods���egroup�f$value��elabel�i@variabledpagee@formeshortg@pluraljcontextualg@suffixa n@strip-periods���dtext�i@variabledpagee@formdlongg@quotes�n@strip-periods��g@prefixb, g@suffixa.�e@type�garticlef@matchcallf$value��dtext�f@macroetitleg@prefixa g@quotes�n@strip-periods���dtext�e@termgarticlee@formdlongg@plural�g@prefixb. g@quotes�n@strip-periods�j@text-casepcapitalize-first��dtext�i@variableipublishere@formdlongg@prefixd at g@quotes�n@strip-periods���dtext�f@macrofaccessg@prefixb, g@quotes�n@strip-periods���e@type�gdatasethsoftwaref@matchcanyf$value��egroup�f$value��dtext�f@macroetitleg@quotes�n@strip-periods���egroup�f$value��egroup�f$value��dtext�e@termgversione@formdlongg@plural�g@quotes�n@strip-periods�j@text-casepcapitalize-first��dtext�i@variablegversione@formdlongg@quotes�n@strip-periods��j@delimitera �dtext�i@variableipublishere@formdlongg@prefixa(g@suffixa)g@quotes�n@strip-periods��j@delimitera �dtext�f@macrofaccessg@quotes�n@strip-periods��g@prefixa j@delimiterb. delse�f$value��dtext�f@macroetitleg@prefixa g@suffixa.g@quotes�n@strip-periods���egroup�f$value��egroup�f$value��dtext�i@variableocontainer-titlee@formeshortg@quotes�n@strip-periods���dtext�i@variablefvolumee@formdlongk@font-stylefitalicg@quotes�n@strip-periods��j@delimitera �dtext�i@variabledpagee@formdlongg@quotes�n@strip-periods��g@prefixa g@suffixa.j@delimiterb, �dtext�f@macrofaccessg@prefixa g@quotes�n@strip-periods��g@suffixa.o@hanging-indent�s@second-field-aligneflushm@line-spacingn@entry-spacingx"@subsequent-author-substitute-rulelcomplete-allj@et-al-min p@et-al-use-first +�f@classgin-textw@initialize-with-hyphen�r@page-range-formathexpandedx@demote-non-dropping-particleisort-onlyemacro��e@namefeditorf$value��enames�i@variable�feditorf$value��dname�j@delimiterb, iname-part�d@anddtextp@initialize-withb. ��elabel�e@formeshortg@pluraljcontextualg@prefixb, n@strip-periods��j@delimiterb, �e@namefauthorf$value��enames�i@variable�fauthorf$value��dname�j@delimiterb, iname-part�d@anddtextx@delimiter-precedes-lastfalwaysp@initialize-witha.s@name-as-sort-ordercallo@sort-separatorb, ��elabel�e@formeshortg@pluraljcontextualg@prefixa n@strip-periods���jsubstitute�f$value��enames�i@variable�feditorf$value��dtext�i@variableetitlee@formdlongg@quotes�n@strip-periods���e@namefaccessf$value��fchoose�bif�i@variable�cDOIf@matchcanyf$value��dtext�i@variablecDOIe@formdlongg@prefixphttps://doi.org/g@quotes�n@strip-periods��gelse-if��e@type�gwebpagegdatasetpentry-dictionaryrentry-encyclopediadpostkpost-weblogf@matchcanyf$value��dtext�i@variablecURLe@formdlongg@quotes�n@strip-periods���e@nameetitlef$value��dtext�i@variableetitlee@formdlongg@quotes�n@strip-periods���e@nameipublisherf$value��dtext�i@variableipublishere@formdlongg@prefixa(g@suffixa)g@quotes�n@strip-periods���e@namegeditionf$value��fchoose�bif�k@is-numeric�geditionf@matchcallf$value��egroup�f$value��fnumber�i@variablegeditione@formgordinal��dtext�e@termgeditione@formeshortg@plural�g@quotes�n@strip-periods��j@delimitera gelse-if�delse�f$value��dtext�i@variablegeditione@formdlongg@suffixa.g@quotes�n@strip-periods��flocale�� \ No newline at end of file diff --git a/archive/styles/chicago-author-date.cbor b/archive/styles/chicago-author-date.cbor index 17145bf3105d3f887a163b51a575b4a3146b88cb..59f8fd54143a29089d2e6509e0d2b4bfeca723b3 100644 GIT binary patch delta 115 zcmX@Ll=06p#tFWRZ5#dU7_}Frg@quotes�n@strip-periods��gelse-if�delse�f$value��fchoose�bif�i@variable�cURLf@matchcallf$value��dtext�i@variablecURLe@formdlongg@prefixb g@quotes�n@strip-periods���egroup�f$value��dtext�e@termhaccessede@formdlongg@plural�g@quotes�n@strip-periods���ddate�i@variablehaccessedidate-part��e@namecdayg@prefixa n@strip-periods���e@nameemonthg@prefixa n@strip-periods���e@namedyearg@prefixa n@strip-periods���g@prefixb [g@suffixa]gelse-if��e@namegartworkf$value��fchoose�bif�e@type�ggraphicf@matchcanyf$value��egroup�f$value��dtext�i@variablefmediume@formdlongg@quotes�n@strip-periods���dtext�i@variablejdimensionse@formdlongg@quotes�n@strip-periods��j@delimiterb, gelse-if�flocale��e@langbeneterms�dterm��e@nameeet-ale$textjand otherse@formdlong�e@namefeditore$textfed. bye@formjverb-short�e@namegeditione$textcedne@formeshort�e@namejtranslatore$textitrans. bye@formjverb-short�e@nameefoliofsingledfol.hmultipledfolse@formdlongddate�� \ No newline at end of file +�dinfo�fauthor��dnamelRintze Zellecurixhttp://twitter.com/rintzezellekcontributor��dnameqSebastian Karcher�dnamenAndrew Dunningcurix%https://orcid.org/0000-0003-0464-5036�dnameoPatrick O'Brienhcategory��p@citation-formatdnote�f@fieldlgeneric-baseefield�bidxChttp://www.zotero.org/styles/modern-humanities-research-associationdissn�dlink��e@hrefxChttp://www.zotero.org/styles/modern-humanities-research-associationd@reldself�e@hrefxChttp://www.mhra.org.uk/Publications/Books/StyleGuide/download.shtmld@relmdocumentationfrights�e$textxQThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Licenseh@licensex.http://creativecommons.org/licenses/by-sa/3.0/gsummary�f$valuex,MHRA format with full notes and bibliographyetitle�f$valuexKModern Humanities Research Association 4th edition (note with bibliography)ktitle-short�f$valuedMHRAgupdated�e$textx2024-04-08T08:14:12+00:00o@default-localeeen-GBh@versionc1.0hcitation�flayout�f$value��fchoose�bif�i@position�jsubsequentf@matchcallf$value��egroup�f$value��dtext�f@macrorcontributors-shortg@quotes�n@strip-periods���dtext�f@macroldisambiguateg@quotes�n@strip-periods���dtext�f@macrovlocators-specific-noteg@quotes�n@strip-periods��j@delimiterb, �dtext�f@macroxpoint-locators-subsequentg@quotes�n@strip-periods��gelse-if�delse�f$value��egroup�f$value��dtext�f@macroqcontributors-noteg@quotes�n@strip-periods���dtext�f@macrojtitle-noteg@quotes�n@strip-periods���dtext�f@macroxsecondary-contributors-noteg@quotes�n@strip-periods���dtext�f@macrotcontainer-title-noteg@quotes�n@strip-periods���dtext�f@macroxcontainer-contributors-noteg@quotes�n@strip-periods���dtext�f@macropcollection-titleg@quotes�n@strip-periods���dtext�f@macromlocators-noteg@quotes�n@strip-periods��j@delimiterb, �dtext�f@macrojissue-noteg@quotes�n@strip-periods���dtext�f@macrovlocators-specific-noteg@prefixb, g@quotes�n@strip-periods���dtext�f@macrorlocators-newspaperg@prefixb, g@quotes�n@strip-periods���dtext�f@macronpoint-locatorsg@quotes�n@strip-periods���dtext�f@macrokaccess-noteg@quotes�n@strip-periods��g@suffixa.j@delimiterb; x@disambiguate-add-givenname�x@givenname-disambiguation-rulegby-citew@disambiguate-add-names�x@disambiguate-add-year-suffix�s@near-note-distancej@et-al-minp@et-al-use-first�lbibliography�dsort�ckey��f@macrofauthore@sortiascending�i@variableetitlee@sortiascendingflayout�f$value��egroup�f$value��dtext�f@macrofauthorg@quotes�n@strip-periods���dtext�f@macrojtitle-noteg@quotes�n@strip-periods���dtext�f@macroxsecondary-contributors-noteg@quotes�n@strip-periods���dtext�f@macrotcontainer-title-noteg@quotes�n@strip-periods���dtext�f@macroxcontainer-contributors-noteg@quotes�n@strip-periods���dtext�f@macropcollection-titleg@quotes�n@strip-periods���dtext�f@macrofvolumeg@quotes�n@strip-periods��j@delimiterb, �dtext�f@macrojissue-noteg@quotes�n@strip-periods���dtext�f@macrovlocators-specific-noteg@prefixb, g@quotes�n@strip-periods���dtext�f@macrogartworkg@prefixb, g@quotes�n@strip-periods���dtext�f@macrorlocators-newspaperg@prefixb, g@quotes�n@strip-periods���dtext�f@macroepagesg@quotes�n@strip-periods���dtext�f@macrokaccess-noteg@quotes�n@strip-periods��o@hanging-indent�m@line-spacingn@entry-spacingx@subsequent-author-substitutei———x"@subsequent-author-substitute-rulelcomplete-allj@et-al-minp@et-al-use-first�f@classdnotew@initialize-with-hyphen�r@page-range-formatjchicago-15x@demote-non-dropping-particleisort-onlyemacro��e@namefauthorf$value��egroup�f$value��enames�i@variable�fauthorf$value��dname�j@delimiterb, iname-part�d@anddtextx@delimiter-precedes-lastfalwayss@name-as-sort-orderefirsto@sort-separatorb, ��elabel�e@formeshortg@pluraljcontextualg@prefixb, g@suffixa.n@strip-periods���jsubstitute�f$value��enames�i@variable�feditorf$value��enames�i@variable�jtranslatorf$value��dtext�f@macrojtitle-noteg@quotes�n@strip-periods���dtext�f@macroirecipientg@quotes�n@strip-periods��j@delimiterb. �e@nameirecipientf$value��egroup�f$value��fchoose�bif�e@type�vpersonal_communicationf@matchcallf$value��fchoose�bif�i@variable�egenref@matchcallf$value��dtext�i@variableegenree@formdlongg@quotes�n@strip-periods�j@text-casepcapitalize-first�gelse-if�delse�f$value��dtext�e@termflettere@formdlongg@plural�g@quotes�n@strip-periods�j@text-casepcapitalize-first�gelse-if��dtext�f@macronrecipient-noteg@quotes�n@strip-periods��j@delimitera �e@nameqcontributors-notef$value��enames�i@variable�fauthorf$value��dname�j@delimiterb, iname-part�d@anddtexto@sort-separatorb, ��elabel�e@formeshortg@pluraljcontextualg@prefixb, n@strip-periods���jsubstitute�f$value��dtext�f@macrojtitle-noteg@quotes�n@strip-periods���dtext�f@macronrecipient-noteg@quotes�n@strip-periods���e@namejtitle-notef$value��fchoose�bif�i@variable�etitlef@matchdnonef$value��dtext�i@variableegenree@formdlongg@quotes�n@strip-periods��gelse-if��e@type�dbilldbookggraphicklegislationnmotion_picturefreportdsongf@matchcanyf$value��dtext�i@variableetitlee@formdlongk@font-stylefitalicg@quotes�n@strip-periods�j@text-caseetitle��egroup�f$value��dtext�e@termgversione@formdlongg@plural�g@quotes�n@strip-periods���dtext�i@variablegversione@formdlongg@quotes�n@strip-periods��g@prefixb, j@delimitera �e@type�jlegal_caseiinterviewf@matchcanyf$value��dtext�i@variableetitlee@formdlongg@quotes�n@strip-periods���i@variable�oreviewed-authorf@matchcallf$value��dtext�i@variableetitlee@formdlongk@font-stylefitalicg@prefixjreview of g@quotes�n@strip-periods��delse�f$value��dtext�i@variableetitlee@formdlongg@quotes�n@strip-periods�j@text-caseetitle��e@nameldisambiguatef$value��fchoose�bif�m@disambiguate�f@matchcallf$value��fchoose�bif�i@variable�etitlef@matchdnonef$value��dtext�f@macrofissuedg@quotes�n@strip-periods��gelse-if��e@type�dbilldbookggraphicjlegal_caseklegislationnmotion_picturefreportdsongf@matchcanyf$value��dtext�i@variableetitlee@formeshortk@font-stylefitalicg@quotes�n@strip-periods�j@text-caseetitle�delse�f$value��dtext�i@variableetitlee@formeshortg@quotes�n@strip-periods�j@text-caseetitle�gelse-if��e@nameutitle-sort-substitutef$value��fchoose�bif�e@type�dbilldbookggraphicjlegal_caseklegislationnmotion_picturefreportdsongf@matchcanyf$value��dtext�i@variableetitlee@formeshortk@font-stylefitalicg@quotes�n@strip-periods�j@text-caseetitle�gelse-if�delse�f$value��dtext�i@variableetitlee@formeshortg@quotes�n@strip-periods�j@text-caseetitle��e@nameqeditor-translatorf$value��egroup�f$value��egroup�f$value��fchoose�bif�i@variable�pcontainer-authororeviewed-authorf@matchcanyf$value��egroup�f$value��enames�i@variable�pcontainer-authororeviewed-authorf$value��elabel�e@formjverb-shortg@pluraljcontextualg@suffixa j@text-caseilowercasen@strip-periods���dname�j@delimiterb, iname-part�d@anddtext�gelse-if�j@delimitera �enames�i@variable�feditorjtranslatorhdirectorf$value��elabel�e@formjverb-shortg@pluraljcontextualg@suffixa j@text-caseilowercasen@strip-periods���dname�j@delimiterb, iname-part�d@anddtext�j@delimiterb, j@delimiterb, �e@namexsecondary-contributors-notef$value��fchoose�bif�e@type�gchapterppaper-conferencef@matchdnonef$value��dtext�f@macroqeditor-translatorg@quotes�n@strip-periods��gelse-if��e@namexcontainer-contributors-notef$value��fchoose�bif�e@type�gchapterppaper-conferencef@matchcanyf$value��dtext�f@macroqeditor-translatorg@quotes�n@strip-periods��gelse-if��e@namepcollection-titlef$value��egroup�f$value��fchoose�bif�e@type�oarticle-journalf@matchcallf$value��dtext�i@variablepcollection-titlee@formdlongg@quotes�n@strip-periods���dtext�i@variableqcollection-numbere@formdlongg@quotes�n@strip-periods��gelse-if�delse�f$value��dtext�i@variablepcollection-titlee@formdlongg@quotes�n@strip-periods�j@text-caseetitle��dtext�i@variableqcollection-numbere@formdlongg@quotes�n@strip-periods��j@delimiterb, �e@namemlocators-notef$value��fchoose�bif�e@type�oarticle-journalf@matchcallf$value��egroup�f$value��dtext�i@variablefvolumee@formdlongg@quotes�n@strip-periods���dtext�i@variableeissuee@formdlongg@quotes�n@strip-periods��j@delimitera.gelse-if��e@type�dbilldbookgchapterggraphicjlegal_caseklegislationnmotion_pictureppaper-conferencefreportdsongf@matchcanyf$value��egroup�f$value��dtext�f@macroledition-noteg@quotes�n@strip-periods���egroup�f$value��fnumber�i@variableqnumber-of-volumese@formgnumeric��dtext�e@termfvolumee@formeshortg@plural�g@prefixa g@quotes�n@strip-periods��j@delimiterb, �e@namefvolumef$value��fchoose�bif�e@type�oarticle-journalf@matchcallf$value��egroup�f$value��dtext�i@variablefvolumee@formdlongg@quotes�n@strip-periods���dtext�i@variableeissuee@formdlongg@quotes�n@strip-periods��j@delimitera.gelse-if��e@type�dbilldbookgchapterggraphicjlegal_caseklegislationnmotion_pictureppaper-conferencefreportdsongf@matchcanyf$value��egroup�f$value��dtext�f@macroledition-noteg@quotes�n@strip-periods���egroup�f$value��fnumber�i@variableqnumber-of-volumese@formgnumeric��dtext�e@termfvolumee@formeshortg@plural�g@prefixa g@quotes�n@strip-periods��j@delimiterb, �e@namejissue-notef$value��fchoose�bif�e@type�oarticle-journalf@matchcallf$value��fchoose�bif�i@variable�fvolumef@matchcallf$value��dtext�f@macrofissuedg@prefixb (g@suffixa)g@quotes�n@strip-periods��gelse-if�delse�f$value��dtext�f@macrofissuedg@prefixb, g@quotes�n@strip-periods��gelse-if��i@variable�opublisher-placeipublisherf@matchcanyf$value��egroup�f$value��egroup�f$value��fchoose�bif�i@variable�etitlef@matchdnonef$value�gelse-if��e@type�fthesisfspeechf@matchcanyf$value��dtext�i@variableegenree@formdlongg@prefixlunpublished g@quotes�n@strip-periods���dtext�f@macroeeventg@quotes�n@strip-periods��j@delimitera �dtext�f@macroipublisherg@quotes�n@strip-periods���dtext�f@macrofissuedg@quotes�n@strip-periods��g@prefixb (g@suffixa)j@delimiterb, delse�f$value��dtext�f@macrofissuedg@prefixb, g@quotes�n@strip-periods���e@namevlocators-specific-notef$value��fchoose�bif�e@type�dbilldbookgchapterggraphicjlegal_caseklegislationnmotion_pictureppaper-conferencefreportdsongf@matchcanyf$value��fchoose�bif�k@is-numeric�fvolumef@matchcallf$value��fnumber�i@variablefvolumee@formeromanm@font-variantjsmall-caps�gelse-if�delse�f$value��dtext�i@variablefvolumee@formdlongm@font-variantjsmall-capsg@quotes�n@strip-periods��gelse-if��e@nametcontainer-title-notef$value��fchoose�bif�e@type�gchapterppaper-conferencef@matchcanyf$value��dtext�e@termbine@formdlongg@plural�g@suffixa g@quotes�n@strip-periods��gelse-if��dtext�i@variableocontainer-titlee@formdlongk@font-stylefitalicg@quotes�n@strip-periods�j@text-caseetitle��e@nameledition-notef$value��fchoose�bif�e@type�dbilldbookgchapterggraphicjlegal_caseklegislationnmotion_pictureppaper-conferencefreportdsongf@matchcanyf$value��fchoose�bif�k@is-numeric�geditionf@matchcallf$value��egroup�f$value��fnumber�i@variablegeditione@formgordinal��dtext�e@termgeditione@formeshortg@plural�g@quotes�n@strip-periods��j@delimitera gelse-if�delse�f$value��dtext�i@variablegeditione@formdlongg@quotes�n@strip-periods��gelse-if��e@namenrecipient-notef$value��enames�i@variable�irecipientf$value��elabel�e@formdverbg@pluraljcontextualg@prefixa g@suffixa n@strip-periods���dname�j@delimiterb, iname-part�d@anddtext�j@delimiterb, �e@nameorecipient-shortf$value��enames�i@variable�irecipientf$value��elabel�e@formdverbg@pluraljcontextualg@prefixa g@suffixa n@strip-periods���dname�j@delimiterb, e@formeshortiname-part�d@anddtext��e@namercontributors-shortf$value��enames�i@variable�fauthorf$value��dname�j@delimiterb, e@formeshortiname-part�d@anddtexto@sort-separatorb, ��jsubstitute�f$value��enames�i@variable�feditorf$value��enames�i@variable�jtranslatorf$value��dtext�f@macroutitle-sort-substituteg@quotes�n@strip-periods���dtext�f@macroorecipient-shortg@quotes�n@strip-periods���e@namerlocators-newspaperf$value��fchoose�bif�e@type�qarticle-newspaperf@matchcallf$value��egroup�f$value��egroup�f$value��dtext�i@variablegeditione@formdlongg@quotes�n@strip-periods���dtext�e@termgeditione@formdlongg@plural�g@quotes�n@strip-periods��j@delimitera �egroup�f$value��dtext�e@termgsectione@formdlongg@plural�g@suffixa g@quotes�n@strip-periods���dtext�i@variablegsectione@formdlongg@quotes�n@strip-periods��j@delimiterb, gelse-if��e@nameeeventf$value��egroup�f$value��dtext�e@termlpresented ate@formdlongg@plural�g@suffixa g@quotes�n@strip-periods���dtext�i@variableeevente@formdlongg@quotes�n@strip-periods���e@nameipublisherf$value��fchoose�bif�e@type�fthesisf@matchcallf$value��dtext�i@variableipublishere@formdlongg@quotes�n@strip-periods��gelse-if�delse�f$value��dtext�i@variableipublishere@formdlongg@quotes�n@strip-periods���e@namefissuedf$value��fchoose�bif�e@type�freportqarticle-newspaperparticle-magazinevpersonal_communicationf@matchcanyf$value��ddate�i@variablefissuedidate-part��e@namecdayg@suffixa n@strip-periods���e@nameemonthg@suffixa n@strip-periods���e@namedyearn@strip-periods���gelse-if�delse�f$value��ddate�i@variablefissuedidate-part��e@namedyearn@strip-periods����e@nameepagesf$value��fchoose�bif�e@type�oarticle-journalf@matchcallf$value��egroup�f$value��elabel�i@variabledpagee@formeshortg@pluraljcontextualn@strip-periods���dtext�i@variabledpagee@formdlongg@quotes�n@strip-periods��g@prefixb, j@delimitera gelse-if�delse�f$value��fchoose�bif�i@variable�fvolumef@matchcallf$value��dtext�i@variabledpagee@formdlongg@prefixb, g@quotes�n@strip-periods��gelse-if�delse�f$value��elabel�i@variabledpagee@formeshortg@pluraljcontextualg@prefixb, g@suffixa n@strip-periods���dtext�i@variabledpagee@formdlongg@quotes�n@strip-periods���e@namenpoint-locatorsf$value��dtext�f@macroepagesg@quotes�n@strip-periods���fchoose�bif�i@variable�dpagef@matchcallf$value��egroup�f$value��elabel�i@variableglocatore@formeshortg@pluraljcontextualg@suffixa n@strip-periods���dtext�i@variableglocatore@formdlongg@quotes�n@strip-periods��g@prefixb (g@suffixa)gelse-if�delse�f$value��elabel�i@variableglocatore@formeshortg@pluraljcontextualg@prefixb, g@suffixa n@strip-periods���dtext�i@variableglocatore@formdlongg@quotes�n@strip-periods���e@namexpoint-locators-subsequentf$value��elabel�i@variableglocatore@formeshortg@pluraljcontextualg@prefixb, g@suffixa n@strip-periods���dtext�i@variableglocatore@formdlongg@quotes�n@strip-periods���e@namelarchive-notef$value��egroup�f$value��dtext�i@variablemarchive-placee@formdlongg@quotes�n@strip-periods���dtext�i@variablegarchivee@formdlongg@quotes�n@strip-periods���dtext�i@variableparchive_locatione@formdlongg@quotes�n@strip-periods��j@delimiterb, �e@namekaccess-notef$value��egroup�f$value��fchoose�bif�e@type�oarticle-journaldbillgchapterjlegal_caseklegislationppaper-conferencef@matchdnonef$value��dtext�f@macrolarchive-noteg@prefixb, g@quotes�n@strip-periods��gelse-if�j@delimiterb, �fchoose�bif�i@variable�cDOIf@matchcallf$value��dtext�i@variablecDOIe@formdlongg@prefixf, doi:g@quotes�n@strip-periods��gelse-if�delse�f$value��fchoose�bif�i@variable�cURLf@matchcallf$value��dtext�i@variablecURLe@formdlongg@prefixb g@quotes�n@strip-periods���egroup�f$value��dtext�e@termhaccessede@formdlongg@plural�g@quotes�n@strip-periods���ddate�i@variablehaccessedidate-part��e@namecdayg@prefixa n@strip-periods���e@nameemonthg@prefixa n@strip-periods���e@namedyearg@prefixa n@strip-periods���g@prefixb [g@suffixa]gelse-if��e@namegartworkf$value��fchoose�bif�e@type�ggraphicf@matchcanyf$value��egroup�f$value��dtext�i@variablefmediume@formdlongg@quotes�n@strip-periods���dtext�i@variablejdimensionse@formdlongg@quotes�n@strip-periods��j@delimiterb, gelse-if�flocale��e@langbeneterms�dterm��e@nameeet-ale$textjand otherse@formdlong�e@namefeditore$textfed. bye@formjverb-short�e@namegeditione$textcedne@formeshort�e@namejtranslatore$textitrans. bye@formjverb-short�e@nameefoliofsingledfol.hmultipledfolse@formdlongddate�� \ No newline at end of file diff --git a/src/csl/archive.rs b/src/csl/archive.rs index 8e0e04b5..78172ebc 100644 --- a/src/csl/archive.rs +++ b/src/csl/archive.rs @@ -217,7 +217,7 @@ pub enum ArchivedStyle { /// /// Authors: Patrick O'Brien. MaryAnnLiebertVancouver, - /// Modern Humanities Research Association 3rd edition (note with bibliography). + /// Modern Humanities Research Association 4th edition (note with bibliography). /// /// Authors: Rintze Zelle. ModernHumanitiesResearchAssociation, @@ -1007,7 +1007,7 @@ impl ArchivedStyle { Self::Iso690Numeric => "ISO-690 (numeric, English)", Self::Karger => "Karger journals", Self::MaryAnnLiebertVancouver => "Mary Ann Liebert - Vancouver", - Self::ModernHumanitiesResearchAssociation => "Modern Humanities Research Association 3rd edition (note with bibliography)", + Self::ModernHumanitiesResearchAssociation => "Modern Humanities Research Association 4th edition (note with bibliography)", Self::ModernLanguageAssociation => "Modern Language Association 9th edition", Self::ModernLanguageAssociation8 => "Modern Language Association 8th edition", Self::MultidisciplinaryDigitalPublishingInstitute => "Multidisciplinary Digital Publishing Institute", From 1df9fe49022c2c8e1c5168b5155c4219e1ee6ba9 Mon Sep 17 00:00:00 2001 From: +merlan #flirora Date: Tue, 28 May 2024 12:36:19 -0400 Subject: [PATCH 02/11] Add failing test for #154 --- src/csl/mod.rs | 92 +++++++++++++++++++++++++++++++++++++++++++++- styles/numeric.csl | 40 ++++++++++++++++++++ 2 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 styles/numeric.csl diff --git a/src/csl/mod.rs b/src/csl/mod.rs index dba7403d..509f96e8 100644 --- a/src/csl/mod.rs +++ b/src/csl/mod.rs @@ -2793,7 +2793,7 @@ enum SpecialForm { #[cfg(test)] mod tests { - use std::{fs, path::Path}; + use std::{fs, io::Read, path::Path}; use citationberg::LocaleFile; @@ -2862,4 +2862,94 @@ mod tests { // } } } + + #[test] + fn test_citation_collapsing() { + let workspace = Path::new(env!("CARGO_MANIFEST_DIR")); + let en_locale = + fs::read_to_string(workspace.join("tests/data/locales-en-US.xml")).unwrap(); + let en_locale = LocaleFile::from_xml(&en_locale).unwrap(); + + let yaml = fs::read_to_string(workspace.join("tests/data/basic.yml")).unwrap(); + let bib = from_yaml_str(&yaml).unwrap(); + let en_locale = [en_locale.into()]; + + let style = { + let mut style = String::new(); + let mut file = fs::File::open(workspace.join("styles/numeric.csl")).unwrap(); + file.read_to_string(&mut style).unwrap(); + style + }; + let style = IndependentStyle::from_xml(&style).unwrap(); + let mut driver = BibliographyDriver::new(); + + driver.citation(CitationRequest::new( + vec![ + CitationItem::with_entry(bib.get("foia").unwrap()), + CitationItem::with_entry(bib.get("terminator-2").unwrap()), + CitationItem::with_entry(bib.get("oiseau").unwrap()), + CitationItem::with_entry(bib.get("renaissance").unwrap()), + ], + &style, + Some(LocaleCode::en_us()), + &en_locale, + None, + )); + + driver.citation(CitationRequest::new( + vec![ + CitationItem::with_entry(bib.get("kinetics").unwrap()), + CitationItem::with_entry(bib.get("house").unwrap()), + CitationItem::with_entry(bib.get("gedanken").unwrap()), + CitationItem::with_entry(bib.get("zygos").unwrap()), + ], + &style, + Some(LocaleCode::en_us()), + &en_locale, + None, + )); + + let rendered = driver.finish(BibliographyRequest::new( + &style, + Some(LocaleCode::en_us()), + &en_locale, + )); + + assert_eq!( + rendered + .bibliography + .as_ref() + .unwrap() + .items + .iter() + .map(|item| item.key.as_str()) + .collect::>(), + vec![ + "foia", + "terminator-2", + "oiseau", + "kinetics", + "renaissance", + "house", + "gedanken", + "zygos" + ] + ); + + println!("{}", rendered.citations[0].citation); + assert_eq!(format!("{:#}", rendered.citations[0].citation), "[1–3; 5]"); + assert_eq!(format!("{:#}", rendered.citations[1].citation), "[4; 6–8]"); + + for cite in rendered.citations { + println!("{}", cite.citation); + } + + if let Some(bib) = rendered.bibliography { + for item in bib.items { + println!("{}: {}", item.key, item.content); + } + } else { + println!("no bibliography?"); + } + } } diff --git a/styles/numeric.csl b/styles/numeric.csl new file mode 100644 index 00000000..d7a7c029 --- /dev/null +++ b/styles/numeric.csl @@ -0,0 +1,40 @@ + + \ No newline at end of file From 0587f71dbb104e73120d821335a7b219c609cd32 Mon Sep 17 00:00:00 2001 From: +merlan #flirora Date: Tue, 28 May 2024 12:55:45 -0400 Subject: [PATCH 03/11] Fix formatting of collapsed numeric citations Fixes #154. --- src/csl/mod.rs | 102 +++++++++++++++++++++------------------------ styles/numeric.csl | 4 +- 2 files changed, 49 insertions(+), 57 deletions(-) diff --git a/src/csl/mod.rs b/src/csl/mod.rs index 509f96e8..d7f07c2b 100644 --- a/src/csl/mod.rs +++ b/src/csl/mod.rs @@ -863,25 +863,39 @@ fn collapse_items<'a, T: EntryLike>(cite: &mut SpeculativeCiteRender<'a, '_, T>) match style.citation.collapse { Some(Collapse::CitationNumber) => { // Option with the start and end of the range. + let after_collapse_delim = + after_collapse_delim.or(style.citation.layout.delimiter.as_deref()); let mut range_start: Option<(usize, usize)> = None; + let mut ended_range = false; + + let end_range = |items: &mut [SpeculativeItemRender<'a, T>], + range_start: &mut Option<(usize, usize)>, + ended_range: &mut bool| { + let use_after_collapse_delim = *ended_range; + *ended_range = false; + + if let &mut Some((start, end)) = range_start { + // If the previous citation range was collapsed, + // then use the after-collapse delimiter + // before the next item. + if use_after_collapse_delim { + items[start].delim_override = after_collapse_delim; + } - let end_range = - |items: &mut [SpeculativeItemRender<'a, T>], - range_start: &mut Option<(usize, usize)>| { - if let &mut Some((start, end)) = range_start { - // There should be at least three items in the range. - if start + 1 < end { - items[end].delim_override = - after_collapse_delim.or(Some("–")); - - for item in &mut items[start + 1..end] { - item.hidden = true; - } + // There should be at least three items in the range. + if start + 1 < end { + items[end].delim_override = Some("–"); + + for item in &mut items[start + 1..end] { + item.hidden = true; } + + *ended_range = true; } + } - *range_start = None; - }; + *range_start = None; + }; for i in 0..cite.items.len() { let citation_number = { @@ -891,7 +905,7 @@ fn collapse_items<'a, T: EntryLike>(cite: &mut SpeculativeCiteRender<'a, '_, T>) if item.hidden || item.rendered.get_meta(ElemMeta::CitationNumber).is_none() { - end_range(&mut cite.items, &mut range_start); + end_range(&mut cite.items, &mut range_start, &mut ended_range); continue; } @@ -914,13 +928,13 @@ fn collapse_items<'a, T: EntryLike>(cite: &mut SpeculativeCiteRender<'a, '_, T>) range_start = Some((start, i)); } _ => { - end_range(&mut cite.items, &mut range_start); + end_range(&mut cite.items, &mut range_start, &mut ended_range); range_start = Some((i, i)); } } } - end_range(&mut cite.items, &mut range_start); + end_range(&mut cite.items, &mut range_start, &mut ended_range); } Some(Collapse::Year | Collapse::YearSuffix | Collapse::YearSuffixRanged) => { let after_collapse_delim = @@ -2883,31 +2897,20 @@ mod tests { let style = IndependentStyle::from_xml(&style).unwrap(); let mut driver = BibliographyDriver::new(); - driver.citation(CitationRequest::new( - vec![ - CitationItem::with_entry(bib.get("foia").unwrap()), - CitationItem::with_entry(bib.get("terminator-2").unwrap()), - CitationItem::with_entry(bib.get("oiseau").unwrap()), - CitationItem::with_entry(bib.get("renaissance").unwrap()), - ], - &style, - Some(LocaleCode::en_us()), - &en_locale, - None, - )); - - driver.citation(CitationRequest::new( - vec![ - CitationItem::with_entry(bib.get("kinetics").unwrap()), - CitationItem::with_entry(bib.get("house").unwrap()), - CitationItem::with_entry(bib.get("gedanken").unwrap()), - CitationItem::with_entry(bib.get("zygos").unwrap()), - ], - &style, - Some(LocaleCode::en_us()), - &en_locale, - None, - )); + let mut cite = |keys: &[&str]| { + driver.citation(CitationRequest::new( + keys.iter() + .map(|key| CitationItem::with_entry(bib.get(key).unwrap())) + .collect(), + &style, + Some(LocaleCode::en_us()), + &en_locale, + None, + )); + }; + cite(&["foia", "terminator-2", "oiseau", "renaissance"]); + cite(&["kinetics", "house", "gedanken", "zygos"]); + cite(&["terminator-2", "oiseau", "house"]); let rendered = driver.finish(BibliographyRequest::new( &style, @@ -2938,18 +2941,7 @@ mod tests { println!("{}", rendered.citations[0].citation); assert_eq!(format!("{:#}", rendered.citations[0].citation), "[1–3; 5]"); - assert_eq!(format!("{:#}", rendered.citations[1].citation), "[4; 6–8]"); - - for cite in rendered.citations { - println!("{}", cite.citation); - } - - if let Some(bib) = rendered.bibliography { - for item in bib.items { - println!("{}: {}", item.key, item.content); - } - } else { - println!("no bibliography?"); - } + assert_eq!(format!("{:#}", rendered.citations[1].citation), "[4, 6–8]"); + assert_eq!(format!("{:#}", rendered.citations[2].citation), "[2, 3, 6]"); } } diff --git a/styles/numeric.csl b/styles/numeric.csl index d7a7c029..3dccfde0 100644 --- a/styles/numeric.csl +++ b/styles/numeric.csl @@ -2,7 +2,7 @@ +<<===== CSL =====<< + + +>>===== INPUT =====>> +[ + { + "id": "ITEM-1", + "title": "Paper 1", + "type": "book" + }, + { + "id": "ITEM-2", + "title": "Paper 2", + "type": "book" + }, + { + "id": "ITEM-3", + "title": "Paper 3", + "type": "book" + }, + { + "id": "ITEM-4", + "title": "Paper 4", + "type": "book" + }, + { + "id": "ITEM-5", + "title": "Paper 5", + "type": "book" + }, + { + "id": "ITEM-6", + "title": "Paper 6", + "type": "book" + }, + { + "id": "ITEM-7", + "title": "Paper 7", + "type": "book" + }, + { + "id": "ITEM-8", + "title": "Paper 8", + "type": "book" + } +] +<<===== INPUT =====<< + + +>>===== VERSION =====>> +1.0 +<<===== VERSION =====<< From 6681f138d85af37bc2325134d066837412c75201 Mon Sep 17 00:00:00 2001 From: +merlan #flirora Date: Tue, 6 Aug 2024 22:21:34 -0400 Subject: [PATCH 07/11] Remove styles/numeric.csl --- styles/numeric.csl | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 styles/numeric.csl diff --git a/styles/numeric.csl b/styles/numeric.csl deleted file mode 100644 index 3dccfde0..00000000 --- a/styles/numeric.csl +++ /dev/null @@ -1,40 +0,0 @@ - - \ No newline at end of file From 82a4d8fba1315841dfecebc91111f4e79123ec45 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Wed, 7 Aug 2024 23:44:15 -0300 Subject: [PATCH 08/11] simplify test --- ...collapse_CitationNumberRangesSeparated.txt | 40 ++++--------------- 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/tests/local/collapse_CitationNumberRangesSeparated.txt b/tests/local/collapse_CitationNumberRangesSeparated.txt index 67325139..39cd5b3a 100644 --- a/tests/local/collapse_CitationNumberRangesSeparated.txt +++ b/tests/local/collapse_CitationNumberRangesSeparated.txt @@ -7,9 +7,9 @@ Simplified from collapse_CitationNumberRangesInsert.txt >>===== RESULT =====>> [1–8] -[1–3; 5] -[4, 6–8] -[2, 3, 6] +[1–3;5] +[4,6–8] +[2,3,6] <<===== RESULT =====<< >>===== CITATION-ITEMS =====>> @@ -84,45 +84,21 @@ Simplified from collapse_CitationNumberRangesInsert.txt >>===== CSL =====>> - <<===== CSL =====<< From 2170972926ee79488fcfa2ad7f36ab5eac987b01 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Thu, 8 Aug 2024 00:00:36 -0300 Subject: [PATCH 09/11] slightly improve collapse code --- src/csl/mod.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/csl/mod.rs b/src/csl/mod.rs index e225065c..b2ca7f91 100644 --- a/src/csl/mod.rs +++ b/src/csl/mod.rs @@ -872,9 +872,9 @@ fn collapse_items<'a, T: EntryLike>(cite: &mut SpeculativeCiteRender<'a, '_, T>) let end_range = |items: &mut [SpeculativeItemRender<'a, T>], range_start: &mut Option<(usize, usize)>, - ended_range: &mut bool| { - let use_after_collapse_delim = *ended_range; - *ended_range = false; + just_collapsed: &mut bool| { + let use_after_collapse_delim = *just_collapsed; + *just_collapsed = false; if let &mut Some((start, end)) = range_start { // If the previous citation range was collapsed, @@ -884,7 +884,8 @@ fn collapse_items<'a, T: EntryLike>(cite: &mut SpeculativeCiteRender<'a, '_, T>) items[start].delim_override = after_collapse_delim; } - // There should be at least three items in the range. + // There should be at least three items in the range to + // collapse. if start + 1 < end { items[end].delim_override = Some("–"); @@ -892,7 +893,7 @@ fn collapse_items<'a, T: EntryLike>(cite: &mut SpeculativeCiteRender<'a, '_, T>) item.hidden = true; } - *ended_range = true; + *just_collapsed = true; } } From 0ca5fa7f1b43cc068f39fc2571d6cc1a45626411 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Thu, 8 Aug 2024 00:14:32 -0300 Subject: [PATCH 10/11] remove redundant test import --- src/csl/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/csl/mod.rs b/src/csl/mod.rs index b2ca7f91..2be075b8 100644 --- a/src/csl/mod.rs +++ b/src/csl/mod.rs @@ -2807,7 +2807,7 @@ enum SpecialForm { #[cfg(test)] mod tests { - use std::{fs, io::Read, path::Path}; + use std::{fs, path::Path}; use citationberg::LocaleFile; From 3762ced747043d098af0cc2c15f24ba05c63e0b6 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Thu, 8 Aug 2024 00:19:13 -0300 Subject: [PATCH 11/11] wrap comment at 80 columns --- src/csl/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/csl/mod.rs b/src/csl/mod.rs index 2be075b8..62062757 100644 --- a/src/csl/mod.rs +++ b/src/csl/mod.rs @@ -877,9 +877,8 @@ fn collapse_items<'a, T: EntryLike>(cite: &mut SpeculativeCiteRender<'a, '_, T>) *just_collapsed = false; if let &mut Some((start, end)) = range_start { - // If the previous citation range was collapsed, - // then use the after-collapse delimiter - // before the next item. + // If the previous citation range was collapsed, use the + // after-collapse delimiter before the next item. if use_after_collapse_delim { items[start].delim_override = after_collapse_delim; }