
Platform-agnostic bridge from Citation Style Language processors to a token domain, yielding in-text citation tokens and richly formatted bibliography entries from BibTeX, CSL JSON, YAML, EndNote, RIS.
A Kotlin Multiplatform bridge from Citation Style Language (.csl) processors
to a platform-agnostic bibliography token domain.
| ❌ What this library is not | ✅ What it is |
|---|---|
| Processor implementation | Platform-agnostic bridge to established processors |
| CSL → HTML converter | CSL → your AST |
| Target | Backend | Formats | Status |
|---|---|---|---|
| JVM | citeproc-java (Java, Apache-2.0) | BibTeX, CSL JSON, YAML, EndNote, RIS | Stable |
| WASM | hayagriva (Rust, MIT/Apache-2.0) | BibTeX, CSL JSON | Experimental |
dependencies {
implementation("com.quarkdown.bibliographer:bibliographer:0.5.0")
}val bibliographer =
Bibliographer(
style = "ieee",
source =
BibliographySource(
File("references.bib").readText(),
BibliographyFormat.BIBTEX,
),
)Render in-text citations and the bibliography as tokens:
// [Text("[1]")], or null if the key is unknown.
bibliographer.citation("einstein1905")
bibliographer.bibliography().forEach { entry ->
entry.citationKey // "einstein1905"
entry.label // "[1]" for numbered styles
entry.content // [Text("A. Einstein, "), Italic(Text("Zur Elektrodynamik...")), ...]
}style accepts either a name from StyleCatalog (67 popular styles), or the XML content of any CSL style definition.
american-anthropological-associationamerican-chemical-societyamerican-geophysical-unionamerican-institute-of-aeronautics-and-astronauticsamerican-institute-of-physicsamerican-medical-associationamerican-meteorological-societyamerican-physics-societyamerican-physiological-societyamerican-political-science-associationamerican-society-for-microbiologyamerican-society-of-civil-engineersamerican-society-of-mechanical-engineersamerican-sociological-associationangewandte-chemieannual-reviewsannual-reviews-author-dateapaassociacao-brasileira-de-normas-tecnicasassociation-for-computing-machinerybiomed-centralbmjbristol-university-presscellchicago-author-datechicago-noteschicago-notes-bibliographychicago-shortened-notes-bibliographycopernicus-publicationscurrent-opiniondeutsche-gesellschaft-fur-psychologiedeutsche-spracheelsevier-harvardelsevier-vancouverelsevier-with-titlesfrontiersfuture-medicinefuture-science-groupgost-r-7-0-5-2008-numericharvard-cite-them-rightieeeinstitute-of-physics-numerickarger-journalsmary-ann-liebert-vancouvermodern-language-associationmultidisciplinary-digital-publishing-institutenaturepensoft-journalsplosroyal-society-of-chemistrysage-vancouversist02spie-journalsspringer-basic-author-datespringer-basic-bracketsspringer-fachzeitschriften-medizin-psychologiespringer-humanities-author-datespringer-lecture-notes-in-computer-sciencespringer-mathphys-bracketsspringer-socpsych-author-datespringer-vancouvertaylor-and-francis-chicago-author-datetaylor-and-francis-national-library-of-medicinethe-institution-of-engineering-and-technologythe-lancetthieme-germantrends-journalsFormatting is expressed by decorated composition, and mapping tokens to your own domain is a recursive match:
fun convert(token: BibliographyToken): MyNode =
when (token) {
is Text -> MyText(token.text)
is Link -> MyLink(url = token.url, label = convert(token.label))
is Italic -> MyEmphasis(convert(token.token))
is Bold -> MyStrong(convert(token.token))
// ...
}Every published artifact embeds the catalog styles from the CSL styles project, and the WASM artifact additionally embeds locale data from the CSL locales project; both are licensed under CC BY-SA 3.0.
A Kotlin Multiplatform bridge from Citation Style Language (.csl) processors
to a platform-agnostic bibliography token domain.
| ❌ What this library is not | ✅ What it is |
|---|---|
| Processor implementation | Platform-agnostic bridge to established processors |
| CSL → HTML converter | CSL → your AST |
| Target | Backend | Formats | Status |
|---|---|---|---|
| JVM | citeproc-java (Java, Apache-2.0) | BibTeX, CSL JSON, YAML, EndNote, RIS | Stable |
| WASM | hayagriva (Rust, MIT/Apache-2.0) | BibTeX, CSL JSON | Experimental |
dependencies {
implementation("com.quarkdown.bibliographer:bibliographer:0.5.0")
}val bibliographer =
Bibliographer(
style = "ieee",
source =
BibliographySource(
File("references.bib").readText(),
BibliographyFormat.BIBTEX,
),
)Render in-text citations and the bibliography as tokens:
// [Text("[1]")], or null if the key is unknown.
bibliographer.citation("einstein1905")
bibliographer.bibliography().forEach { entry ->
entry.citationKey // "einstein1905"
entry.label // "[1]" for numbered styles
entry.content // [Text("A. Einstein, "), Italic(Text("Zur Elektrodynamik...")), ...]
}style accepts either a name from StyleCatalog (67 popular styles), or the XML content of any CSL style definition.
american-anthropological-associationamerican-chemical-societyamerican-geophysical-unionamerican-institute-of-aeronautics-and-astronauticsamerican-institute-of-physicsamerican-medical-associationamerican-meteorological-societyamerican-physics-societyamerican-physiological-societyamerican-political-science-associationamerican-society-for-microbiologyamerican-society-of-civil-engineersamerican-society-of-mechanical-engineersamerican-sociological-associationangewandte-chemieannual-reviewsannual-reviews-author-dateapaassociacao-brasileira-de-normas-tecnicasassociation-for-computing-machinerybiomed-centralbmjbristol-university-presscellchicago-author-datechicago-noteschicago-notes-bibliographychicago-shortened-notes-bibliographycopernicus-publicationscurrent-opiniondeutsche-gesellschaft-fur-psychologiedeutsche-spracheelsevier-harvardelsevier-vancouverelsevier-with-titlesfrontiersfuture-medicinefuture-science-groupgost-r-7-0-5-2008-numericharvard-cite-them-rightieeeinstitute-of-physics-numerickarger-journalsmary-ann-liebert-vancouvermodern-language-associationmultidisciplinary-digital-publishing-institutenaturepensoft-journalsplosroyal-society-of-chemistrysage-vancouversist02spie-journalsspringer-basic-author-datespringer-basic-bracketsspringer-fachzeitschriften-medizin-psychologiespringer-humanities-author-datespringer-lecture-notes-in-computer-sciencespringer-mathphys-bracketsspringer-socpsych-author-datespringer-vancouvertaylor-and-francis-chicago-author-datetaylor-and-francis-national-library-of-medicinethe-institution-of-engineering-and-technologythe-lancetthieme-germantrends-journalsFormatting is expressed by decorated composition, and mapping tokens to your own domain is a recursive match:
fun convert(token: BibliographyToken): MyNode =
when (token) {
is Text -> MyText(token.text)
is Link -> MyLink(url = token.url, label = convert(token.label))
is Italic -> MyEmphasis(convert(token.token))
is Bold -> MyStrong(convert(token.token))
// ...
}Every published artifact embeds the catalog styles from the CSL styles project, and the WASM artifact additionally embeds locale data from the CSL locales project; both are licensed under CC BY-SA 3.0.