{"id":13647000,"url":"https://github.com/jgm/citeproc","last_synced_at":"2025-05-07T20:12:39.439Z","repository":{"id":2109445,"uuid":"293376323","full_name":"jgm/citeproc","owner":"jgm","description":"CSL citation processing library in Haskell","archived":false,"fork":false,"pushed_at":"2025-03-28T05:08:01.000Z","size":1401,"stargazers_count":168,"open_issues_count":22,"forks_count":20,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-07T20:12:32.596Z","etag":null,"topics":["bibliography","citations","citeproc","csl","pandoc"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jgm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-06T23:09:00.000Z","updated_at":"2025-05-04T22:40:19.000Z","dependencies_parsed_at":"2024-01-14T10:16:06.974Z","dependency_job_id":"c6dd24ce-5fd4-4e71-bece-ff82d1d1e02a","html_url":"https://github.com/jgm/citeproc","commit_stats":{"total_commits":450,"total_committers":7,"mean_commits":64.28571428571429,"dds":0.07333333333333336,"last_synced_commit":"7e0a9a39811098577f037e12bd8a897e109e8753"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgm%2Fciteproc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgm%2Fciteproc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgm%2Fciteproc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgm%2Fciteproc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgm","download_url":"https://codeload.github.com/jgm/citeproc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252949285,"owners_count":21830153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bibliography","citations","citeproc","csl","pandoc"],"created_at":"2024-08-02T01:03:18.006Z","updated_at":"2025-05-07T20:12:39.395Z","avatar_url":"https://github.com/jgm.png","language":"Haskell","funding_links":[],"categories":["Haskell"],"sub_categories":[],"readme":"# citeproc\n\n[![BSD2 license](https://img.shields.io/badge/license-BSD2-blue.svg)](LICENSE)\n[![CI\ntests](https://github.com/jgm/citeproc/workflows/CI%20tests/badge.svg)](https://github.com/jgm/citeproc/actions)\n[![Hackage](https://img.shields.io/hackage/v/citeproc.svg)](https://hackage.haskell.org/package/citeproc)\n\nThis library generates citations and bibliography formatted\naccording to a [CSL] style.  Currently version 1.0.2 of the CSL\nspec is targeted.\n\nThis library is a successor to pandoc-citeproc, which was a fork\nof Andrea Rossato's citeproc-hs.  I always found it difficult to\nfix bugs in pandoc-citeproc and decided that implementing\nciteproc from scratch would give me a better basis for\nunderstanding.  This library has a number of other advantages\nover pandoc-citeproc:\n\n- it is much faster (as a rough benchmark, running the CSL\n  test suite takes less than 4 seconds with this library,\n  compared to 12 seconds with pandoc-citeproc)\n\n- it interprets CSL more faithfully, passing more of the CSL\n  tests\n\n- it has fewer dependencies (in particular, it does not depend\n  on pandoc)\n\n- it is more flexible, not being tied to pandoc's types.\n\nUnlike pandoc-citeproc, this library does not provide an\nexecutable.  It will be used in pandoc itself to provide\nintegrated citation support and bibliography format conversion\n(so the pandoc-citeproc filter will no longer be necessary).\n\n[CSL]: https://docs.citationstyles.org/en/stable/specification.html\n\n## How to use it\n\nThe main point of entry is the function `citeproc` from the\nmodule `Citeproc`.  This takes as arguments:\n\n- a `CiteprocOptions` structure, which includes the following options:\n\n  * `linkCitations` controls whether citations are hyperlinked \n     to the bibliography.\n\n  * `linkBibliography` automatically linkifies any identifiers (DOI, \n     PMCID, PMID, or URL) appearing in a bibliography entry.  When an\n     entry has a DOI, PMCID, PMID, or URL available but none of these\n     are rendered by the style, add a link to the title (or, if no title\n     is present, the whole entry), using the URL for the DOI, PMCID, \n     PMID, or URL (in that order of priority).  See\n     [Appendix VI](https://github.com/citation-style-language/documentation/blob/master/specification.rst#appendix-vi-links)\n     of the CSL v1.0.2 spec.\n\n\n- a `Style`, which you will want to produce by parsing a CSL\n  style file using `parseStyle` from `Citeproc.Style`.\n\n- Optionally a `Lang`, which allows you to override a default locale,\n\n- a list of `Reference`s, which you can produce from a CSL JSON\n  bibliography using aeson's `decode`,\n\n- a list of `Citation`s (each of which may have multiple\n  `CitationItems`).\n\nIt yields a `Result`, which includes a list of formatted\ncitations and a formatted bibliography, as well any warnings\nproduced in evaluating the style.\n\nThe types are parameterized on a `CiteprocOutput` instance `a`,\nwhich represents formatted content in your bibliographic\nfields (e.g. the title).  If you want a classic CSL processor,\nyou can use `CslJson Text`.  But you can also use another type,\nsuch as a pandoc `Inlines`.  All you need to do is define\nan instance of `CiteprocOutput` for your type.\n\nThe signature of `parseStyle` may not be self-evident:\nthe first argument is a function that takes a URL and\nretrieves the text from that URL.  This is used to fetch\nthe \"indendent parent\" of a dependent style.  You can supply\nwhatever function you like: it can search your local file\nsystem or fetch the content via HTTP.  If you're not using\ndependent styles, you can get by with `\\_ -\u003e return mempty`.\n\n## The citeproc executable\n\nIf the package is compiled with the `executable` flag, an\nexecutable `citeproc` will be built.  `citeproc` reads\na JSON-encoded `Inputs` object from `stdin` (or from\na file if a filename is provided) and writes\na JSON-encoded `Result` object to `stdout`.  This executable\ncan be used to add citation processing to non-Haskell projects.\n\n`citeproc --help` will summarize usage information.  See\nthe [man page](man/citeproc.1.md) for more information.\n\n## Known bugs and limitations\n\nAlthough this library is much more accurate in implementing the\nCSL spec than pandoc-citeproc was, it still fails some of the\ntests from the CSL test suite (62/818).  However, most of the\nfailures are on minor corner cases, and in many cases the\nexpected behavior goes beyond what is required by the CSL spec.\n(For example, we intentionally refrain from capitalizing\nterms in initial position in note styles. It makes more sense\nfor the calling program, e.g. pandoc, to do the capitalization\nwhen it puts the citations in notes, since some citations\nin note styles may already be in notes and in this case\ntheir rendering may not require capitalization. It is easy\nto capitalize reliably, hard to uncapitalize reliably.)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgm%2Fciteproc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgm%2Fciteproc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgm%2Fciteproc/lists"}