Skip to content

Processor input (JSON)

inukshuk edited this page Nov 5, 2011 · 8 revisions

Naming Conventions

In order to come up with definitive naming conventions for CSL Processor input, here is a (work in progress) collection of inconsistencies found in the current JSON format. Since the majority of attributes use a minus to separate terms, this list includes strictly camel-cased names.

Citation Data

  • citationItems
  • noteIndex (properties)
  • ciationID
  • sortedItems

Items

The valid items seem to distinguish between minus and underscore in that the minus seems to be used to distinguish between subtypes and the underscore is used to connect terms. For example, it is motion_picture' but article-journal'. This approach is consistent by itself, but since the most other attributes use a minus as a connector I find this confusing; is the distinction really necessary, or could we use a minus everywhere? An alternative would be to use `/' for sub-typing.

  • shortTitle
  • journalAbbreviations
  • archive_location / archive-place

Names

Both non-dropping-particle' is really long; wouldn't it be easier to have particle' and dropping-particle' and demote-particle'?

  • isInstitution

Bibliography Input

To filter items to be included in the bibliography, a list of conditions can be passed in an array. As far as I can tell, the order of the individual elements in the array is of no concern; each element has exactly two properties: 'field' and 'value'. Instead of an array of hashes, it seems to me, a single hash would suffice. For example

var myarg = {
  "select" : [
    {
      "field" : "type",
      "value" : "book"
    },
    {
      "field" : "categories",
      "value" : "1990s"
    }
  ]
}

Could then be written as:

var myarg = {
  "select" : {
    "type" : "book",
    "categories" : "1990s"
  }
}

Bibliography Output

  • bibliography_errors (the contents too, but perhaps these can remain implementation depependent?)

These are just suggestions:

  • line-spacing instead of linespacing
  • entry-spacing instead of entryspacing
  • indent or hanging-indent instead of hangingindent
  • offset or max-offset instead of maxoffset
  • preamble or before instead of bibstart
  • postamble or after instead of bibend (I know postamble is probably not proper English outside of Computer Science, but GNU Make uses it, for example)

Citation Output

  • citation_errors (same as above)
Clone this wiki locally