This repository has been archived by the owner on Jan 6, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
add citation-label
style syntax
#30
Labels
Comments
So, what do we do with this one? I think it's beyond dispute that we need something like this. Could this be for 1.1? |
Yes, that sounds good. |
See previous discussion here: citation-style-language/schema#41 |
@bdarcus Can you give me triage privileges on this repo so I can transfer this to schema? |
Closed
Replaced by citation-style-language/schema#295 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently,
citation-label
is either provided in item metadata or generated using a pattern specified by the citation processor. This makes it difficult for users to change label formats for different label CSL styles.Here is some discussion between @cormacrelf and me on an interface for specifying
citation-label
formats: https://discourse.citationstyles.org/t/citation-label-formatting/1585/2citeproc-js provides this format for automatically-generated labels:
Aaaa00:AaAa00:AaAA00:AAAA00
@cormacrelf implemented that format into citeproc-rs, generalizing it to any number of authors.
I think this is a good format to build on. The one question is how to specify what variables to use/fallback to to produce the
citation-label
. Here is what I propose.A new element
cs:citation-label
sibling tocs:citation
with a requiredformat
attribute (we could also usevalue
).format
will look something like thisformat="Aaaa0:AaAa0:AaAA0:AAAA0"
format
is a colon-delimited list with the format to use for an item withnames
input that is length 1, length 2, etc. The last value is for its position or more names (e.g., here for 4+ names).format
can be any lengthA
indicates first letter of creator’s family namea
indicates subsequent letters of that creator’s family name0
indicates the output of thedate
elementA
,a
,0
can be given by escaping with\
(e.g.,\A
)cs:citation-label
can have two children<names>
element used to provide the input for theAa
parts of the formatsubstitute
child. Othercs:names
children are ignored.<date>
element to provide the input for the0
parts of the formatcs:date
<date-part name="year" form="short"/>
If the item data contains a
citation-label
value, this overrides the automatically-generated value fromcs:citation-label
.This approach rests on existing
cs:names
andcs:date
structures while still being flexible for users.Thoughts?
The text was updated successfully, but these errors were encountered: