| 1 | /* |
|---|
| 2 | * Copyright (c) 2009 and 2010 Frank G. Bennett, Jr. All Rights |
|---|
| 3 | * Reserved. |
|---|
| 4 | * |
|---|
| 5 | * The contents of this file are subject to the Common Public |
|---|
| 6 | * Attribution License Version 1.0 (the “License”); you may not use |
|---|
| 7 | * this file except in compliance with the License. You may obtain a |
|---|
| 8 | * copy of the License at: |
|---|
| 9 | * |
|---|
| 10 | * http://bitbucket.org/fbennett/citeproc-js/src/tip/LICENSE. |
|---|
| 11 | * |
|---|
| 12 | * The License is based on the Mozilla Public License Version 1.1 but |
|---|
| 13 | * Sections 14 and 15 have been added to cover use of software over a |
|---|
| 14 | * computer network and provide for limited attribution for the |
|---|
| 15 | * Original Developer. In addition, Exhibit A has been modified to be |
|---|
| 16 | * consistent with Exhibit B. |
|---|
| 17 | * |
|---|
| 18 | * Software distributed under the License is distributed on an “AS IS” |
|---|
| 19 | * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See |
|---|
| 20 | * the License for the specific language governing rights and limitations |
|---|
| 21 | * under the License. |
|---|
| 22 | * |
|---|
| 23 | * The Original Code is the citation formatting software known as |
|---|
| 24 | * "citeproc-js" (an implementation of the Citation Style Language |
|---|
| 25 | * [CSL]), including the original test fixtures and software located |
|---|
| 26 | * under the ./std subdirectory of the distribution archive. |
|---|
| 27 | * |
|---|
| 28 | * The Original Developer is not the Initial Developer and is |
|---|
| 29 | * __________. If left blank, the Original Developer is the Initial |
|---|
| 30 | * Developer. |
|---|
| 31 | * |
|---|
| 32 | * The Initial Developer of the Original Code is Frank G. Bennett, |
|---|
| 33 | * Jr. All portions of the code written by Frank G. Bennett, Jr. are |
|---|
| 34 | * Copyright (c) 2009 and 2010 Frank G. Bennett, Jr. All Rights Reserved. |
|---|
| 35 | * |
|---|
| 36 | * Alternatively, the contents of this file may be used under the |
|---|
| 37 | * terms of the GNU Affero General Public License (the [AGPLv3] |
|---|
| 38 | * License), in which case the provisions of [AGPLv3] License are |
|---|
| 39 | * applicable instead of those above. If you wish to allow use of your |
|---|
| 40 | * version of this file only under the terms of the [AGPLv3] License |
|---|
| 41 | * and not to allow others to use your version of this file under the |
|---|
| 42 | * CPAL, indicate your decision by deleting the provisions above and |
|---|
| 43 | * replace them with the notice and other provisions required by the |
|---|
| 44 | * [AGPLv3] License. If you do not delete the provisions above, a |
|---|
| 45 | * recipient may use your version of this file under either the CPAL |
|---|
| 46 | * or the [AGPLv3] License.” |
|---|
| 47 | */ |
|---|
| 48 | |
|---|
| 49 | >>===== MODE =====>> |
|---|
| 50 | citation |
|---|
| 51 | <<===== MODE =====<< |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | >>===== RESULT =====>> |
|---|
| 55 | ..[0] <span style="text-decoration:underline;">(Johnson 1900)</span> |
|---|
| 56 | >>[1] <span style="text-decoration:underline;">(Lê, Smith, and Brown 2001)</span> |
|---|
| 57 | <<===== RESULT =====<< |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | >>===== CITATIONS =====>> |
|---|
| 61 | [ |
|---|
| 62 | [ |
|---|
| 63 | {"citationID":"29lvik1jdg", "citationItems":[{"uri":["http://zotero.org/users/67180/items/S4BWKRXZ"], "id":3}], "properties":{"field":"{\"citationID\":\"29lvik1jdg\",\"citationItems\":[{\"uri\":[\"http://zotero.org/users/67180/items/S4BWKRXZ\"]}]}", "index":0, "noteIndex":0}}, [], [] |
|---|
| 64 | ], |
|---|
| 65 | [ |
|---|
| 66 | {"citationID":"17gb9ben28", "citationItems":[{"uri":["http://zotero.org/users/67180/items/PHDTVW3W"], "id":6}], "properties":{"field":"{\"citationID\":\"17gb9ben28\",\"citationItems\":[{\"uri\":[\"http://zotero.org/users/67180/items/PHDTVW3W\"]}]}", "index":1, "noteIndex":0}}, [["29lvik1jdg", 0]], [] |
|---|
| 67 | ], |
|---|
| 68 | [ |
|---|
| 69 | {"citationID":"dkd3aklcr", "citationItems":[{"uri":["http://zotero.org/users/67180/items/MTHEQ8WZ"], "id":2}], "properties":{"field":"{\"citationID\":\"dkd3aklcr\",\"citationItems\":[{\"uri\":[\"http://zotero.org/users/67180/items/MTHEQ8WZ\"]}]}", "index":2, "noteIndex":0}}, [["29lvik1jdg", 0], ["17gb9ben28", 0]], [] |
|---|
| 70 | ], |
|---|
| 71 | [ |
|---|
| 72 | {"citationID":"29lvik1jdg", "citationItems":[{"uri":["http://zotero.org/users/67180/items/S4BWKRXZ"], "id":3}], "properties":{"field":"{\"citationID\":\"29lvik1jdg\",\"citationItems\":[{\"uri\":[\"http://zotero.org/users/67180/items/S4BWKRXZ\"]}]}", "index":0, "noteIndex":0}}, [], [] |
|---|
| 73 | ], |
|---|
| 74 | [ |
|---|
| 75 | {"citationID":"17gb9ben28", "citationItems":[{"uri":["http://zotero.org/users/67180/items/PHDTVW3W"], "id":6}], "properties":{"field":"{\"citationID\":\"17gb9ben28\",\"citationItems\":[{\"uri\":[\"http://zotero.org/users/67180/items/PHDTVW3W\"]}]}", "index":1, "noteIndex":0}}, [["29lvik1jdg", 0]], [] |
|---|
| 76 | ] |
|---|
| 77 | ] |
|---|
| 78 | <<===== CITATIONS =====<< |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | >>===== CSL =====>> |
|---|
| 83 | <style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" default-locale="en-US-x-sort-ja-alalc97-x-sec-en"> <!-- BOGUS COMMENT --> <info> <title>Chicago Manual of Style (Author-Date format)</title> <id>http://www.zotero.org/styles/chicago-author-date</id> <link href="http://www.zotero.org/styles/chicago-author-date" /> <author> <name>Julian Onions</name> <email>julian.onions@gmail.com</email> </author> <category term="author-date" /> <category term="generic-base" /> <updated /> <summary>The author-date variant of the Chicago style</summary> <link href="http://www.chicagomanualofstyle.org/tools_citationguide.html" rel="documentation" /> </info> <macro name="secondary-contributors"> <choose> <if match="none" type="chapter"> <group delimiter=". "> <choose> <if variable="author"> <names variable="editor"> <label form="verb-short" prefix=" " suffix=". " text-case="capitalize-first" /> <name and="text" delimiter=", " /> </names> </if> </choose> <choose> <if match="any" variable="author editor"> <names variable="translator"> <label form="verb-short" prefix=" " suffix=". " text-case="capitalize-first" /> <name and="text" delimiter=", " /> </names> </if> </choose> </group> </if> </choose> </macro> <macro name="container-contributors"> <choose> <if type="chapter"> <group delimiter=", " prefix=","> <choose> <if variable="author"> <names variable="editor"> <label form="verb-short" prefix=" " suffix=". " text-case="lowercase" /> <name and="text" delimiter=", " /> </names> </if> </choose> <choose> <if match="any" variable="author editor"> <names variable="translator"> <label form="verb-short" prefix=" " suffix=". " text-case="lowercase" /> <name and="text" delimiter=", " /> </names> </if> </choose> </group> </if> </choose> </macro> <macro name="anon"> <choose> <if match="none" variable="author editor translator"> <text form="short" term="anonymous" text-case="capitalize-first" /> </if> </choose> </macro> <macro name="editor"> <names variable="editor"> <name and="text" delimiter=", " delimiter-precedes-last="always" name-as-sort-order="first" sort-separator=", " /> <label form="short" prefix=", " suffix="." /> </names> </macro> <macro name="translator"> <names variable="translator"> <name and="text" delimiter=", " delimiter-precedes-last="always" name-as-sort-order="first" sort-separator=", " /> <label form="verb-short" prefix=", " suffix="." /> </names> </macro> <macro name="recipient"> <choose> <if type="personal_communication"> <choose> <if variable="genre"> <text text-case="capitalize-first" variable="genre" /> </if> <else> <text term="letter" text-case="capitalize-first" /> </else> </choose> </if> </choose> <names delimiter=", " variable="recipient"> <label form="verb" prefix=" " suffix=" " text-case="lowercase" /> <name and="text" delimiter=", " /> </names> </macro> <macro name="contributors"> <names variable="author"> <name and="text" delimiter=", " delimiter-precedes-last="always" name-as-sort-order="first" sort-separator=", " /> <label form="verb-short" prefix=", " suffix="." text-case="lowercase" /> <substitute> <text macro="editor" /> <text macro="translator" /> </substitute> </names> <text macro="anon" /> <text macro="recipient" /> </macro> <macro name="contributors-short"> <names variable="author"> <name and="text" delimiter=", " form="short" /> <substitute> <names variable="editor" /> <names variable="translator" /> </substitute> </names> <text macro="anon" /> </macro> <macro name="interviewer"> <names delimiter=", " variable="interviewer"> <label form="verb" prefix=" " suffix=" " text-case="capitalize-first" /> <name and="text" delimiter=", " /> </names> </macro> <macro name="archive"> <group delimiter=". "> <text text-case="capitalize-first" variable="archive_location" /> <text variable="archive" /> <text variable="archive-place" /> </group> </macro> <macro name="access"> <group delimiter=". "> <choose> <if match="any" type="graphic report"> <text macro="archive" /> </if> <else-if match="none" type="book thesis chapter article-journal article-newspaper article-magazine"> <text macro="archive" /> </else-if> </choose> <text prefix="doi:" variable="DOI" /> <text variable="URL" /> </group> </macro> <macro name="title"> <choose> <if match="none" variable="title"> <choose> <if match="none" type="personal_communication"> <text text-case="capitalize-first" variable="genre" /> </if> </choose> </if> <else-if type="book"> <text font-style="italic" variable="title" /> </else-if> <else> <text variable="title" /> </else> </choose> </macro> <macro name="edition"> <choose> <if match="any" type="book chapter"> <choose> <if is-numeric="edition"> <group delimiter=" "> <number form="ordinal" variable="edition" /> <text form="short" suffix="." term="edition" /> </group> </if> <else> <text suffix="." variable="edition" /> </else> </choose> </if> </choose> </macro> <macro name="locators"> <choose> <if type="article-journal"> <text prefix=" " variable="volume" /> <text prefix=", no. " variable="issue" /> </if> <else-if type="book"> <group delimiter=". " prefix=". "> <group> <text form="short" suffix=". " term="volume" text-case="capitalize-first" /> <number form="numeric" variable="volume" /> </group> <group> <number form="numeric" variable="number-of-volumes" /> <text form="short" plural="true" prefix=" " suffix="." term="volume" /> </group> </group> </else-if> </choose> </macro> <macro name="locators-chapter"> <choose> <if type="chapter"> <group prefix=", "> <text suffix=":" variable="volume" /> <text variable="page" /> </group> </if> </choose> </macro> <macro name="locators-article"> <choose> <if type="article-newspaper"> <group delimiter=", " prefix=", "> <group> <text suffix=" " variable="edition" /> <text prefix=" " term="edition" /> </group> <group> <text form="short" suffix=". " term="section" /> <text variable="section" /> </group> </group> </if> <else-if type="article-journal"> <text prefix=": " variable="page" /> </else-if> </choose> </macro> <macro name="point-locators"> <group> <choose> <if locator="page" match="none"> <label form="short" strip-periods="false" suffix=" " variable="locator" /> </if> </choose> <text variable="locator" /> </group> </macro> <macro name="container-prefix"> <text term="in" text-case="capitalize-first" /> </macro> <macro name="container-title"> <choose> <if type="chapter"> <text macro="container-prefix" suffix=" " /> </if> </choose> <text font-style="italic" variable="container-title" form="short"/> </macro> <macro name="publisher"> <group delimiter=": "> <text variable="publisher-place" /> <text variable="publisher" /> </group> </macro> <macro name="date"> <date variable="issued" form="text" date-parts="year"><date-part name="year"/></date> </macro> <macro name="day-month"> <date variable="issued"> <date-part name="month" /> <date-part name="day" prefix=" " /> </date> </macro> <macro name="collection-title"> <text variable="collection-title" /> <text prefix=" " variable="collection-number" /> </macro> <macro name="event"> <group> <text suffix=" " term="presented at" /> <text variable="event" /> </group> </macro> <macro name="description"> <group delimiter=". "> <text macro="interviewer" /> <text text-case="capitalize-first" variable="medium" /> </group> <choose> <if match="none" variable="title"> </if> <else-if type="thesis"> </else-if> <else> <text prefix=". " text-case="capitalize-first" variable="genre" /> </else> </choose> </macro> <macro name="issue"> <choose> <if type="article-journal"> <text macro="day-month" prefix=" (" suffix=")" /> </if> <else-if type="speech"> <group delimiter=", " prefix=" "> <text macro="event" /> <text macro="day-month" /> <text variable="event-place" /> </group> </else-if> <else-if match="any" type="article-newspaper article-magazine"> <text macro="day-month" prefix=", " /> </else-if> <else> <group delimiter=", " prefix=". "> <choose> <if type="thesis"> <text text-case="capitalize-first" variable="genre" /> </if> </choose> <text macro="publisher" /> <text macro="day-month" /> </group> </else> </choose> </macro> <citation disambiguate-add-givenname="true" disambiguate-add-names="true" disambiguate-add-year-suffix="true" et-al-min="4" et-al-subsequent-min="4" et-al-subsequent-use-first="1" et-al-use-first="1"> <layout text-decoration="underline" delimiter="; " prefix="(" suffix=")"> <group delimiter=", "> <group delimiter=" "> <text macro="contributors-short" /> <text macro="date" /> </group> <text macro="point-locators" /> </group> </layout> </citation> <bibliography entry-spacing="0" et-al-min="11" et-al-use-first="7" hanging-indent="true" subsequent-author-substitute="---"> <sort> <key macro="contributors" /> <key variable="issued" /> </sort> <layout suffix="."> <text macro="contributors" suffix=". " /> <text macro="date" suffix=". " /> <text macro="title" /> <text macro="description"/> <text macro="secondary-contributors" prefix=". " /> <text macro="container-title" prefix=". "/> <text macro="container-contributors" /> <text macro="locators-chapter" /> <text macro="edition" prefix=". " /> <text macro="locators" /> <text macro="collection-title" prefix=". " /> <text macro="issue" /> <text macro="locators-article" /> <text macro="access" prefix=". " /> </layout> </bibliography></style> |
|---|
| 84 | <<===== CSL =====<< |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | >>===== INPUT =====>> |
|---|
| 88 | [ |
|---|
| 89 | {"id":3,"type":"book","title":"Albondigas","author":[{"family":"Johnson","given":"Charles"}],"issued":{"date-parts":[[1900]]}}, |
|---|
| 90 | {"id":6,"type":"book","title":"Book X","author":[{"family":"Lê","given":"Cao Đài"},{"family":"Smith","given":"John"},{"family":"Brown","given":"James"}],"issued":{"date-parts":[[2001]]}}, |
|---|
| 91 | {"id":2,"type":"book","title":"My Little Book","author":[{"family":"Smith","given":"John"}],"issued":{"date-parts":[[1955]]}} |
|---|
| 92 | ] |
|---|
| 93 | <<===== INPUT =====<< |
|---|