Make Ibid handling compliant with the CSL spec#301
Conversation
|
Thanks, can you add a local citeproc test demoing that this is working correctly? There are a few existing tests you can base yourself off of (let me know if you need help). |
|
Can I create two citations to the same bibliography entry with equal/different locator/supplement in the citeproc tests? Below there are test files I've ended with.
and |
|
@PgBiel ↑ |
|
Don't worry, I will get back to you soon. We are currently busy with our own work on Typst so we have less time to assign to reviews, but you can expect a response in the next few days. |
Ideally we'd support it as well in citeproc tests, but you don't have to do this job if you don't want to. Instead, we can use a regular test like this one: Line 3116 in 9df6db2 |
|
I also think that adding support for citations in citeproc tests would be ideal, but it is also a great amount of work, for which currently I don't have time. On the other hand, I think the ibid bug-fixes should not wait. Thanks for pointing the "regular tests" way. |
b3b8882 to
e64551c
Compare
|
I've also added a test that uses a non-synthetic CSL style. Maybe it is a good way to convince that the bug-fix changes Hayagriva in the right direction? |
|
Fwiw there already is an official citeproc test for this exact case, so in theory Hayagriva already "has" this test: https://github.com/citation-style-language/test-suite/blob/b01762cc03bb53238bef479665fc0d169404449e/processor-tests/humans/position_IfIbidWithLocatorIsTrueThenIbidIsTrue.txt Unfortunately, the test doesn't run as hayagriva doesn't support the Details
>>===== MODE =====>>
citation
<<===== MODE =====<<
>>===== RESULT =====>>
Appleton “Tom Swift and His Electric Runabout” (1910).
Ibid.
<<===== RESULT =====<<
>>===== CITATION-ITEMS =====>>
[
[
{
"id": "ITEM-1"
}
],
[
{
"id": "ITEM-1",
"label": "page",
"locator": "23"
}
]
]
<<===== CITATION-ITEMS =====<<
>>===== 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>
<layout suffix=".">
<choose>
<if position="first">
<group delimiter=" ">
<names variable="author">
<name form="short" />
</names>
<text quotes="true" variable="title" />
<date prefix="(" suffix=")" variable="issued">
<date-part name="year" />
</date>
</group>
</if>
<else-if position="ibid">
<text term="ibid" />
</else-if>
<else-if position="ibid-with-locator">
<text term="ibid" />
<label form="short" prefix=" " strip-periods="false" variable="locator" />
<text prefix=" " variable="locator" />
</else-if>
<else>
<text value="WTF?"/>
</else>
</choose>
</layout>
</citation>
</style>
<<===== CSL =====<<
>>===== INPUT =====>>
[
{
"author": [
{
"family": "Appleton",
"given": "Victor"
}
],
"id": "ITEM-1",
"issued": {
"date-parts": [
[
"1910"
]
]
},
"title": "Tom Swift and His Electric Runabout",
"type": "book"
}
]
<<===== INPUT =====<<
>>===== VERSION =====>>
1.0
<<===== VERSION =====<<which showed that:
|
|
In any case, I think we can then try to keep your originally proposed citeproc tests, however adapted to use I believe that can't be done for the "real" style test, however. But to be honest, it is a bit fragile as it can start failing if the style updates. But I think we can just keep it as is for now (maybe with a bit more indicative of a name, e.g. |
|
Done. I'm confused with the
Possibly it is specified here: https://docs.citationstyles.org/en/stable/specification.html#citation
Definitely a topic for a separate issue. We can surround the citation with parentheses. Then "ibid." should not be uppercased (because parenthesis is the first character that should be uppercased, and uppercasing parentheses is a no-op). This way our test will match the official specification. What do you think? |
PgBiel
left a comment
There was a problem hiding this comment.
I think this is fine as is. Thank you!
According to the CSL spec, especially:
Confirmed by the discussion and by consistency between different styles that use Ibid
(they first check
position="ibid-with-locator"and thenposition="ibid"),Hayagriva handles Ibid position tests wrongly.
This PR fixes Ibid position tests handling.
See also: #299 (comment)