Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 65 lines (42 sloc) 2.357 kB
baa8e6e Initial commit
John MacFarlane authored
1 # citeproc
2
3 citeproc is a standalone program that uses Andrea Rossato's [citeproc-hs]
4 to generate citations and a bibliography, given a database of bibliographic
5 references and a [CSL] stylesheet. The idea is to make it possible for
6 non-Haskell programs to use this excellent tool.
7
8 [citeproc-hs]: http://gorgias.mine.nu/repos/citeproc-hs/
9 [CSL]: http://citationstyles.org/
10
11 ## Usage
12
13 citeproc stylefile.csl bibliofile.bib
14
15 - The bibliography file can be in any of the formats that bibutils
16 supports.
17 - The program reads JSON from stdin and writes JSON to stdout.
18
19 ## Input
20
21 The input is a JSON array of citations.
22 A citation is a JSON array of cites.
23 A cite is a JSON object describing one source. Fields can include:
24
25 - `id` (string)
26 - `prefix` (string or array)
27 - `suffix` (string or array)
28 - `label` (string)
29 - `locator` (string)
30 - `position` (string)
31 - `near_note` (boolean)
32 - `suppress_author` (boolean)
33 - `author_in_text` (boolean)
34
35 `id` must be included; the rest are optional.
36
37 Sample input:
38
39 [[{"id":"item1","suffix":"test"}, {"id":"item2", "label":"chapter", "locator":"15", "suffix":["et ",["EMPH","passim"]]}],[{"id":"item3","author_in_text":true}]]
40
41 Note that `prefix` and `suffix` can be either plain strings or formatting text--a JSON
42 array consisting of plain strings or arrays in which the first string is a formatting
47f8212 Use NOTE for footnotes; fix note for author-in-text citations.
John MacFarlane authored
43 instruction: `EMPH`, `STRONG`, `SMALLCAPS`, `STRIKEOUT`, `SUPERSCRIPT`, `SUBSCRIPT`, `NOTE`.
baa8e6e Initial commit
John MacFarlane authored
44
bbd3e9d Fixed typo
John MacFarlane authored
45 ## Output
baa8e6e Initial commit
John MacFarlane authored
46
74d5d8e Updated README
John MacFarlane authored
47 The output is a JSON object with three fields:
baa8e6e Initial commit
John MacFarlane authored
48
49 - `citations` is a JSON array consisting of a list of citations. Each citation is
50 a JSON array representing formatted text as described above.
51
52 - `bibliography` is a JSON array consisting of a list of bibliographic items.
53 Each item is a JSON array representing formatted text as described above.
54
55 Sample output:
56
0826c38 Changed type to citation_type
John MacFarlane authored
57 {"citations":[["(Doe 2005 test; Doe 2006, 15et ",["EMPH",["passim"]],")"],["Doe and Roe(2007)"]],"bibliography":[["Doe, John. 2005. ",["EMPH",["First Book"]],". Cambridge: Cambridge University Press."],["———. 2006. Article. ",["EMPH",["Journal of Generic Studies"]]," ","6: 33-34."],["Doe, John, and Jenny Roe. 2007. Why Water Is Wet. In ",["EMPH",["Third Book"]],", ed. Sam Smith. Oxford: Oxford University Press."]],"citation_type":"in-text"}
baa8e6e Initial commit
John MacFarlane authored
58
59 ## Installing citeproc
60
ee0953d @jgm Updated README to mention cabal install
authored
61 Change to the source directory and:
baa8e6e Initial commit
John MacFarlane authored
62
ee0953d @jgm Updated README to mention cabal install
authored
63 cabal install
baa8e6e Initial commit
John MacFarlane authored
64
Something went wrong with that request. Please try again.