Skip to content

Commit

Permalink
APA: Put conditional event-title logic in a macro (#6161)
Browse files Browse the repository at this point in the history
* APA: `event-title` and conditional `event`

To handle Zotero's updated data model

* Update other APA styles with event-title

* APA: Put conditional event-title logic in a macro
  • Loading branch information
bwiernik authored Jul 26, 2022
1 parent a87414f commit c750b6e
Show file tree
Hide file tree
Showing 16 changed files with 249 additions and 142 deletions.
22 changes: 18 additions & 4 deletions apa-5th-edition.csl
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
</else-if>
<else>
<choose>
<if variable="event" match="none">
<if variable="event event-title" match="none">
<text variable="genre" suffix=", "/>
</if>
</choose>
Expand All @@ -196,23 +196,37 @@
</macro>
<macro name="event">
<choose>
<if variable="event">
<if variable="event event-title" match="any">
<choose>
<if variable="genre" match="none">
<text term="presented at" text-case="capitalize-first" suffix=" "/>
<text variable="event"/>
<text macro="event-title"/>
</if>
<else>
<group delimiter=" ">
<text variable="genre" text-case="capitalize-first"/>
<text term="presented at"/>
<text variable="event"/>
<text macro="event-title"/>
</group>
</else>
</choose>
</if>
</choose>
</macro>
<macro name="event-title">
<choose>
<!-- TODO: We expect "event-title" to be used,
but processors and applications may not be updated yet.
This macro ensures that either "event" or "event-title" can be accpeted.
Remove if procesor logic and application adoption can handle this. -->
<if variable="event-title">
<text variable="event-title"/>
</if>
<else>
<text variable="event"/>
</else>
</choose>
</macro>
<macro name="issued">
<choose>
<if variable="issued">
Expand Down
25 changes: 15 additions & 10 deletions apa-6th-edition-no-ampersand.csl
Original file line number Diff line number Diff line change
Expand Up @@ -917,16 +917,7 @@
</else>
</choose>
<group delimiter=", ">
<choose>
<!-- We expect "event-title" to be used, but applications may not be updated yet.
This ensures that either can be accpeted. Remove if procesor logic can handle this. -->
<if variable="event-title">
<text variable="event-title"/>
</if>
<else>
<text variable="event"/>
</else>
</choose>
<text macro="event-title"/>
<text variable="event-place"/>
</group>
</group>
Expand All @@ -938,6 +929,20 @@
</if>
</choose>
</macro>
<macro name="event-title">
<choose>
<!-- TODO: We expect "event-title" to be used,
but processors and applications may not be updated yet.
This macro ensures that either "event" or "event-title" can be accpeted.
Remove if procesor logic and application adoption can handle this. -->
<if variable="event-title">
<text variable="event-title"/>
</if>
<else>
<text variable="event"/>
</else>
</choose>
</macro>
<macro name="issued">
<choose>
<if type="bill legal_case legislation" match="any"/>
Expand Down
25 changes: 15 additions & 10 deletions apa-6th-edition.csl
Original file line number Diff line number Diff line change
Expand Up @@ -916,16 +916,7 @@
</else>
</choose>
<group delimiter=", ">
<choose>
<!-- We expect "event-title" to be used, but applications may not be updated yet.
This ensures that either can be accpeted. Remove if procesor logic can handle this. -->
<if variable="event-title">
<text variable="event-title"/>
</if>
<else>
<text variable="event"/>
</else>
</choose>
<text macro="event-title"/>
<text variable="event-place"/>
</group>
</group>
Expand All @@ -937,6 +928,20 @@
</if>
</choose>
</macro>
<macro name="event-title">
<choose>
<!-- TODO: We expect "event-title" to be used,
but processors and applications may not be updated yet.
This macro ensures that either "event" or "event-title" can be accpeted.
Remove if procesor logic and application adoption can handle this. -->
<if variable="event-title">
<text variable="event-title"/>
</if>
<else>
<text variable="event"/>
</else>
</choose>
</macro>
<macro name="issued">
<choose>
<if type="bill legal_case legislation" match="any"/>
Expand Down
25 changes: 15 additions & 10 deletions apa-annotated-bibliography.csl
Original file line number Diff line number Diff line change
Expand Up @@ -1559,23 +1559,28 @@
<if variable="collection-editor editor editorial-director issue page volume" match="none">
<!-- Don't print event info if published in a proceedings -->
<group delimiter=", ">
<choose>
<!-- We expect "event-title" to be used, but applications may not be updated yet.
This ensures that either can be accpeted. Remove if procesor logic can handle this. -->
<if variable="event-title">
<text variable="event-title"/>
</if>
<else>
<text variable="event"/>
</else>
</choose>
<text macro="event-title"/>
<text variable="event-place"/>
</group>
</if>
</choose>
</if>
</choose>
</macro>
<macro name="event-title">
<choose>
<!-- TODO: We expect "event-title" to be used,
but processors and applications may not be updated yet.
This macro ensures that either "event" or "event-title" can be accpeted.
Remove if procesor logic and application adoption can handle this. -->
<if variable="event-title">
<text variable="event-title"/>
</if>
<else>
<text variable="event"/>
</else>
</choose>
</macro>
<!-- After 'source', APA also prints publication history (original publication, reprint info, retraction info) -->
<macro name="publication-history">
<choose>
Expand Down
25 changes: 15 additions & 10 deletions apa-cv.csl
Original file line number Diff line number Diff line change
Expand Up @@ -1306,23 +1306,28 @@
<if variable="collection-editor editor editorial-director issue page volume" match="none">
<!-- Don't print event info if published in a proceedings -->
<group delimiter=", ">
<choose>
<!-- We expect "event-title" to be used, but applications may not be updated yet.
This ensures that either can be accpeted. Remove if procesor logic can handle this. -->
<if variable="event-title">
<text variable="event-title"/>
</if>
<else>
<text variable="event"/>
</else>
</choose>
<text macro="event-title"/>
<text variable="event-place"/>
</group>
</if>
</choose>
</if>
</choose>
</macro>
<macro name="event-title">
<choose>
<!-- TODO: We expect "event-title" to be used,
but processors and applications may not be updated yet.
This macro ensures that either "event" or "event-title" can be accpeted.
Remove if procesor logic and application adoption can handle this. -->
<if variable="event-title">
<text variable="event-title"/>
</if>
<else>
<text variable="event"/>
</else>
</choose>
</macro>
<!-- After 'source', APA also prints publication history (original publication, reprint info, retraction info) -->
<macro name="publication-history">
<choose>
Expand Down
22 changes: 18 additions & 4 deletions apa-fr-provost.csl
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
<else-if type="map post-weblog post" match="none">
<group delimiter=", ">
<choose>
<if variable="event" match="none">
<if variable="event event-title" match="none">
<text variable="genre" prefix="[" suffix="]"/>
</if>
</choose>
Expand Down Expand Up @@ -298,17 +298,17 @@
<choose>
<if variable="container-title" match="none">
<choose>
<if variable="event">
<if variable="event event-title" match="any">
<choose>
<if variable="genre" match="none">
<text term="presented at" text-case="capitalize-first" suffix=" "/>
<text variable="event"/>
<text macro="event-title"/>
</if>
<else>
<group delimiter=" ">
<text variable="genre" text-case="capitalize-first"/>
<text term="presented at"/>
<text variable="event"/>
<text macro="event-title"/>
</group>
</else>
</choose>
Expand All @@ -317,6 +317,20 @@
</if>
</choose>
</macro>
<macro name="event-title">
<choose>
<!-- TODO: We expect "event-title" to be used,
but processors and applications may not be updated yet.
This macro ensures that either "event" or "event-title" can be accpeted.
Remove if procesor logic and application adoption can handle this. -->
<if variable="event-title">
<text variable="event-title"/>
</if>
<else>
<text variable="event"/>
</else>
</choose>
</macro>
<macro name="extra">
<choose>
<if type="manuscript">
Expand Down
25 changes: 15 additions & 10 deletions apa-no-ampersand.csl
Original file line number Diff line number Diff line change
Expand Up @@ -1559,23 +1559,28 @@
<if variable="collection-editor editor editorial-director issue page volume" match="none">
<!-- Don't print event info if published in a proceedings -->
<group delimiter=", ">
<choose>
<!-- We expect "event-title" to be used, but applications may not be updated yet.
This ensures that either can be accpeted. Remove if procesor logic can handle this. -->
<if variable="event-title">
<text variable="event-title"/>
</if>
<else>
<text variable="event"/>
</else>
</choose>
<text macro="event-title"/>
<text variable="event-place"/>
</group>
</if>
</choose>
</if>
</choose>
</macro>
<macro name="event-title">
<choose>
<!-- TODO: We expect "event-title" to be used,
but processors and applications may not be updated yet.
This macro ensures that either "event" or "event-title" can be accpeted.
Remove if procesor logic and application adoption can handle this. -->
<if variable="event-title">
<text variable="event-title"/>
</if>
<else>
<text variable="event"/>
</else>
</choose>
</macro>
<!-- After 'source', APA also prints publication history (original publication, reprint info, retraction info) -->
<macro name="publication-history">
<choose>
Expand Down
25 changes: 15 additions & 10 deletions apa-no-doi-no-issue.csl
Original file line number Diff line number Diff line change
Expand Up @@ -923,16 +923,7 @@
</else>
</choose>
<group delimiter=", ">
<choose>
<!-- We expect "event-title" to be used, but applications may not be updated yet.
This ensures that either can be accpeted. Remove if procesor logic can handle this. -->
<if variable="event-title">
<text variable="event-title"/>
</if>
<else>
<text variable="event"/>
</else>
</choose>
<text macro="event-title"/>
<text variable="event-place"/>
</group>
</group>
Expand All @@ -944,6 +935,20 @@
</if>
</choose>
</macro>
<macro name="event-title">
<choose>
<!-- TODO: We expect "event-title" to be used,
but processors and applications may not be updated yet.
This macro ensures that either "event" or "event-title" can be accpeted.
Remove if procesor logic and application adoption can handle this. -->
<if variable="event-title">
<text variable="event-title"/>
</if>
<else>
<text variable="event"/>
</else>
</choose>
</macro>
<macro name="issued">
<choose>
<if type="bill legal_case legislation" match="any"/>
Expand Down
25 changes: 15 additions & 10 deletions apa-no-initials.csl
Original file line number Diff line number Diff line change
Expand Up @@ -1559,23 +1559,28 @@
<if variable="collection-editor editor editorial-director issue page volume" match="none">
<!-- Don't print event info if published in a proceedings -->
<group delimiter=", ">
<choose>
<!-- We expect "event-title" to be used, but applications may not be updated yet.
This ensures that either can be accpeted. Remove if procesor logic can handle this. -->
<if variable="event-title">
<text variable="event-title"/>
</if>
<else>
<text variable="event"/>
</else>
</choose>
<text macro="event-title"/>
<text variable="event-place"/>
</group>
</if>
</choose>
</if>
</choose>
</macro>
<macro name="event-title">
<choose>
<!-- TODO: We expect "event-title" to be used,
but processors and applications may not be updated yet.
This macro ensures that either "event" or "event-title" can be accpeted.
Remove if procesor logic and application adoption can handle this. -->
<if variable="event-title">
<text variable="event-title"/>
</if>
<else>
<text variable="event"/>
</else>
</choose>
</macro>
<!-- After 'source', APA also prints publication history (original publication, reprint info, retraction info) -->
<macro name="publication-history">
<choose>
Expand Down
Loading

0 comments on commit c750b6e

Please sign in to comment.