Links
AI / Agents
gdtest-bibliography-csl
Synthetic test for the optional csl: key (issue #214). A custom numeric Citation Style Language file selects bracketed-number citations instead of the default author-date style.
Like gdtest_bibliography, but great-docs.yml also sets the optional csl: docs/numeric.csl key. The custom Citation Style Language file is copied into the build and wired into _quarto.yml, so citations render as bracketed numbers ([1], [2]) and the reference list is numbered, instead of the default Chicago author-date style. Confirms CSL selection works end to end (issue #214’s optional CSL support).
Source files
docs/
numeric.csl
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" default-locale="en-US">
<info>
<title>GD Test Numeric</title>
<id>gd-test-numeric</id>
<updated>2024-01-01T00:00:00+00:00</updated>
</info>
<citation collapse="citation-number">
<layout prefix="[" suffix="]" delimiter=",">
<text variable="citation-number"/>
</layout>
</citation>
<bibliography>
<layout>
<text variable="citation-number" prefix="[" suffix="] "/>
<names variable="author" suffix=". "><name/></names>
<text variable="title" suffix="."/>
</layout>
</bibliography>
</style>references.bib
@article{knuth1984,
title = {Literate Programming},
author = {Knuth, Donald E.},
year = {1984},
journal = {The Computer Journal},
}
@book{lamport1994,
title = {LaTeX: A Document Preparation System},
author = {Lamport, Leslie},
year = {1994},
publisher = {Addison-Wesley},
}gdtest_bibliography_csl/
__init__.py
"""Package demonstrating a custom citation style."""
__version__ = "0.1.0"
__all__ = ["cite"]
def cite(key: str) -> str:
"""
Return a citation key.
Parameters
----------
key
The citation key.
Returns
-------
str
The same key.
"""
return keyuser_guide/
01-citations.qmd
---
title: Numbered Citations
---
Literate programming was introduced by Knuth [@knuth1984], and LaTeX
by Lamport [@lamport1994]. With a numeric CSL, these render as
bracketed numbers rather than author-year text.
## References
::: {#refs}
:::README.md
# gdtest-bibliography-csl Synthetic test for the optional `csl:` key (issue #214). A custom numeric Citation Style Language file selects bracketed-number citations instead of the default author-date style.
great-docs.yml
bibliography: docs/references.bib csl: docs/numeric.csl