diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-09-06 16:25:16 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-09-21 10:15:50 -0700 |
commit | e0984a43a99231e72c02a0a716c8d0315de9abdf (patch) | |
tree | 8531ef58c2470d372ff2427a6ae09a6284461471 /test/command/issue58.csl | |
parent | 89c577befb78b32a0884b6092e0415c0dcadab72 (diff) | |
download | pandoc-e0984a43a99231e72c02a0a716c8d0315de9abdf.tar.gz |
Add built-in citation support using new citeproc library.
This deprecates the use of the external pandoc-citeproc
filter; citation processing is now built in to pandoc.
* Add dependency on citeproc library.
* Add Text.Pandoc.Citeproc module (and some associated unexported
modules under Text.Pandoc.Citeproc). Exports `processCitations`.
[API change]
* Add data files needed for Text.Pandoc.Citeproc: default.csl
in the data directory, and a citeproc directory that is just
used at compile-time. Note that we've added file-embed as a mandatory
rather than a conditional depedency, because of the biblatex
localization files. We might eventually want to use readDataFile
for this, but it would take some code reorganization.
* Text.Pandoc.Loging: Add `CiteprocWarning` to `LogMessage` and use it
in `processCitations`. [API change]
* Add tests from the pandoc-citeproc package as command tests (including
some tests pandoc-citeproc did not pass).
* Remove instructions for building pandoc-citeproc from CI and
release binary build instructions. We will no longer distribute
pandoc-citeproc.
* Markdown reader: tweak abbreviation support. Don't insert a
nonbreaking space after a potential abbreviation if it comes right before
a note or citation. This messes up several things, including citeproc's
moving of note citations.
* Add `csljson` as and input and output format. This allows pandoc
to convert between `csljson` and other bibliography formats,
and to generate formatted versions of CSL JSON bibliographies.
* Add module Text.Pandoc.Writers.CslJson, exporting `writeCslJson`. [API
change]
* Add module Text.Pandoc.Readers.CslJson, exporting `readCslJson`. [API
change]
* Added `bibtex`, `biblatex` as input formats. This allows pandoc
to convert between BibLaTeX and BibTeX and other bibliography formats,
and to generated formatted versions of BibTeX/BibLaTeX bibliographies.
* Add module Text.Pandoc.Readers.BibTeX, exporting `readBibTeX` and
`readBibLaTeX`. [API change]
* Make "standalone" implicit if output format is a bibliography format.
This is needed because pandoc readers for bibliography formats put
the bibliographic information in the `references` field of metadata;
and unless standalone is specified, metadata gets ignored.
(TODO: This needs improvement. We should trigger standalone for the
reader when the input format is bibliographic, and for the writer
when the output format is markdown.)
* Carry over `citationNoteNum` to `citationNoteNumber`. This was just
ignored in pandoc-citeproc.
* Text.Pandoc.Filter: Add `CiteprocFilter` constructor to Filter.
[API change] This runs the processCitations transformation.
We need to treat it like a filter so it can be placed
in the sequence of filter runs (after some, before others).
In FromYAML, this is parsed from `citeproc` or `{type: citeproc}`,
so this special filter may be specified either way in a defaults file
(or by `citeproc: true`, though this gives no control of positioning
relative to other filters). TODO: we need to add something to the
manual section on defaults files for this.
* Add deprecation warning if `upandoc-citeproc` filter is used.
* Add `--citeproc/-C` option to trigger citation processing.
This behaves like a filter and will be positioned
relative to filters as they appear on the command line.
* Rewrote the manual on citatations, adding a dedicated Citations
section which also includes some information formerly found in
the pandoc-citeproc man page.
* Look for CSL styles in the `csl` subdirectory of the pandoc user data
directory. This changes the old pandoc-citeproc behavior, which looked
in `~/.csl`. Users can simply symlink `~/.csl` to the `csl`
subdirectory of their pandoc user data directory if they want
the old behavior.
* Add support for CSL bibliography entry formatting to LaTeX, HTML,
Ms writers. Added CSL-related CSS to styles.html.
Diffstat (limited to 'test/command/issue58.csl')
-rw-r--r-- | test/command/issue58.csl | 553 |
1 files changed, 553 insertions, 0 deletions
diff --git a/test/command/issue58.csl b/test/command/issue58.csl new file mode 100644 index 000000000..b18500cc8 --- /dev/null +++ b/test/command/issue58.csl @@ -0,0 +1,553 @@ +<?xml version="1.0" encoding="utf-8"?> +<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never" page-range-format="chicago"> + <info> + <title>Chicago Manual of Style 16th edition (author-date) modif 2014-06-30</title> + <id></id> + <link href="" rel="self"/> + <link href="http://www.chicagomanualofstyle.org/tools_citationguide.html" rel="documentation"/> + <author> + <name>Julian Onions</name> + <email>julian.onions@gmail.com</email> + </author> + <contributor> + <name>Sebastian Karcher</name> + </contributor> + <contributor> + <name>Richard Karnesky</name> + <email>karnesky+zotero@gmail.com</email> + <uri>http://arc.nucapt.northwestern.edu/Richard_Karnesky</uri> + </contributor> + <contributor> + <name>Andrew Dunning</name> + <email>andrew.dunning@utoronto.ca</email> + </contributor> + <category citation-format="author-date"/> + <category field="generic-base"/> + <summary>The author-date variant of the Chicago style</summary> + <updated>2014-05-23T03:53:32+00:00</updated> + <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights> + </info> + <locale xml:lang="en"> + <terms> + <term name="editor" form="verb-short">ed.</term> + <term name="container-author" form="verb">by</term> + <term name="translator" form="verb-short">trans.</term> + <term name="editortranslator" form="verb"> + <single>edited and translated by</single> + <multiple>edited and translated by</multiple> + </term> + <term name="translator" form="short">trans.</term> + </terms> + </locale> + <macro name="secondary-contributors"> + <choose> + <if type="chapter paper-conference" match="none"> + <names variable="editor translator" delimiter=". "> + <label form="verb" text-case="capitalize-first" suffix=" "/> + <name and="text" delimiter=", "/> + </names> + </if> + </choose> + </macro> + <macro name="container-contributors"> + <choose> + <if type="chapter paper-conference" match="any"> + <group prefix=", " delimiter=", "> + <names variable="container-author" delimiter=", "> + <label form="verb" suffix=" "/> + <name and="text" delimiter=", "/> + </names> + <names variable="editor translator" delimiter=", "> + <label form="verb" suffix=" "/> + <name and="text" delimiter=", "/> + </names> + </group> + </if> + </choose> + </macro> + <macro name="editor"> + <names variable="editor"> + <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/> + <label form="short" prefix=", "/> + </names> + </macro> + <macro name="translator"> + <names variable="translator"> + <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/> + <label form="short" prefix=", "/> + </names> + </macro> + <macro name="recipient"> + <choose> + <if type="personal_communication"> + <choose> + <if variable="genre"> + <text variable="genre" text-case="capitalize-first"/> + </if> + <else> + <text term="letter" text-case="capitalize-first"/> + </else> + </choose> + </if> + </choose> + <names variable="recipient" delimiter=", "> + <label form="verb" prefix=" " text-case="lowercase" suffix=" "/> + <name and="text" delimiter=", "/> + </names> + </macro> + <macro name="noauthor-container-title"> + <choose> + <if variable="container-title"> + <choose> + <if type="article-journal article-magazine article-newspaper" match="any"> + <text macro="container-title"/> + </if> + </choose> + </if> + </choose> + </macro> + <macro name="contributors"> + <group delimiter=". "> + <names variable="author"> + <name and="text" name-as-sort-order="first" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/> + <label form="short" prefix=", "/> + <substitute> + <names variable="editor"/> + <names variable="translator"/> + <text macro="noauthor-container-title"/> + <text macro="title"/> + </substitute> + </names> + <text macro="recipient"/> + </group> + </macro> + <macro name="contributors-short"> + <names variable="author"> + <name form="short" and="text" delimiter=", " initialize-with=". "/> + <substitute> + <names variable="editor"/> + <names variable="translator"/> + <text macro="noauthor-container-title"/> + <text macro="title"/> + </substitute> + </names> + </macro> + <macro name="interviewer"> + <names variable="interviewer" delimiter=", "> + <label form="verb" prefix=" " text-case="capitalize-first" suffix=" "/> + <name and="text" delimiter=", "/> + </names> + </macro> + <macro name="archive"> + <group delimiter=". "> + <text variable="archive_location" text-case="capitalize-first"/> + <text variable="archive"/> + <text variable="archive-place"/> + </group> + </macro> + <macro name="access"> + <group delimiter=". "> + <choose> + <if type="graphic report" match="any"> + <text macro="archive"/> + </if> + <else-if type="article-journal bill book chapter legal_case legislation motion_picture paper-conference" match="none"> + <text macro="archive"/> + </else-if> + </choose> + <choose> + <if variable="issued" match="none"> + <group delimiter=" "> + <text term="accessed" text-case="capitalize-first"/> + <date variable="accessed" delimiter=" "> + <date-part name="month"/> + <date-part name="day"/> + </date> + </group> + </if> + </choose> + <choose> + <if type="legal_case" match="none"> + <choose> + <if variable="DOI"> + <text variable="DOI" prefix="doi:"/> + </if> + <else> + <text variable="URL"/> + </else> + </choose> + </if> + </choose> + </group> + </macro> + <macro name="title"> + <choose> + <if variable="title" match="none"> + <choose> + <if type="personal_communication" match="none"> + <text variable="genre" text-case="capitalize-first"/> + </if> + </choose> + </if> + <else-if type="bill book graphic legislation motion_picture report song" match="any"> + <text variable="title" text-case="title" font-style="italic"/> + <group prefix=" (" suffix=")" delimiter=" "> + <text term="version"/> + <text variable="version"/> + </group> + </else-if> + <else-if variable="reviewed-author"> + <group delimiter=", "> + <text variable="title" font-style="italic" prefix="Review of "/> + <names variable="reviewed-author"> + <label form="verb-short" text-case="lowercase" suffix=" "/> + <name and="text" delimiter=", "/> + </names> + </group> + </else-if> + <else-if type="legal_case interview" match="any"> + <text variable="title"/> + </else-if> + <else> + <text variable="title" text-case="title" quotes="true"/> + </else> + </choose> + </macro> + <macro name="edition"> + <choose> + <if type="bill book graphic legal_case legislation motion_picture report song" match="any"> + <choose> + <if is-numeric="edition"> + <group delimiter=" " prefix=". "> + <number variable="edition" form="ordinal"/> + <text term="edition" form="short" strip-periods="true"/> + </group> + </if> + <else> + <text variable="edition" prefix=". "/> + </else> + </choose> + </if> + <else-if type="chapter paper-conference" match="any"> + <choose> + <if is-numeric="edition"> + <group delimiter=" " prefix=", "> + <number variable="edition" form="ordinal"/> + <text term="edition" form="short"/> + </group> + </if> + <else> + <text variable="edition" prefix=", "/> + </else> + </choose> + </else-if> + </choose> + </macro> + <macro name="locators"> + <choose> + <if type="article-journal"> + <choose> + <if variable="volume"> + <text variable="volume" prefix=" "/> + <group prefix=" (" suffix=")"> + <choose> + <if variable="issue"> + <text variable="issue"/> + </if> + <else> + <date variable="issued"> + <date-part name="month"/> + </date> + </else> + </choose> + </group> + </if> + <else-if variable="issue"> + <group delimiter=" " prefix=", "> + <text term="issue" form="short"/> + <text variable="issue"/> + <date variable="issued" prefix="(" suffix=")"> + <date-part name="month"/> + </date> + </group> + </else-if> + <else> + <date variable="issued" prefix=", "> + <date-part name="month"/> + </date> + </else> + </choose> + </if> + <else-if type="legal_case"> + <text variable="volume" prefix=", "/> + <text variable="container-title" prefix=" "/> + <text variable="page" prefix=" "/> + </else-if> + <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any"> + <group prefix=". " delimiter=". "> + <group> + <text term="volume" form="short" text-case="capitalize-first" suffix=" "/> + <number variable="volume" form="numeric"/> + </group> + <group> + <number variable="number-of-volumes" form="numeric"/> + <text term="volume" form="short" prefix=" " plural="true"/> + </group> + </group> + </else-if> + <else-if type="chapter paper-conference" match="any"> + <choose> + <if variable="page" match="none"> + <group prefix=". "> + <text term="volume" form="short" text-case="capitalize-first" suffix=" "/> + <number variable="volume" form="numeric"/> + </group> + </if> + </choose> + </else-if> + </choose> + </macro> + <macro name="locators-chapter"> + <choose> + <if type="chapter paper-conference" match="any"> + <choose> + <if variable="page"> + <group prefix=", "> + <text variable="volume" suffix=":"/> + <text variable="page"/> + </group> + </if> + </choose> + </if> + </choose> + </macro> + <macro name="locators-article"> + <choose> + <if type="article-newspaper"> + <group prefix=", " delimiter=", "> + <group> + <text variable="edition" suffix=" "/> + <text term="edition" prefix=" "/> + </group> + <group> + <text term="section" form="short" suffix=" "/> + <text variable="section"/> + </group> + </group> + </if> + <else-if type="article-journal"> + <choose> + <if variable="volume issue" match="any"> + <text variable="page" prefix=": "/> + </if> + <else> + <text variable="page" prefix=", "/> + </else> + </choose> + </else-if> + </choose> + </macro> + <macro name="point-locators"> + <choose> + <if variable="locator"> + <choose> + <if locator="page" match="none"> + <choose> + <if type="bill book graphic legal_case legislation motion_picture report song" match="any"> + <choose> + <if variable="volume"> + <group> + <text term="volume" form="short" suffix=" "/> + <number variable="volume" form="numeric"/> + <label variable="locator" form="short" prefix=", " suffix=" "/> + </group> + </if> + <else> + <label variable="locator" form="short" suffix=" "/> + </else> + </choose> + </if> + <else> + <label variable="locator" form="short" suffix=" "/> + </else> + </choose> + </if> + <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any"> + <number variable="volume" form="numeric" suffix=":"/> + </else-if> + </choose> + <text variable="locator"/> + </if> + </choose> + </macro> + <macro name="container-prefix"> + <text term="in" text-case="capitalize-first"/> + </macro> + <macro name="container-title"> + <choose> + <if type="chapter paper-conference" match="any"> + <text macro="container-prefix" suffix=" "/> + </if> + </choose> + <choose> + <if type="legal_case" match="none"> + <text variable="container-title" text-case="title" font-style="italic"/> + </if> + </choose> + </macro> + <macro name="publisher"> + <group delimiter=": "> + <text variable="publisher-place"/> + <text variable="publisher"/> + </group> + </macro> + <macro name="date"> + <choose> + <if variable="issued"> + <date variable="issued"> + <date-part name="year"/> + </date> + </if> + <else-if variable="accessed"> + <date variable="accessed"> + <date-part name="year"/> + </date> + </else-if> + </choose> + </macro> + <macro name="day-month"> + <date variable="issued"> + <date-part name="month"/> + <date-part name="day" prefix=" "/> + </date> + </macro> + <macro name="collection-title"> + <choose> + <if match="none" type="article-journal"> + <choose> + <if match="none" is-numeric="collection-number"> + <group delimiter=", "> + <text variable="collection-title" text-case="title"/> + <text variable="collection-number"/> + </group> + </if> + <else> + <group delimiter=" "> + <text variable="collection-title" text-case="title"/> + <text variable="collection-number"/> + </group> + </else> + </choose> + </if> + </choose> + </macro> + <macro name="collection-title-journal"> + <choose> + <if type="article-journal"> + <group delimiter=" "> + <text variable="collection-title"/> + <text variable="collection-number"/> + </group> + </if> + </choose> + </macro> + <macro name="event"> + <group> + <text term="presented at" suffix=" "/> + <text variable="event"/> + </group> + </macro> + <macro name="description"> + <choose> + <if type="interview"> + <group delimiter=". "> + <text macro="interviewer"/> + <text variable="medium" text-case="capitalize-first"/> + </group> + </if> + <else> + <text variable="medium" text-case="capitalize-first" prefix=". "/> + </else> + </choose> + <choose> + <if variable="title" match="none"/> + <else-if type="thesis personal_communication speech" match="any"/> + <else> + <group delimiter=" " prefix=". "> + <text variable="genre" text-case="capitalize-first"/> + <choose> + <if type="report"> + <text variable="number"/> + </if> + </choose> + </group> + </else> + </choose> + </macro> + <macro name="issue"> + <choose> + <if type="legal_case"> + <text variable="authority" prefix=". "/> + </if> + <else-if type="speech"> + <group prefix=". " delimiter=", "> + <group delimiter=" "> + <text variable="genre" text-case="capitalize-first"/> + <text macro="event"/> + </group> + <text variable="event-place"/> + <text macro="day-month"/> + </group> + </else-if> + <else-if type="article-newspaper article-magazine personal_communication" match="any"> + <text macro="day-month" prefix=", "/> + </else-if> + <else> + <group prefix=". " delimiter=", "> + <choose> + <if type="thesis"> + <text variable="genre" text-case="capitalize-first"/> + </if> + </choose> + <text macro="publisher"/> + </group> + </else> + </choose> + </macro> + <citation et-al-min="4" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" givenname-disambiguation-rule="primary-name"> + <layout prefix="(" suffix=")" delimiter="; "> + <group delimiter=", "> + <group delimiter=" "> + <text macro="contributors-short"/> + <text macro="date"/> + </group> + <text macro="point-locators"/> + </group> + </layout> + </citation> + <bibliography hanging-indent="true" et-al-min="11" et-al-use-first="7" subsequent-author-substitute="———" entry-spacing="0"> + <sort> + <key macro="contributors"/> + <key variable="issued"/> + </sort> + <layout suffix="."> + <group delimiter=". "> + <text macro="contributors"/> + <text macro="date"/> + <text macro="title"/> + </group> + <text macro="description"/> + <text macro="secondary-contributors" prefix=". "/> + <text macro="container-title" prefix=". "/> + <text macro="container-contributors"/> + <text macro="edition"/> + <text macro="locators-chapter"/> + <text macro="collection-title-journal" prefix=", " suffix=", "/> + <text macro="locators"/> + <text macro="collection-title" prefix=". "/> + <text macro="issue"/> + <text macro="locators-article"/> + <text macro="access" prefix=". "/> + </layout> + </bibliography> +</style> |