pandoc-citeproc: Supports using pandoc with citeproc

[ bsd3, deprecated, library, program, text ] [ Propose Tags ]
Deprecated in favor of citeproc

The pandoc-citeproc library exports functions for using the citeproc system with pandoc. It relies on citeproc-hs, a library for rendering bibliographic reference citations into a variety of styles using a macro language called Citation Style Language (CSL). More details on CSL can be found here: http://citationstyles.org/.

Currently this package includes a copy of the citeproc-hs code. When citeproc-hs is updated to be compatible, this package will simply depend on citeproc-hs.

This package also contains an executable: pandoc-citeproc, which works as a pandoc filter (pandoc >= 1.12), and also has a mode for converting bibliographic databases a YAML format suitable for inclusion in pandoc YAML metadata.


[Skip to Readme]

Flags

Automatic Flags
NameDescriptionDefault
small_base

Choose the new smaller, split-up base package.

Enabled
bibutils

Use Chris Putnam's Bibutils.

Enabled
network

Use network and HTTP to retrieve csl file from URIs.

Enabled
hexpat

Use hexpat to parse XML

Enabled
embed_data_files

Embed locale files into the library (needed for windows packaging)

Disabled
unicode_collation

Use Haskell bindings to the International Components for Unicode (ICU) libraries

Disabled
test_citeproc

Build the test-citeproc program

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1, 0.1.1, 0.1.1.1, 0.1.1.2, 0.1.2, 0.1.2.1, 0.2, 0.3, 0.3.0.1, 0.3.1, 0.4, 0.4.0.1, 0.5, 0.6, 0.6.0.1, 0.7, 0.7.0.1, 0.7.0.2, 0.7.1, 0.7.1.1, 0.7.2, 0.7.3, 0.7.3.1, 0.7.4, 0.8, 0.8.0.1, 0.8.1, 0.8.1.1, 0.8.1.2, 0.8.1.3, 0.9, 0.9.1, 0.9.1.1, 0.10, 0.10.1, 0.10.1.1, 0.10.1.2, 0.10.1.3, 0.10.1.4, 0.10.2, 0.10.2.1, 0.10.2.2, 0.10.3, 0.10.4, 0.10.4.1, 0.10.5, 0.10.5.1, 0.11, 0.11.1, 0.11.1.1, 0.11.1.2, 0.11.1.3, 0.12, 0.12.1, 0.12.1.1, 0.12.2, 0.12.2.1, 0.12.2.2, 0.12.2.3, 0.12.2.4, 0.12.2.5, 0.13, 0.13.0.1, 0.14, 0.14.1, 0.14.1.1, 0.14.1.2, 0.14.1.3, 0.14.1.4, 0.14.1.5, 0.14.2, 0.14.3, 0.14.3.1, 0.14.4, 0.14.5, 0.14.6, 0.14.7, 0.14.8, 0.14.8.1, 0.15, 0.15.0.1, 0.16, 0.16.0.1, 0.16.0.2, 0.16.1, 0.16.1.1, 0.16.1.2, 0.16.1.3, 0.16.2, 0.16.3, 0.16.3.1, 0.16.4, 0.16.4.1, 0.17, 0.17.0.1, 0.17.0.2
Change log changelog
Dependencies aeson, aeson-pretty (<0.8), attoparsec, base (>=4 && <4.8), bytestring, containers (>=0.4 && <0.6), directory, filepath, ghc-prim, hexpat (>=0.20.2), hs-bibutils (>=0.3), HTTP (>=4000.0.9), mtl, network (>=2 && <2.6), old-locale, pandoc (>=1.12.1 && <1.14), pandoc-citeproc, pandoc-types (>=1.12.3 && <1.13), parsec, process, rfc5051, split, syb, tagsoup, temporary (>=1.1), texmath (>=0.6.4), text, text-icu, time, vector (>=0.10 && <0.11), xml, yaml (>=0.8.8.2) [details]
License BSD-3-Clause
Author John MacFarlane, Andrea Rossato
Maintainer jgm@berkeley.edu
Revised Revision 1 made by HerbertValerioRiedel at 2019-01-06T15:39:43Z
Category Text
Source repo head: git clone git://github.com/jgm/pandoc-citeproc.git
Uploaded by JohnMacFarlane at 2014-05-05T02:59:10Z
Distributions Debian:0.17.0.1, FreeBSD:0.7.3.1
Reverse Dependencies 3 direct, 30 indirect [details]
Executables test-citeproc, pandoc-citeproc
Downloads 103371 total (142 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Successful builds reported [all 1 reports]

Readme for pandoc-citeproc-0.3.1

[back to package description]

pandoc-citeproc

This package provides a library and executable to facilitate the use of citeproc with pandoc 1.12 and greater. (Earlier versions of pandoc have integrated citeproc support.)

The current version of the package includes code from citeproc-hs, which has not been updated for some time. When citeproc-hs is brought up to date, this code can be removed and this package will depend on citeproc-hs.

pandoc-citeproc

The pandoc-citeproc executable is a filter that takes a JSON-encoded Pandoc document, formats citations and adds a bibliography, and returns a JSON-encoded pandoc document.

To process citations with pandoc, call pandoc-citeproc as a filter:

pandoc --filter pandoc-citeproc input.md -s -o output.html

The bibliography will be put into a pandoc Div container with class references.

pandoc-citeproc will look for the following metadata fields in the input:

bibliography: A path, or YAML list of paths, of bibliography files to use. These may be in any of the formats supported by bibutils.

Format            File extension
------------      --------------
MODS              .mods
BibLaTeX          .bib
BibTeX            .bibtex
RIS               .ris
EndNote           .enl
EndNote XML       .xml
ISI               .wos
MEDLINE           .medline
Copac             .copac
JSON citeproc     .json
YAML citeproc     .yaml

Note that the YAML bibliography should be a YAML object with a
field `references` containing a list of YAML references.

references: A YAML list of references. Each reference is a YAML object. The format is essentially CSL JSON format. Here is an example:

- id: doe2006
  author:
    family: Doe
    given: [John, F.]
  title: Article
  page: 33-34
  issued:
    year: 2006
  type: article-journal
  volume: 6
  container-title: Journal of Generic Studies

The contents of fields will be interpreted as markdown when appropriate: so, for example, emphasis and strong emphasis can be used in title fileds. Simple tex math will also be parsed and rendered appropriately.

csl or citation-style: Path to a CSL style file. If the file is not found relative to the working directory, pandoc-citeproc will look in the $HOME/.csl directory (or C:\Users\USERNAME\AppData\Roaming\csl in Windows 7).

locale: Locale to use in place of the style's default locale.

citation-abbreviations: Path to a CSL abbreviations JSON file. The format is described here. Here is a short example:

{ "default": {
    "container-title": {
            "Lloyd's Law Reports": "Lloyd's Rep",
            "Estates Gazette": "EG",
            "Scots Law Times": "SLT"
    }
  }
}

The metadata must contain either references or bibliography or both as a source of references. csl and citation-abbreviations are optional. If csl is not provided, chicago-author-date.csl will be used by default.

pandoc-citeproc [bib2yaml|bib2json]

If pandoc-citeproc is given the argument bib2yaml or bib2json, it will not process citations. Instead, it will convert a bibliography (either from stdin or in one or more files specified on the command line) to a pandoc YAML metadata section or to CSL JSON suitable for import into Zotero. If input comes from stdin, the -f/--format option must be used to specify the format of the bibliography; otherwise, pandoc will try to determine it from the first file's extension.

This mode of pandoc-citeproc supersedes the old biblio2yaml program.

Text.CSL.Pandoc

Those who use pandoc as a library (e.g. in a web application) will need to use this module to process citations.

The module exports two functions, processCites, which is pure and accepts a style and a list of references as arguments, and processCites', which lives in the IO monad and derives the style and references from the document's metadata.